From cd2c6b1af3d2fd8b114804a604a6b621fbed92c3 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 6 Nov 2024 19:26:27 +0000 Subject: [PATCH] Regenerated Clients --- .../0240285e200940b4b9ddc7365f84bedc.json | 8 + .../1d4f46568ff44d06b2955b13f48b3ea3.json | 8 + .../d0e8e1e02d974b07afd0dc3ed6993c4d.json | 8 + .../d289bc5a01334efcb6ce4a12c42dace1.json | 8 + .../db7999ccd5734778a1ef4e32943335f7.json | 8 + .../ded509a6c7724812a43bed9b77cbdad2.json | 8 + service/codebuild/api_op_CreateFleet.go | 56 +- service/codebuild/api_op_UpdateFleet.go | 56 +- service/codebuild/deserializers.go | 89 ++ service/codebuild/serializers.go | 48 + service/codebuild/types/enums.go | 41 +- service/codebuild/types/types.go | 129 ++- service/guardduty/api_op_AcceptInvitation.go | 5 + service/guardduty/api_op_ArchiveFindings.go | 5 + service/guardduty/api_op_CreateFilter.go | 5 + service/guardduty/api_op_CreateIPSet.go | 5 + service/guardduty/api_op_CreateMembers.go | 5 + .../api_op_CreatePublishingDestination.go | 5 + .../guardduty/api_op_CreateSampleFindings.go | 5 + .../guardduty/api_op_CreateThreatIntelSet.go | 5 + service/guardduty/api_op_DeleteDetector.go | 5 + service/guardduty/api_op_DeleteFilter.go | 5 + service/guardduty/api_op_DeleteIPSet.go | 5 + service/guardduty/api_op_DeleteMembers.go | 5 + .../api_op_DeletePublishingDestination.go | 5 + .../guardduty/api_op_DeleteThreatIntelSet.go | 5 + .../guardduty/api_op_DescribeMalwareScans.go | 5 + ...pi_op_DescribeOrganizationConfiguration.go | 5 + .../api_op_DescribePublishingDestination.go | 5 + .../guardduty/api_op_GetCoverageStatistics.go | 5 + service/guardduty/api_op_GetDetector.go | 5 + service/guardduty/api_op_GetFilter.go | 5 + service/guardduty/api_op_GetFindings.go | 5 + .../guardduty/api_op_GetFindingsStatistics.go | 5 + service/guardduty/api_op_GetIPSet.go | 5 + .../api_op_GetMalwareScanSettings.go | 5 + service/guardduty/api_op_GetMasterAccount.go | 5 + .../guardduty/api_op_GetMemberDetectors.go | 5 + service/guardduty/api_op_GetMembers.go | 5 + .../api_op_GetRemainingFreeTrialDays.go | 5 + service/guardduty/api_op_GetThreatIntelSet.go | 5 + .../guardduty/api_op_GetUsageStatistics.go | 5 + service/guardduty/api_op_InviteMembers.go | 5 + service/guardduty/api_op_ListCoverage.go | 5 + service/guardduty/api_op_ListFilters.go | 5 + service/guardduty/api_op_ListFindings.go | 5 + service/guardduty/api_op_ListIPSets.go | 5 + service/guardduty/api_op_ListMembers.go | 5 + .../api_op_ListPublishingDestinations.go | 5 + .../guardduty/api_op_ListThreatIntelSets.go | 5 + .../api_op_StartMonitoringMembers.go | 5 + .../guardduty/api_op_StopMonitoringMembers.go | 5 + service/guardduty/api_op_UnarchiveFindings.go | 5 + service/guardduty/api_op_UpdateDetector.go | 5 + service/guardduty/api_op_UpdateFilter.go | 5 + .../api_op_UpdateFindingsFeedback.go | 5 + service/guardduty/api_op_UpdateIPSet.go | 5 + .../api_op_UpdateMalwareScanSettings.go | 5 + .../guardduty/api_op_UpdateMemberDetectors.go | 5 + .../api_op_UpdateOrganizationConfiguration.go | 5 + .../api_op_UpdatePublishingDestination.go | 5 + .../guardduty/api_op_UpdateThreatIntelSet.go | 5 + service/guardduty/deserializers.go | 95 ++ service/guardduty/types/types.go | 50 +- .../api_op_CreateLFTagExpression.go | 176 ++++ .../api_op_DeleteLFTagExpression.go | 158 +++ .../api_op_GetLFTagExpression.go | 172 ++++ ...api_op_GetTemporaryGlueTableCredentials.go | 3 + .../api_op_ListLFTagExpressions.go | 258 +++++ .../lakeformation/api_op_RegisterResource.go | 2 +- .../api_op_UpdateLFTagExpression.go | 167 ++++ .../api_op_UpdateTableStorageOptimizer.go | 2 +- service/lakeformation/deserializers.go | 920 +++++++++++++++++- service/lakeformation/generated.json | 5 + service/lakeformation/serializers.go | 488 ++++++++++ .../api_op_CreateLFTagExpression.go.snap | 41 + .../api_op_DeleteLFTagExpression.go.snap | 41 + .../api_op_GetLFTagExpression.go.snap | 41 + .../api_op_ListLFTagExpressions.go.snap | 40 + .../api_op_UpdateLFTagExpression.go.snap | 41 + service/lakeformation/snapshot_test.go | 120 +++ service/lakeformation/types/enums.go | 20 +- service/lakeformation/types/types.go | 57 +- service/lakeformation/validators.go | 194 +++- service/qapps/api_op_BatchCreateCategory.go | 162 +++ service/qapps/api_op_BatchDeleteCategory.go | 161 +++ service/qapps/api_op_BatchUpdateCategory.go | 162 +++ service/qapps/api_op_ListCategories.go | 160 +++ service/qapps/deserializers.go | 559 +++++++++++ service/qapps/generated.json | 4 + service/qapps/serializers.go | 424 ++++++++ .../api_op_BatchCreateCategory.go.snap | 41 + .../api_op_BatchDeleteCategory.go.snap | 41 + .../api_op_BatchUpdateCategory.go.snap | 41 + .../snapshot/api_op_ListCategories.go.snap | 41 + service/qapps/snapshot_test.go | 96 ++ service/qapps/types/types.go | 46 + service/qapps/validators.go | 240 +++++ service/s3control/api_op_GetAccessPoint.go | 2 +- service/s3control/deserializers.go | 4 +- service/s3control/types/types.go | 4 +- .../api_op_BatchGetPolicy.go | 170 ++++ .../api_op_BatchIsAuthorized.go | 2 +- .../api_op_BatchIsAuthorizedWithToken.go | 2 +- service/verifiedpermissions/deserializers.go | 409 ++++++++ service/verifiedpermissions/generated.json | 1 + service/verifiedpermissions/serializers.go | 113 +++ .../snapshot/api_op_BatchGetPolicy.go.snap | 41 + service/verifiedpermissions/snapshot_test.go | 24 + service/verifiedpermissions/types/enums.go | 19 + service/verifiedpermissions/types/types.go | 115 ++- .../types/types_exported_test.go | 8 + service/verifiedpermissions/validators.go | 78 ++ 113 files changed, 6826 insertions(+), 152 deletions(-) create mode 100644 .changelog/0240285e200940b4b9ddc7365f84bedc.json create mode 100644 .changelog/1d4f46568ff44d06b2955b13f48b3ea3.json create mode 100644 .changelog/d0e8e1e02d974b07afd0dc3ed6993c4d.json create mode 100644 .changelog/d289bc5a01334efcb6ce4a12c42dace1.json create mode 100644 .changelog/db7999ccd5734778a1ef4e32943335f7.json create mode 100644 .changelog/ded509a6c7724812a43bed9b77cbdad2.json create mode 100644 service/lakeformation/api_op_CreateLFTagExpression.go create mode 100644 service/lakeformation/api_op_DeleteLFTagExpression.go create mode 100644 service/lakeformation/api_op_GetLFTagExpression.go create mode 100644 service/lakeformation/api_op_ListLFTagExpressions.go create mode 100644 service/lakeformation/api_op_UpdateLFTagExpression.go create mode 100644 service/lakeformation/snapshot/api_op_CreateLFTagExpression.go.snap create mode 100644 service/lakeformation/snapshot/api_op_DeleteLFTagExpression.go.snap create mode 100644 service/lakeformation/snapshot/api_op_GetLFTagExpression.go.snap create mode 100644 service/lakeformation/snapshot/api_op_ListLFTagExpressions.go.snap create mode 100644 service/lakeformation/snapshot/api_op_UpdateLFTagExpression.go.snap create mode 100644 service/qapps/api_op_BatchCreateCategory.go create mode 100644 service/qapps/api_op_BatchDeleteCategory.go create mode 100644 service/qapps/api_op_BatchUpdateCategory.go create mode 100644 service/qapps/api_op_ListCategories.go create mode 100644 service/qapps/snapshot/api_op_BatchCreateCategory.go.snap create mode 100644 service/qapps/snapshot/api_op_BatchDeleteCategory.go.snap create mode 100644 service/qapps/snapshot/api_op_BatchUpdateCategory.go.snap create mode 100644 service/qapps/snapshot/api_op_ListCategories.go.snap create mode 100644 service/verifiedpermissions/api_op_BatchGetPolicy.go create mode 100644 service/verifiedpermissions/snapshot/api_op_BatchGetPolicy.go.snap diff --git a/.changelog/0240285e200940b4b9ddc7365f84bedc.json b/.changelog/0240285e200940b4b9ddc7365f84bedc.json new file mode 100644 index 00000000000..038e1bdf2ed --- /dev/null +++ b/.changelog/0240285e200940b4b9ddc7365f84bedc.json @@ -0,0 +1,8 @@ +{ + "id": "0240285e-2009-40b4-b9dd-c7365f84bedc", + "type": "feature", + "description": "API changes for new named tag expressions feature.", + "modules": [ + "service/lakeformation" + ] +} \ No newline at end of file diff --git a/.changelog/1d4f46568ff44d06b2955b13f48b3ea3.json b/.changelog/1d4f46568ff44d06b2955b13f48b3ea3.json new file mode 100644 index 00000000000..42099df6c32 --- /dev/null +++ b/.changelog/1d4f46568ff44d06b2955b13f48b3ea3.json @@ -0,0 +1,8 @@ +{ + "id": "1d4f4656-8ff4-4d06-b295-5b13f48b3ea3", + "type": "feature", + "description": "Introduces category apis in AmazonQApps. Web experience users use Categories to tag and filter library items.", + "modules": [ + "service/qapps" + ] +} \ No newline at end of file diff --git a/.changelog/d0e8e1e02d974b07afd0dc3ed6993c4d.json b/.changelog/d0e8e1e02d974b07afd0dc3ed6993c4d.json new file mode 100644 index 00000000000..7e4eda84248 --- /dev/null +++ b/.changelog/d0e8e1e02d974b07afd0dc3ed6993c4d.json @@ -0,0 +1,8 @@ +{ + "id": "d0e8e1e0-2d97-4b07-afd0-dc3ed6993c4d", + "type": "feature", + "description": "Fix ListStorageLensConfigurations and ListStorageLensGroups deserialization for Smithy SDKs.", + "modules": [ + "service/s3control" + ] +} \ No newline at end of file diff --git a/.changelog/d289bc5a01334efcb6ce4a12c42dace1.json b/.changelog/d289bc5a01334efcb6ce4a12c42dace1.json new file mode 100644 index 00000000000..8c3cf136614 --- /dev/null +++ b/.changelog/d289bc5a01334efcb6ce4a12c42dace1.json @@ -0,0 +1,8 @@ +{ + "id": "d289bc5a-0133-4efc-b6ce-4a12c42dace1", + "type": "feature", + "description": "GuardDuty RDS Protection expands support for Amazon Aurora PostgreSQL Limitless Databases.", + "modules": [ + "service/guardduty" + ] +} \ No newline at end of file diff --git a/.changelog/db7999ccd5734778a1ef4e32943335f7.json b/.changelog/db7999ccd5734778a1ef4e32943335f7.json new file mode 100644 index 00000000000..025e0b13a46 --- /dev/null +++ b/.changelog/db7999ccd5734778a1ef4e32943335f7.json @@ -0,0 +1,8 @@ +{ + "id": "db7999cc-d573-4778-a1ef-4e32943335f7", + "type": "feature", + "description": "AWS CodeBuild now adds additional compute types for reserved capacity fleet.", + "modules": [ + "service/codebuild" + ] +} \ No newline at end of file diff --git a/.changelog/ded509a6c7724812a43bed9b77cbdad2.json b/.changelog/ded509a6c7724812a43bed9b77cbdad2.json new file mode 100644 index 00000000000..d66a7a6a138 --- /dev/null +++ b/.changelog/ded509a6c7724812a43bed9b77cbdad2.json @@ -0,0 +1,8 @@ +{ + "id": "ded509a6-c772-4812-a43b-ed9b77cbdad2", + "type": "feature", + "description": "Adding BatchGetPolicy API which supports the retrieval of multiple policies across multiple policy stores within a single request.", + "modules": [ + "service/verifiedpermissions" + ] +} \ No newline at end of file diff --git a/service/codebuild/api_op_CreateFleet.go b/service/codebuild/api_op_CreateFleet.go index 20172eeef3c..9ac6a61b197 100644 --- a/service/codebuild/api_op_CreateFleet.go +++ b/service/codebuild/api_op_CreateFleet.go @@ -38,45 +38,69 @@ type CreateFleetInput struct { // Information about the compute resources the compute fleet uses. Available // values include: // - // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - ATTRIBUTE_BASED_COMPUTE : Specify the amount of vCPUs, memory, disk space, + // and the type of machine. // - // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // If you use ATTRIBUTE_BASED_COMPUTE , you must define your attributes by using + // computeConfiguration . CodeBuild will select the cheapest instance that + // satisfies your specified attributes. For more information, see [Reserved capacity environment types]in the + // CodeBuild User Guide. // - // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // - BUILD_GENERAL1_SMALL : Use up to 4 GiB memory and 2 vCPUs for builds. + // + // - BUILD_GENERAL1_MEDIUM : Use up to 8 GiB memory and 4 vCPUs for builds. + // + // - BUILD_GENERAL1_LARGE : Use up to 16 GiB memory and 8 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // - BUILD_GENERAL1_XLARGE : Use up to 72 GiB memory and 36 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // - BUILD_GENERAL1_2XLARGE : Use up to 144 GiB memory, 72 vCPUs, and 824 GB of // SSD storage for builds. This compute type supports Docker images up to 100 GB // uncompressed. // + // - BUILD_LAMBDA_1GB : Use up to 1 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_2GB : Use up to 2 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_4GB : Use up to 4 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_8GB : Use up to 8 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_10GB : Use up to 10 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // // If you use BUILD_GENERAL1_SMALL : // - // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // - For environment type LINUX_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 - // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GiB memory, + // 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. // - // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // - For environment type ARM_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs on ARM-based processors for builds. // // If you use BUILD_GENERAL1_LARGE : // - // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // - For environment type LINUX_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GiB memory, // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. // - // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // - For environment type ARM_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs on ARM-based processors for builds. // - // For more information, see [Build environment compute types] in the CodeBuild User Guide. + // For more information, see [On-demand environment types] in the CodeBuild User Guide. // - // [Build environment compute types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + // [Reserved capacity environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + // [On-demand environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types // // This member is required. ComputeType types.ComputeType @@ -126,6 +150,10 @@ type CreateFleetInput struct { // This member is required. Name *string + // The compute configuration of the compute fleet. This is only required if + // computeType is set to ATTRIBUTE_BASED_COMPUTE . + ComputeConfiguration *types.ComputeConfiguration + // The service role associated with the compute fleet. For more information, see [Allow a user to add a permission policy for a fleet service role] // in the CodeBuild User Guide. // diff --git a/service/codebuild/api_op_UpdateFleet.go b/service/codebuild/api_op_UpdateFleet.go index 4c7b9751989..7e56ef98db1 100644 --- a/service/codebuild/api_op_UpdateFleet.go +++ b/service/codebuild/api_op_UpdateFleet.go @@ -38,48 +38,76 @@ type UpdateFleetInput struct { // number of builds that can run in parallel. BaseCapacity *int32 + // The compute configuration of the compute fleet. This is only required if + // computeType is set to ATTRIBUTE_BASED_COMPUTE . + ComputeConfiguration *types.ComputeConfiguration + // Information about the compute resources the compute fleet uses. Available // values include: // - // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - ATTRIBUTE_BASED_COMPUTE : Specify the amount of vCPUs, memory, disk space, + // and the type of machine. + // + // If you use ATTRIBUTE_BASED_COMPUTE , you must define your attributes by using + // computeConfiguration . CodeBuild will select the cheapest instance that + // satisfies your specified attributes. For more information, see [Reserved capacity environment types]in the + // CodeBuild User Guide. + // + // - BUILD_GENERAL1_SMALL : Use up to 4 GiB memory and 2 vCPUs for builds. // - // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_MEDIUM : Use up to 8 GiB memory and 4 vCPUs for builds. // - // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // - BUILD_GENERAL1_LARGE : Use up to 16 GiB memory and 8 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // - BUILD_GENERAL1_XLARGE : Use up to 72 GiB memory and 36 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // - BUILD_GENERAL1_2XLARGE : Use up to 144 GiB memory, 72 vCPUs, and 824 GB of // SSD storage for builds. This compute type supports Docker images up to 100 GB // uncompressed. // + // - BUILD_LAMBDA_1GB : Use up to 1 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_2GB : Use up to 2 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_4GB : Use up to 4 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_8GB : Use up to 8 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_10GB : Use up to 10 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // // If you use BUILD_GENERAL1_SMALL : // - // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // - For environment type LINUX_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 - // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GiB memory, + // 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. // - // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // - For environment type ARM_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs on ARM-based processors for builds. // // If you use BUILD_GENERAL1_LARGE : // - // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // - For environment type LINUX_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GiB memory, // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. // - // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // - For environment type ARM_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs on ARM-based processors for builds. // - // For more information, see [Build environment compute types] in the CodeBuild User Guide. + // For more information, see [On-demand environment types] in the CodeBuild User Guide. // - // [Build environment compute types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + // [Reserved capacity environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + // [On-demand environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types ComputeType types.ComputeType // The environment type of the compute fleet. diff --git a/service/codebuild/deserializers.go b/service/codebuild/deserializers.go index 03fdd0f1f2e..725cbf4070e 100644 --- a/service/codebuild/deserializers.go +++ b/service/codebuild/deserializers.go @@ -7938,6 +7938,85 @@ func awsAwsjson11_deserializeDocumentCodeCoverages(v *[]types.CodeCoverage, valu return nil } +func awsAwsjson11_deserializeDocumentComputeConfiguration(v **types.ComputeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComputeConfiguration + if *v == nil { + sv = &types.ComputeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "disk": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WrapperLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Disk = ptr.Int64(i64) + } + + case "machineType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MachineType to be of type string, got %T instead", value) + } + sv.MachineType = types.MachineType(jtv) + } + + case "memory": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WrapperLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Memory = ptr.Int64(i64) + } + + case "vCpu": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WrapperLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.VCpu = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentComputeTypesAllowed(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8554,6 +8633,11 @@ func awsAwsjson11_deserializeDocumentFleet(v **types.Fleet, value interface{}) e sv.BaseCapacity = ptr.Int32(int32(i64)) } + case "computeConfiguration": + if err := awsAwsjson11_deserializeDocumentComputeConfiguration(&sv.ComputeConfiguration, value); err != nil { + return err + } + case "computeType": if value != nil { jtv, ok := value.(string) @@ -10134,6 +10218,11 @@ func awsAwsjson11_deserializeDocumentProjectEnvironment(v **types.ProjectEnviron sv.Certificate = ptr.String(jtv) } + case "computeConfiguration": + if err := awsAwsjson11_deserializeDocumentComputeConfiguration(&sv.ComputeConfiguration, value); err != nil { + return err + } + case "computeType": if value != nil { jtv, ok := value.(string) diff --git a/service/codebuild/serializers.go b/service/codebuild/serializers.go index 2e37b4f43fa..21b0b8a3b49 100644 --- a/service/codebuild/serializers.go +++ b/service/codebuild/serializers.go @@ -3158,6 +3158,33 @@ func awsAwsjson11_serializeDocumentCloudWatchLogsConfig(v *types.CloudWatchLogsC return nil } +func awsAwsjson11_serializeDocumentComputeConfiguration(v *types.ComputeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Disk != nil { + ok := object.Key("disk") + ok.Long(*v.Disk) + } + + if len(v.MachineType) > 0 { + ok := object.Key("machineType") + ok.String(string(v.MachineType)) + } + + if v.Memory != nil { + ok := object.Key("memory") + ok.Long(*v.Memory) + } + + if v.VCpu != nil { + ok := object.Key("vCpu") + ok.Long(*v.VCpu) + } + + return nil +} + func awsAwsjson11_serializeDocumentComputeTypesAllowed(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3473,6 +3500,13 @@ func awsAwsjson11_serializeDocumentProjectEnvironment(v *types.ProjectEnvironmen ok.String(*v.Certificate) } + if v.ComputeConfiguration != nil { + ok := object.Key("computeConfiguration") + if err := awsAwsjson11_serializeDocumentComputeConfiguration(v.ComputeConfiguration, ok); err != nil { + return err + } + } + if len(v.ComputeType) > 0 { ok := object.Key("computeType") ok.String(string(v.ComputeType)) @@ -4179,6 +4213,13 @@ func awsAwsjson11_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value ok.Integer(*v.BaseCapacity) } + if v.ComputeConfiguration != nil { + ok := object.Key("computeConfiguration") + if err := awsAwsjson11_serializeDocumentComputeConfiguration(v.ComputeConfiguration, ok); err != nil { + return err + } + } + if len(v.ComputeType) > 0 { ok := object.Key("computeType") ok.String(string(v.ComputeType)) @@ -5512,6 +5553,13 @@ func awsAwsjson11_serializeOpDocumentUpdateFleetInput(v *UpdateFleetInput, value ok.Integer(*v.BaseCapacity) } + if v.ComputeConfiguration != nil { + ok := object.Key("computeConfiguration") + if err := awsAwsjson11_serializeDocumentComputeConfiguration(v.ComputeConfiguration, ok); err != nil { + return err + } + } + if len(v.ComputeType) > 0 { ok := object.Key("computeType") ok.String(string(v.ComputeType)) diff --git a/service/codebuild/types/enums.go b/service/codebuild/types/enums.go index c112f21bfb3..bd31915bf02 100644 --- a/service/codebuild/types/enums.go +++ b/service/codebuild/types/enums.go @@ -238,16 +238,17 @@ type ComputeType string // Enum values for ComputeType const ( - ComputeTypeBuildGeneral1Small ComputeType = "BUILD_GENERAL1_SMALL" - ComputeTypeBuildGeneral1Medium ComputeType = "BUILD_GENERAL1_MEDIUM" - ComputeTypeBuildGeneral1Large ComputeType = "BUILD_GENERAL1_LARGE" - ComputeTypeBuildGeneral1Xlarge ComputeType = "BUILD_GENERAL1_XLARGE" - ComputeTypeBuildGeneral12xlarge ComputeType = "BUILD_GENERAL1_2XLARGE" - ComputeTypeBuildLambda1gb ComputeType = "BUILD_LAMBDA_1GB" - ComputeTypeBuildLambda2gb ComputeType = "BUILD_LAMBDA_2GB" - ComputeTypeBuildLambda4gb ComputeType = "BUILD_LAMBDA_4GB" - ComputeTypeBuildLambda8gb ComputeType = "BUILD_LAMBDA_8GB" - ComputeTypeBuildLambda10gb ComputeType = "BUILD_LAMBDA_10GB" + ComputeTypeBuildGeneral1Small ComputeType = "BUILD_GENERAL1_SMALL" + ComputeTypeBuildGeneral1Medium ComputeType = "BUILD_GENERAL1_MEDIUM" + ComputeTypeBuildGeneral1Large ComputeType = "BUILD_GENERAL1_LARGE" + ComputeTypeBuildGeneral1Xlarge ComputeType = "BUILD_GENERAL1_XLARGE" + ComputeTypeBuildGeneral12xlarge ComputeType = "BUILD_GENERAL1_2XLARGE" + ComputeTypeBuildLambda1gb ComputeType = "BUILD_LAMBDA_1GB" + ComputeTypeBuildLambda2gb ComputeType = "BUILD_LAMBDA_2GB" + ComputeTypeBuildLambda4gb ComputeType = "BUILD_LAMBDA_4GB" + ComputeTypeBuildLambda8gb ComputeType = "BUILD_LAMBDA_8GB" + ComputeTypeBuildLambda10gb ComputeType = "BUILD_LAMBDA_10GB" + ComputeTypeAttributeBasedCompute ComputeType = "ATTRIBUTE_BASED_COMPUTE" ) // Values returns all known values for ComputeType. Note that this can be expanded @@ -266,6 +267,7 @@ func (ComputeType) Values() []ComputeType { "BUILD_LAMBDA_4GB", "BUILD_LAMBDA_8GB", "BUILD_LAMBDA_10GB", + "ATTRIBUTE_BASED_COMPUTE", } } @@ -615,6 +617,25 @@ func (LogsConfigStatusType) Values() []LogsConfigStatusType { } } +type MachineType string + +// Enum values for MachineType +const ( + MachineTypeGeneral MachineType = "GENERAL" + MachineTypeNvme MachineType = "NVME" +) + +// Values returns all known values for MachineType. 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 (MachineType) Values() []MachineType { + return []MachineType{ + "GENERAL", + "NVME", + } +} + type PlatformType string // Enum values for PlatformType diff --git a/service/codebuild/types/types.go b/service/codebuild/types/types.go index 385e49bf822..af3e392b957 100644 --- a/service/codebuild/types/types.go +++ b/service/codebuild/types/types.go @@ -770,6 +770,25 @@ type CodeCoverageReportSummary struct { noSmithyDocumentSerde } +// Contains compute attributes. These attributes only need be specified when your +// project's or fleet's computeType is set to ATTRIBUTE_BASED_COMPUTE . +type ComputeConfiguration struct { + + // The amount of disk space of the instance type included in your fleet. + Disk *int64 + + // The machine type of the instance type included in your fleet. + MachineType MachineType + + // The amount of memory of the instance type included in your fleet. + Memory *int64 + + // The number of vCPUs of the instance type included in your fleet. + VCpu *int64 + + noSmithyDocumentSerde +} + // Contains information about the debug session for a build. For more information, // see [Viewing a running build in Session Manager]. // @@ -906,48 +925,76 @@ type Fleet struct { // number of builds that can run in parallel. BaseCapacity *int32 + // The compute configuration of the compute fleet. This is only required if + // computeType is set to ATTRIBUTE_BASED_COMPUTE . + ComputeConfiguration *ComputeConfiguration + // Information about the compute resources the compute fleet uses. Available // values include: // - // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - ATTRIBUTE_BASED_COMPUTE : Specify the amount of vCPUs, memory, disk space, + // and the type of machine. + // + // If you use ATTRIBUTE_BASED_COMPUTE , you must define your attributes by using + // computeConfiguration . CodeBuild will select the cheapest instance that + // satisfies your specified attributes. For more information, see [Reserved capacity environment types]in the + // CodeBuild User Guide. // - // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_SMALL : Use up to 4 GiB memory and 2 vCPUs for builds. // - // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // - BUILD_GENERAL1_MEDIUM : Use up to 8 GiB memory and 4 vCPUs for builds. + // + // - BUILD_GENERAL1_LARGE : Use up to 16 GiB memory and 8 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // - BUILD_GENERAL1_XLARGE : Use up to 72 GiB memory and 36 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // - BUILD_GENERAL1_2XLARGE : Use up to 144 GiB memory, 72 vCPUs, and 824 GB of // SSD storage for builds. This compute type supports Docker images up to 100 GB // uncompressed. // + // - BUILD_LAMBDA_1GB : Use up to 1 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_2GB : Use up to 2 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_4GB : Use up to 4 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_8GB : Use up to 8 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // + // - BUILD_LAMBDA_10GB : Use up to 10 GiB memory for builds. Only available for + // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . + // // If you use BUILD_GENERAL1_SMALL : // - // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // - For environment type LINUX_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 - // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GiB memory, + // 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. // - // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // - For environment type ARM_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs on ARM-based processors for builds. // // If you use BUILD_GENERAL1_LARGE : // - // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // - For environment type LINUX_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GiB memory, // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. // - // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // - For environment type ARM_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs on ARM-based processors for builds. // - // For more information, see [Build environment compute types] in the CodeBuild User Guide. + // For more information, see [On-demand environment types] in the CodeBuild User Guide. // - // [Build environment compute types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + // [Reserved capacity environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + // [On-demand environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types ComputeType ComputeType // The time at which the compute fleet was created. @@ -1627,63 +1674,69 @@ type ProjectEnvironment struct { // Information about the compute resources the build project uses. Available // values include: // - // - BUILD_GENERAL1_SMALL : Use up to 3 GB memory and 2 vCPUs for builds. + // - ATTRIBUTE_BASED_COMPUTE : Specify the amount of vCPUs, memory, disk space, + // and the type of machine. + // + // If you use ATTRIBUTE_BASED_COMPUTE , you must define your attributes by using + // computeConfiguration . CodeBuild will select the cheapest instance that + // satisfies your specified attributes. For more information, see [Reserved capacity environment types]in the + // CodeBuild User Guide. // - // - BUILD_GENERAL1_MEDIUM : Use up to 7 GB memory and 4 vCPUs for builds. + // - BUILD_GENERAL1_SMALL : Use up to 4 GiB memory and 2 vCPUs for builds. // - // - BUILD_GENERAL1_LARGE : Use up to 16 GB memory and 8 vCPUs for builds, + // - BUILD_GENERAL1_MEDIUM : Use up to 8 GiB memory and 4 vCPUs for builds. + // + // - BUILD_GENERAL1_LARGE : Use up to 16 GiB memory and 8 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_XLARGE : Use up to 70 GB memory and 36 vCPUs for builds, + // - BUILD_GENERAL1_XLARGE : Use up to 72 GiB memory and 36 vCPUs for builds, // depending on your environment type. // - // - BUILD_GENERAL1_2XLARGE : Use up to 145 GB memory, 72 vCPUs, and 824 GB of + // - BUILD_GENERAL1_2XLARGE : Use up to 144 GiB memory, 72 vCPUs, and 824 GB of // SSD storage for builds. This compute type supports Docker images up to 100 GB // uncompressed. // - // - BUILD_LAMBDA_1GB : Use up to 1 GB memory for builds. Only available for + // - BUILD_LAMBDA_1GB : Use up to 1 GiB memory for builds. Only available for // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . // - // - BUILD_LAMBDA_2GB : Use up to 2 GB memory for builds. Only available for + // - BUILD_LAMBDA_2GB : Use up to 2 GiB memory for builds. Only available for // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . // - // - BUILD_LAMBDA_4GB : Use up to 4 GB memory for builds. Only available for + // - BUILD_LAMBDA_4GB : Use up to 4 GiB memory for builds. Only available for // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . // - // - BUILD_LAMBDA_8GB : Use up to 8 GB memory for builds. Only available for + // - BUILD_LAMBDA_8GB : Use up to 8 GiB memory for builds. Only available for // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . // - // - BUILD_LAMBDA_10GB : Use up to 10 GB memory for builds. Only available for + // - BUILD_LAMBDA_10GB : Use up to 10 GiB memory for builds. Only available for // environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER . // // If you use BUILD_GENERAL1_SMALL : // - // - For environment type LINUX_CONTAINER , you can use up to 3 GB memory and 2 + // - For environment type LINUX_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GB memory, 4 - // vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. + // - For environment type LINUX_GPU_CONTAINER , you can use up to 16 GiB memory, + // 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds. // - // - For environment type ARM_CONTAINER , you can use up to 4 GB memory and 2 + // - For environment type ARM_CONTAINER , you can use up to 4 GiB memory and 2 // vCPUs on ARM-based processors for builds. // // If you use BUILD_GENERAL1_LARGE : // - // - For environment type LINUX_CONTAINER , you can use up to 15 GB memory and 8 + // - For environment type LINUX_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs for builds. // - // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GB memory, + // - For environment type LINUX_GPU_CONTAINER , you can use up to 255 GiB memory, // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. // - // - For environment type ARM_CONTAINER , you can use up to 16 GB memory and 8 + // - For environment type ARM_CONTAINER , you can use up to 16 GiB memory and 8 // vCPUs on ARM-based processors for builds. // - // If you're using compute fleets during project creation, computeType will be - // ignored. - // - // For more information, see [Build Environment Compute Types] in the CodeBuild User Guide. + // For more information, see [On-demand environment types] in the CodeBuild User Guide. // - // [Build Environment Compute Types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html + // [Reserved capacity environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types + // [On-demand environment types]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types // // This member is required. ComputeType ComputeType @@ -1749,6 +1802,10 @@ type ProjectEnvironment struct { // [certificate]: https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.environment.certificate Certificate *string + // The compute configuration of the build project. This is only required if + // computeType is set to ATTRIBUTE_BASED_COMPUTE . + ComputeConfiguration *ComputeConfiguration + // A set of environment variables to make available to builds for this build // project. EnvironmentVariables []EnvironmentVariable diff --git a/service/guardduty/api_op_AcceptInvitation.go b/service/guardduty/api_op_AcceptInvitation.go index 8c7612b8806..f0f61e62ea7 100644 --- a/service/guardduty/api_op_AcceptInvitation.go +++ b/service/guardduty/api_op_AcceptInvitation.go @@ -33,6 +33,11 @@ type AcceptInvitationInput struct { // The unique ID of the detector of the GuardDuty member account. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ArchiveFindings.go b/service/guardduty/api_op_ArchiveFindings.go index 4a3805f98fa..c763fc77450 100644 --- a/service/guardduty/api_op_ArchiveFindings.go +++ b/service/guardduty/api_op_ArchiveFindings.go @@ -34,6 +34,11 @@ type ArchiveFindingsInput struct { // The ID of the detector that specifies the GuardDuty service whose findings you // want to archive. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreateFilter.go b/service/guardduty/api_op_CreateFilter.go index ef024d6a842..1faf41d9e7f 100644 --- a/service/guardduty/api_op_CreateFilter.go +++ b/service/guardduty/api_op_CreateFilter.go @@ -36,6 +36,11 @@ type CreateFilterInput struct { // The detector ID associated with the GuardDuty account for which you want to // create a filter. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreateIPSet.go b/service/guardduty/api_op_CreateIPSet.go index 9680d412d60..a90f5521920 100644 --- a/service/guardduty/api_op_CreateIPSet.go +++ b/service/guardduty/api_op_CreateIPSet.go @@ -42,6 +42,11 @@ type CreateIPSetInput struct { // The unique ID of the detector of the GuardDuty account for which you want to // create an IPSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreateMembers.go b/service/guardduty/api_op_CreateMembers.go index 515960c5f98..3235116b6fc 100644 --- a/service/guardduty/api_op_CreateMembers.go +++ b/service/guardduty/api_op_CreateMembers.go @@ -68,6 +68,11 @@ type CreateMembersInput struct { // The unique ID of the detector of the GuardDuty account for which you want to // associate member accounts. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreatePublishingDestination.go b/service/guardduty/api_op_CreatePublishingDestination.go index 377933577f6..500b2f6d0ba 100644 --- a/service/guardduty/api_op_CreatePublishingDestination.go +++ b/service/guardduty/api_op_CreatePublishingDestination.go @@ -44,6 +44,11 @@ type CreatePublishingDestinationInput struct { // The ID of the GuardDuty detector associated with the publishing destination. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreateSampleFindings.go b/service/guardduty/api_op_CreateSampleFindings.go index bb340668ccf..2f6dcebc6f3 100644 --- a/service/guardduty/api_op_CreateSampleFindings.go +++ b/service/guardduty/api_op_CreateSampleFindings.go @@ -32,6 +32,11 @@ type CreateSampleFindingsInput struct { // The ID of the detector for which you need to create sample findings. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_CreateThreatIntelSet.go b/service/guardduty/api_op_CreateThreatIntelSet.go index b2ca6878afd..3972f289b50 100644 --- a/service/guardduty/api_op_CreateThreatIntelSet.go +++ b/service/guardduty/api_op_CreateThreatIntelSet.go @@ -40,6 +40,11 @@ type CreateThreatIntelSetInput struct { // The unique ID of the detector of the GuardDuty account for which you want to // create a ThreatIntelSet . // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeleteDetector.go b/service/guardduty/api_op_DeleteDetector.go index cd3218522d3..a3ee31c9209 100644 --- a/service/guardduty/api_op_DeleteDetector.go +++ b/service/guardduty/api_op_DeleteDetector.go @@ -30,6 +30,11 @@ type DeleteDetectorInput struct { // The unique ID of the detector that you want to delete. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeleteFilter.go b/service/guardduty/api_op_DeleteFilter.go index 45305aa7f28..49a8e6ca39b 100644 --- a/service/guardduty/api_op_DeleteFilter.go +++ b/service/guardduty/api_op_DeleteFilter.go @@ -30,6 +30,11 @@ type DeleteFilterInput struct { // The unique ID of the detector that is associated with the filter. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeleteIPSet.go b/service/guardduty/api_op_DeleteIPSet.go index 3b645963e65..2831209ea09 100644 --- a/service/guardduty/api_op_DeleteIPSet.go +++ b/service/guardduty/api_op_DeleteIPSet.go @@ -31,6 +31,11 @@ type DeleteIPSetInput struct { // The unique ID of the detector associated with the IPSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeleteMembers.go b/service/guardduty/api_op_DeleteMembers.go index 54950720d28..c34409b3e0c 100644 --- a/service/guardduty/api_op_DeleteMembers.go +++ b/service/guardduty/api_op_DeleteMembers.go @@ -42,6 +42,11 @@ type DeleteMembersInput struct { // The unique ID of the detector of the GuardDuty account whose members you want // to delete. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeletePublishingDestination.go b/service/guardduty/api_op_DeletePublishingDestination.go index 348c645271e..7bbe2a343f9 100644 --- a/service/guardduty/api_op_DeletePublishingDestination.go +++ b/service/guardduty/api_op_DeletePublishingDestination.go @@ -36,6 +36,11 @@ type DeletePublishingDestinationInput struct { // The unique ID of the detector associated with the publishing destination to // delete. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DeleteThreatIntelSet.go b/service/guardduty/api_op_DeleteThreatIntelSet.go index 7cd79469b1d..5b80ca9ccc0 100644 --- a/service/guardduty/api_op_DeleteThreatIntelSet.go +++ b/service/guardduty/api_op_DeleteThreatIntelSet.go @@ -30,6 +30,11 @@ type DeleteThreatIntelSetInput struct { // The unique ID of the detector that is associated with the threatIntelSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DescribeMalwareScans.go b/service/guardduty/api_op_DescribeMalwareScans.go index ca795208088..644c095a1b1 100644 --- a/service/guardduty/api_op_DescribeMalwareScans.go +++ b/service/guardduty/api_op_DescribeMalwareScans.go @@ -39,6 +39,11 @@ type DescribeMalwareScansInput struct { // The unique ID of the detector that the request is associated with. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DescribeOrganizationConfiguration.go b/service/guardduty/api_op_DescribeOrganizationConfiguration.go index 537aa7c0813..6c68eb61bc1 100644 --- a/service/guardduty/api_op_DescribeOrganizationConfiguration.go +++ b/service/guardduty/api_op_DescribeOrganizationConfiguration.go @@ -39,6 +39,11 @@ type DescribeOrganizationConfigurationInput struct { // The detector ID of the delegated administrator for which you need to retrieve // the information. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_DescribePublishingDestination.go b/service/guardduty/api_op_DescribePublishingDestination.go index 5ca2b52104d..5116f0d05d7 100644 --- a/service/guardduty/api_op_DescribePublishingDestination.go +++ b/service/guardduty/api_op_DescribePublishingDestination.go @@ -38,6 +38,11 @@ type DescribePublishingDestinationInput struct { // The unique ID of the detector associated with the publishing destination to // retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetCoverageStatistics.go b/service/guardduty/api_op_GetCoverageStatistics.go index c2da222a608..df02ac2b6b1 100644 --- a/service/guardduty/api_op_GetCoverageStatistics.go +++ b/service/guardduty/api_op_GetCoverageStatistics.go @@ -34,6 +34,11 @@ type GetCoverageStatisticsInput struct { // The unique ID of the GuardDuty detector. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetDetector.go b/service/guardduty/api_op_GetDetector.go index b08e6880ebe..cc8f8bb4841 100644 --- a/service/guardduty/api_op_GetDetector.go +++ b/service/guardduty/api_op_GetDetector.go @@ -37,6 +37,11 @@ type GetDetectorInput struct { // The unique ID of the detector that you want to get. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetFilter.go b/service/guardduty/api_op_GetFilter.go index 829d66e12c3..da442e486e4 100644 --- a/service/guardduty/api_op_GetFilter.go +++ b/service/guardduty/api_op_GetFilter.go @@ -31,6 +31,11 @@ type GetFilterInput struct { // The unique ID of the detector that is associated with this filter. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetFindings.go b/service/guardduty/api_op_GetFindings.go index 75bcee7bf25..38d3b8b1540 100644 --- a/service/guardduty/api_op_GetFindings.go +++ b/service/guardduty/api_op_GetFindings.go @@ -32,6 +32,11 @@ type GetFindingsInput struct { // The ID of the detector that specifies the GuardDuty service whose findings you // want to retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetFindingsStatistics.go b/service/guardduty/api_op_GetFindingsStatistics.go index c22efbe7f10..fa57623aa7a 100644 --- a/service/guardduty/api_op_GetFindingsStatistics.go +++ b/service/guardduty/api_op_GetFindingsStatistics.go @@ -40,6 +40,11 @@ type GetFindingsStatisticsInput struct { // The ID of the detector whose findings statistics you want to retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetIPSet.go b/service/guardduty/api_op_GetIPSet.go index b41240c0185..c611092e075 100644 --- a/service/guardduty/api_op_GetIPSet.go +++ b/service/guardduty/api_op_GetIPSet.go @@ -31,6 +31,11 @@ type GetIPSetInput struct { // The unique ID of the detector that is associated with the IPSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetMalwareScanSettings.go b/service/guardduty/api_op_GetMalwareScanSettings.go index 62c08d7010c..cd6241dfdd4 100644 --- a/service/guardduty/api_op_GetMalwareScanSettings.go +++ b/service/guardduty/api_op_GetMalwareScanSettings.go @@ -37,6 +37,11 @@ type GetMalwareScanSettingsInput struct { // The unique ID of the detector that is associated with this scan. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetMasterAccount.go b/service/guardduty/api_op_GetMasterAccount.go index 491ccfc4676..e4099ba1549 100644 --- a/service/guardduty/api_op_GetMasterAccount.go +++ b/service/guardduty/api_op_GetMasterAccount.go @@ -34,6 +34,11 @@ type GetMasterAccountInput struct { // The unique ID of the detector of the GuardDuty member account. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetMemberDetectors.go b/service/guardduty/api_op_GetMemberDetectors.go index a3da171261f..c46aa704a6f 100644 --- a/service/guardduty/api_op_GetMemberDetectors.go +++ b/service/guardduty/api_op_GetMemberDetectors.go @@ -42,6 +42,11 @@ type GetMemberDetectorsInput struct { // The detector ID for the administrator account. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetMembers.go b/service/guardduty/api_op_GetMembers.go index 379d637a36a..6465a9058d3 100644 --- a/service/guardduty/api_op_GetMembers.go +++ b/service/guardduty/api_op_GetMembers.go @@ -39,6 +39,11 @@ type GetMembersInput struct { // The unique ID of the detector of the GuardDuty account whose members you want // to retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetRemainingFreeTrialDays.go b/service/guardduty/api_op_GetRemainingFreeTrialDays.go index ab7512a1860..dc7e5e619fd 100644 --- a/service/guardduty/api_op_GetRemainingFreeTrialDays.go +++ b/service/guardduty/api_op_GetRemainingFreeTrialDays.go @@ -32,6 +32,11 @@ type GetRemainingFreeTrialDaysInput struct { // The unique ID of the detector of the GuardDuty member account. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetThreatIntelSet.go b/service/guardduty/api_op_GetThreatIntelSet.go index ca2d7979dc2..c88cf42a468 100644 --- a/service/guardduty/api_op_GetThreatIntelSet.go +++ b/service/guardduty/api_op_GetThreatIntelSet.go @@ -31,6 +31,11 @@ type GetThreatIntelSetInput struct { // The unique ID of the detector that is associated with the threatIntelSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_GetUsageStatistics.go b/service/guardduty/api_op_GetUsageStatistics.go index ec324e2c53a..17b7d275d41 100644 --- a/service/guardduty/api_op_GetUsageStatistics.go +++ b/service/guardduty/api_op_GetUsageStatistics.go @@ -38,6 +38,11 @@ type GetUsageStatisticsInput struct { // The ID of the detector that specifies the GuardDuty service whose usage // statistics you want to retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_InviteMembers.go b/service/guardduty/api_op_InviteMembers.go index 03007cd2345..0137b250352 100644 --- a/service/guardduty/api_op_InviteMembers.go +++ b/service/guardduty/api_op_InviteMembers.go @@ -74,6 +74,11 @@ type InviteMembersInput struct { // The unique ID of the detector of the GuardDuty account with which you want to // invite members. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListCoverage.go b/service/guardduty/api_op_ListCoverage.go index 14b5da320cf..9f901be02d9 100644 --- a/service/guardduty/api_op_ListCoverage.go +++ b/service/guardduty/api_op_ListCoverage.go @@ -36,6 +36,11 @@ type ListCoverageInput struct { // The unique ID of the detector whose coverage details you want to retrieve. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListFilters.go b/service/guardduty/api_op_ListFilters.go index d3763b34193..6d794b15ec3 100644 --- a/service/guardduty/api_op_ListFilters.go +++ b/service/guardduty/api_op_ListFilters.go @@ -30,6 +30,11 @@ type ListFiltersInput struct { // The unique ID of the detector that is associated with the filter. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListFindings.go b/service/guardduty/api_op_ListFindings.go index dc142670500..28c038ffa09 100644 --- a/service/guardduty/api_op_ListFindings.go +++ b/service/guardduty/api_op_ListFindings.go @@ -38,6 +38,11 @@ type ListFindingsInput struct { // The ID of the detector that specifies the GuardDuty service whose findings you // want to list. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListIPSets.go b/service/guardduty/api_op_ListIPSets.go index 35350341b79..247c5065555 100644 --- a/service/guardduty/api_op_ListIPSets.go +++ b/service/guardduty/api_op_ListIPSets.go @@ -32,6 +32,11 @@ type ListIPSetsInput struct { // The unique ID of the detector that is associated with IPSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListMembers.go b/service/guardduty/api_op_ListMembers.go index ec275b4da62..1a6c59eef7f 100644 --- a/service/guardduty/api_op_ListMembers.go +++ b/service/guardduty/api_op_ListMembers.go @@ -32,6 +32,11 @@ type ListMembersInput struct { // The unique ID of the detector that is associated with the member. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListPublishingDestinations.go b/service/guardduty/api_op_ListPublishingDestinations.go index 69fd54990de..a26ec2d79cf 100644 --- a/service/guardduty/api_op_ListPublishingDestinations.go +++ b/service/guardduty/api_op_ListPublishingDestinations.go @@ -32,6 +32,11 @@ type ListPublishingDestinationsInput struct { // The detector ID for which you want to retrieve the publishing destination. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_ListThreatIntelSets.go b/service/guardduty/api_op_ListThreatIntelSets.go index 40d4e903f34..cae17985499 100644 --- a/service/guardduty/api_op_ListThreatIntelSets.go +++ b/service/guardduty/api_op_ListThreatIntelSets.go @@ -32,6 +32,11 @@ type ListThreatIntelSetsInput struct { // The unique ID of the detector that is associated with the threatIntelSet. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_StartMonitoringMembers.go b/service/guardduty/api_op_StartMonitoringMembers.go index 114297bb781..332e28bcaab 100644 --- a/service/guardduty/api_op_StartMonitoringMembers.go +++ b/service/guardduty/api_op_StartMonitoringMembers.go @@ -41,6 +41,11 @@ type StartMonitoringMembersInput struct { // The unique ID of the detector of the GuardDuty administrator account associated // with the member accounts to monitor. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_StopMonitoringMembers.go b/service/guardduty/api_op_StopMonitoringMembers.go index af63ce54110..cb0d62e8e4a 100644 --- a/service/guardduty/api_op_StopMonitoringMembers.go +++ b/service/guardduty/api_op_StopMonitoringMembers.go @@ -42,6 +42,11 @@ type StopMonitoringMembersInput struct { // The unique ID of the detector associated with the GuardDuty administrator // account that is monitoring member accounts. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UnarchiveFindings.go b/service/guardduty/api_op_UnarchiveFindings.go index 31103e6acc1..fa8faecc15a 100644 --- a/service/guardduty/api_op_UnarchiveFindings.go +++ b/service/guardduty/api_op_UnarchiveFindings.go @@ -30,6 +30,11 @@ type UnarchiveFindingsInput struct { // The ID of the detector associated with the findings to unarchive. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateDetector.go b/service/guardduty/api_op_UpdateDetector.go index b8bc63a6487..f2bff8e9bc9 100644 --- a/service/guardduty/api_op_UpdateDetector.go +++ b/service/guardduty/api_op_UpdateDetector.go @@ -43,6 +43,11 @@ type UpdateDetectorInput struct { // The unique ID of the detector to update. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateFilter.go b/service/guardduty/api_op_UpdateFilter.go index 26ff3ecc993..402370bc903 100644 --- a/service/guardduty/api_op_UpdateFilter.go +++ b/service/guardduty/api_op_UpdateFilter.go @@ -32,6 +32,11 @@ type UpdateFilterInput struct { // The unique ID of the detector that specifies the GuardDuty service where you // want to update a filter. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateFindingsFeedback.go b/service/guardduty/api_op_UpdateFindingsFeedback.go index 82763982227..0d2e10da391 100644 --- a/service/guardduty/api_op_UpdateFindingsFeedback.go +++ b/service/guardduty/api_op_UpdateFindingsFeedback.go @@ -32,6 +32,11 @@ type UpdateFindingsFeedbackInput struct { // The ID of the detector that is associated with the findings for which you want // to update the feedback. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateIPSet.go b/service/guardduty/api_op_UpdateIPSet.go index 6f22f6993b3..11cef1ee66e 100644 --- a/service/guardduty/api_op_UpdateIPSet.go +++ b/service/guardduty/api_op_UpdateIPSet.go @@ -31,6 +31,11 @@ type UpdateIPSetInput struct { // The detectorID that specifies the GuardDuty service whose IPSet you want to // update. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateMalwareScanSettings.go b/service/guardduty/api_op_UpdateMalwareScanSettings.go index 9a8ea164eff..2f606642a3f 100644 --- a/service/guardduty/api_op_UpdateMalwareScanSettings.go +++ b/service/guardduty/api_op_UpdateMalwareScanSettings.go @@ -38,6 +38,11 @@ type UpdateMalwareScanSettingsInput struct { // The unique ID of the detector that specifies the GuardDuty service where you // want to update scan settings. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateMemberDetectors.go b/service/guardduty/api_op_UpdateMemberDetectors.go index 58243d1fb92..4abf7f591a7 100644 --- a/service/guardduty/api_op_UpdateMemberDetectors.go +++ b/service/guardduty/api_op_UpdateMemberDetectors.go @@ -48,6 +48,11 @@ type UpdateMemberDetectorsInput struct { // The detector ID of the administrator account. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateOrganizationConfiguration.go b/service/guardduty/api_op_UpdateOrganizationConfiguration.go index e84404b915f..f20f645aaa1 100644 --- a/service/guardduty/api_op_UpdateOrganizationConfiguration.go +++ b/service/guardduty/api_op_UpdateOrganizationConfiguration.go @@ -45,6 +45,11 @@ type UpdateOrganizationConfigurationInput struct { // The ID of the detector that configures the delegated administrator. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdatePublishingDestination.go b/service/guardduty/api_op_UpdatePublishingDestination.go index 80aeab2a424..0478c101bf9 100644 --- a/service/guardduty/api_op_UpdatePublishingDestination.go +++ b/service/guardduty/api_op_UpdatePublishingDestination.go @@ -37,6 +37,11 @@ type UpdatePublishingDestinationInput struct { // The ID of the detector associated with the publishing destinations to update. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/api_op_UpdateThreatIntelSet.go b/service/guardduty/api_op_UpdateThreatIntelSet.go index 1306a6195c1..d560e97e94f 100644 --- a/service/guardduty/api_op_UpdateThreatIntelSet.go +++ b/service/guardduty/api_op_UpdateThreatIntelSet.go @@ -31,6 +31,11 @@ type UpdateThreatIntelSetInput struct { // The detectorID that specifies the GuardDuty service whose ThreatIntelSet you // want to update. // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html + // // This member is required. DetectorId *string diff --git a/service/guardduty/deserializers.go b/service/guardduty/deserializers.go index c7236d0b3f9..5451361c60f 100644 --- a/service/guardduty/deserializers.go +++ b/service/guardduty/deserializers.go @@ -20386,6 +20386,96 @@ func awsRestjson1_deserializeDocumentRdsDbUserDetails(v **types.RdsDbUserDetails return nil } +func awsRestjson1_deserializeDocumentRdsLimitlessDbDetails(v **types.RdsLimitlessDbDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RdsLimitlessDbDetails + if *v == nil { + sv = &types.RdsLimitlessDbDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dbClusterIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DbClusterIdentifier = ptr.String(jtv) + } + + case "dbShardGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DbShardGroupArn = ptr.String(jtv) + } + + case "dbShardGroupIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DbShardGroupIdentifier = ptr.String(jtv) + } + + case "dbShardGroupResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DbShardGroupResourceId = ptr.String(jtv) + } + + case "engine": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Engine = ptr.String(jtv) + } + + case "engineVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EngineVersion = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentRdsLoginAttemptAction(v **types.RdsLoginAttemptAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20670,6 +20760,11 @@ func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interfac return err } + case "rdsLimitlessDbDetails": + if err := awsRestjson1_deserializeDocumentRdsLimitlessDbDetails(&sv.RdsLimitlessDbDetails, value); err != nil { + return err + } + case "resourceType": if value != nil { jtv, ok := value.(string) diff --git a/service/guardduty/types/types.go b/service/guardduty/types/types.go index 52d8b2b7af1..d454fb29c4e 100644 --- a/service/guardduty/types/types.go +++ b/service/guardduty/types/types.go @@ -2670,7 +2670,7 @@ type RdsDbInstanceDetails struct { // The version of the database engine that was involved in the finding. EngineVersion *string - // Instance tag key-value pairs associated with the database instance ID. + // Information about the tag key-value pairs. Tags []Tag noSmithyDocumentSerde @@ -2698,6 +2698,34 @@ type RdsDbUserDetails struct { noSmithyDocumentSerde } +// Contains information about the resource type RDSLimitlessDB that is involved in +// a GuardDuty finding. +type RdsLimitlessDbDetails struct { + + // The name of the database cluster that is a part of the Limitless Database. + DbClusterIdentifier *string + + // The Amazon Resource Name (ARN) that identifies the DB shard group. + DbShardGroupArn *string + + // The name associated with the Limitless DB shard group. + DbShardGroupIdentifier *string + + // The resource identifier of the DB shard group within the Limitless Database. + DbShardGroupResourceId *string + + // The database engine of the database instance involved in the finding. + Engine *string + + // The version of the database engine. + EngineVersion *string + + // Information about the tag-key value pair. + Tags []Tag + + noSmithyDocumentSerde +} + // Indicates that a login attempt was made to the potentially compromised database // from a remote IP address. type RdsLoginAttemptAction struct { @@ -2801,6 +2829,10 @@ type Resource struct { // attempt was made. RdsDbUserDetails *RdsDbUserDetails + // Contains information about the RDS Limitless database that was involved in a + // GuardDuty finding. + RdsLimitlessDbDetails *RdsLimitlessDbDetails + // The type of Amazon Web Services resource. ResourceType *string @@ -3054,12 +3086,22 @@ type Scan struct { // The unique detector ID of the administrator account that the request is // associated with. If the account is an administrator, the AdminDetectorId will // be the same as the one used for DetectorId . + // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html AdminDetectorId *string // List of volumes that were attached to the original instance to be scanned. AttachedVolumes []VolumeDetail // The unique ID of the detector that the request is associated with. + // + // To find the detectorId in the current Region, see the Settings page in the + // GuardDuty console, or run the [ListDetectors]API. + // + // [ListDetectors]: https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html DetectorId *string // Represents the reason for FAILED scan status. @@ -3363,13 +3405,13 @@ type SortCriteria struct { noSmithyDocumentSerde } -// Contains information about a tag associated with the EC2 instance. +// Contains information about a tag key-value pair. type Tag struct { - // The EC2 instance tag key. + // Describes the key associated with the tag. Key *string - // The EC2 instance tag value. + // Describes the value associated with the tag key. Value *string noSmithyDocumentSerde diff --git a/service/lakeformation/api_op_CreateLFTagExpression.go b/service/lakeformation/api_op_CreateLFTagExpression.go new file mode 100644 index 00000000000..6e84ec367c2 --- /dev/null +++ b/service/lakeformation/api_op_CreateLFTagExpression.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new LF-Tag expression with the provided name, description, catalog +// ID, and expression body. This call fails if a LF-Tag expression with the same +// name already exists in the caller’s account or if the underlying LF-Tags don't +// exist. To call this API operation, caller needs the following Lake Formation +// permissions: +// +// CREATE_LF_TAG_EXPRESSION on the root catalog resource. +// +// GRANT_WITH_LF_TAG_EXPRESSION on all underlying LF-Tag key:value pairs included +// in the expression. +func (c *Client) CreateLFTagExpression(ctx context.Context, params *CreateLFTagExpressionInput, optFns ...func(*Options)) (*CreateLFTagExpressionOutput, error) { + if params == nil { + params = &CreateLFTagExpressionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLFTagExpression", params, optFns, c.addOperationCreateLFTagExpressionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLFTagExpressionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLFTagExpressionInput struct { + + // A list of LF-Tag conditions (key-value pairs). + // + // This member is required. + Expression []types.LFTag + + // A name for the expression. + // + // This member is required. + Name *string + + // The identifier for the Data Catalog. By default, the account ID. The Data + // Catalog is the persistent metadata store. It contains database definitions, + // table definitions, and other control information to manage your Lake Formation + // environment. + CatalogId *string + + // A description with information about the LF-Tag expression. + Description *string + + noSmithyDocumentSerde +} + +type CreateLFTagExpressionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLFTagExpressionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLFTagExpression{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLFTagExpression{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateLFTagExpression"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateLFTagExpressionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLFTagExpression(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLFTagExpression(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateLFTagExpression", + } +} diff --git a/service/lakeformation/api_op_DeleteLFTagExpression.go b/service/lakeformation/api_op_DeleteLFTagExpression.go new file mode 100644 index 00000000000..652e0cab4e5 --- /dev/null +++ b/service/lakeformation/api_op_DeleteLFTagExpression.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the LF-Tag expression. The caller must be a data lake admin or have DROP +// permissions on the LF-Tag expression. Deleting a LF-Tag expression will also +// delete all LFTagPolicy permissions referencing the LF-Tag expression. +func (c *Client) DeleteLFTagExpression(ctx context.Context, params *DeleteLFTagExpressionInput, optFns ...func(*Options)) (*DeleteLFTagExpressionOutput, error) { + if params == nil { + params = &DeleteLFTagExpressionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteLFTagExpression", params, optFns, c.addOperationDeleteLFTagExpressionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteLFTagExpressionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteLFTagExpressionInput struct { + + // The name for the LF-Tag expression. + // + // This member is required. + Name *string + + // The identifier for the Data Catalog. By default, the account ID in which the + // LF-Tag expression is saved. + CatalogId *string + + noSmithyDocumentSerde +} + +type DeleteLFTagExpressionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteLFTagExpressionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLFTagExpression{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLFTagExpression{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteLFTagExpression"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteLFTagExpressionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLFTagExpression(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteLFTagExpression(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteLFTagExpression", + } +} diff --git a/service/lakeformation/api_op_GetLFTagExpression.go b/service/lakeformation/api_op_GetLFTagExpression.go new file mode 100644 index 00000000000..a5a59b4464b --- /dev/null +++ b/service/lakeformation/api_op_GetLFTagExpression.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details about the LF-Tag expression. The caller must be a data lake +// admin or must have DESCRIBE permission on the LF-Tag expression resource. +func (c *Client) GetLFTagExpression(ctx context.Context, params *GetLFTagExpressionInput, optFns ...func(*Options)) (*GetLFTagExpressionOutput, error) { + if params == nil { + params = &GetLFTagExpressionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLFTagExpression", params, optFns, c.addOperationGetLFTagExpressionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLFTagExpressionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLFTagExpressionInput struct { + + // The name for the LF-Tag expression + // + // This member is required. + Name *string + + // The identifier for the Data Catalog. By default, the account ID. + CatalogId *string + + noSmithyDocumentSerde +} + +type GetLFTagExpressionOutput struct { + + // The identifier for the Data Catalog. By default, the account ID in which the + // LF-Tag expression is saved. + CatalogId *string + + // The description with information about the LF-Tag expression. + Description *string + + // The body of the LF-Tag expression. It is composed of one or more LF-Tag + // key-value pairs. + Expression []types.LFTag + + // The name for the LF-Tag expression. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLFTagExpressionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLFTagExpression{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLFTagExpression{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetLFTagExpression"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetLFTagExpressionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLFTagExpression(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetLFTagExpression(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetLFTagExpression", + } +} diff --git a/service/lakeformation/api_op_GetTemporaryGlueTableCredentials.go b/service/lakeformation/api_op_GetTemporaryGlueTableCredentials.go index 7dd354ee479..2fcc0f55463 100644 --- a/service/lakeformation/api_op_GetTemporaryGlueTableCredentials.go +++ b/service/lakeformation/api_op_GetTemporaryGlueTableCredentials.go @@ -16,6 +16,9 @@ import ( // access Amazon S3. In order to vend such credentials, Lake Formation assumes the // role associated with a registered location, for example an Amazon S3 bucket, // with a scope down policy which restricts the access to a single prefix. +// +// To call this API, the role that the service assumes must have +// lakeformation:GetDataAccess permission on the resource. func (c *Client) GetTemporaryGlueTableCredentials(ctx context.Context, params *GetTemporaryGlueTableCredentialsInput, optFns ...func(*Options)) (*GetTemporaryGlueTableCredentialsOutput, error) { if params == nil { params = &GetTemporaryGlueTableCredentialsInput{} diff --git a/service/lakeformation/api_op_ListLFTagExpressions.go b/service/lakeformation/api_op_ListLFTagExpressions.go new file mode 100644 index 00000000000..9882ab4ee1d --- /dev/null +++ b/service/lakeformation/api_op_ListLFTagExpressions.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the LF-Tag expressions in caller’s account filtered based on caller's +// permissions. Data Lake and read only admins implicitly can see all tag +// expressions in their account, else caller needs DESCRIBE permissions on tag +// expression. +func (c *Client) ListLFTagExpressions(ctx context.Context, params *ListLFTagExpressionsInput, optFns ...func(*Options)) (*ListLFTagExpressionsOutput, error) { + if params == nil { + params = &ListLFTagExpressionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLFTagExpressions", params, optFns, c.addOperationListLFTagExpressionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLFTagExpressionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLFTagExpressionsInput struct { + + // The identifier for the Data Catalog. By default, the account ID. + CatalogId *string + + // The maximum number of results to return. + MaxResults *int32 + + // A continuation token, if this is not the first call to retrieve this list. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLFTagExpressionsOutput struct { + + // Logical expressions composed of one more LF-Tag key-value pairs. + LFTagExpressions []types.LFTagExpression + + // A continuation token, if this is not the first call to retrieve this list. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLFTagExpressionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLFTagExpressions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLFTagExpressions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListLFTagExpressions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLFTagExpressions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListLFTagExpressionsPaginatorOptions is the paginator options for +// ListLFTagExpressions +type ListLFTagExpressionsPaginatorOptions struct { + // The maximum number of results to return. + 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 +} + +// ListLFTagExpressionsPaginator is a paginator for ListLFTagExpressions +type ListLFTagExpressionsPaginator struct { + options ListLFTagExpressionsPaginatorOptions + client ListLFTagExpressionsAPIClient + params *ListLFTagExpressionsInput + nextToken *string + firstPage bool +} + +// NewListLFTagExpressionsPaginator returns a new ListLFTagExpressionsPaginator +func NewListLFTagExpressionsPaginator(client ListLFTagExpressionsAPIClient, params *ListLFTagExpressionsInput, optFns ...func(*ListLFTagExpressionsPaginatorOptions)) *ListLFTagExpressionsPaginator { + if params == nil { + params = &ListLFTagExpressionsInput{} + } + + options := ListLFTagExpressionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLFTagExpressionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLFTagExpressionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLFTagExpressions page. +func (p *ListLFTagExpressionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLFTagExpressionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListLFTagExpressions(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 +} + +// ListLFTagExpressionsAPIClient is a client that implements the +// ListLFTagExpressions operation. +type ListLFTagExpressionsAPIClient interface { + ListLFTagExpressions(context.Context, *ListLFTagExpressionsInput, ...func(*Options)) (*ListLFTagExpressionsOutput, error) +} + +var _ ListLFTagExpressionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListLFTagExpressions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListLFTagExpressions", + } +} diff --git a/service/lakeformation/api_op_RegisterResource.go b/service/lakeformation/api_op_RegisterResource.go index cf5ba235da0..0b9e2375405 100644 --- a/service/lakeformation/api_op_RegisterResource.go +++ b/service/lakeformation/api_op_RegisterResource.go @@ -23,7 +23,7 @@ import ( // The following request registers a new location and gives Lake Formation // permission to use the service-linked role to access that location. // -// ResourceArn = arn:aws:s3:::my-bucket UseServiceLinkedRole = true +// ResourceArn = arn:aws:s3:::my-bucket/ UseServiceLinkedRole = true // // If UseServiceLinkedRole is not set to true, you must provide or set the RoleArn : // diff --git a/service/lakeformation/api_op_UpdateLFTagExpression.go b/service/lakeformation/api_op_UpdateLFTagExpression.go new file mode 100644 index 00000000000..44cd4e9c6fb --- /dev/null +++ b/service/lakeformation/api_op_UpdateLFTagExpression.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/lakeformation/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the name of the LF-Tag expression to the new description and expression +// body provided. Updating a LF-Tag expression immediately changes the permission +// boundaries of all existing LFTagPolicy permission grants that reference the +// given LF-Tag expression. +func (c *Client) UpdateLFTagExpression(ctx context.Context, params *UpdateLFTagExpressionInput, optFns ...func(*Options)) (*UpdateLFTagExpressionOutput, error) { + if params == nil { + params = &UpdateLFTagExpressionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLFTagExpression", params, optFns, c.addOperationUpdateLFTagExpressionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLFTagExpressionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateLFTagExpressionInput struct { + + // The LF-Tag expression body composed of one more LF-Tag key-value pairs. + // + // This member is required. + Expression []types.LFTag + + // The name for the LF-Tag expression. + // + // This member is required. + Name *string + + // The identifier for the Data Catalog. By default, the account ID. + CatalogId *string + + // The description with information about the saved LF-Tag expression. + Description *string + + noSmithyDocumentSerde +} + +type UpdateLFTagExpressionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateLFTagExpressionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLFTagExpression{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLFTagExpression{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateLFTagExpression"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateLFTagExpressionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLFTagExpression(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateLFTagExpression(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateLFTagExpression", + } +} diff --git a/service/lakeformation/api_op_UpdateTableStorageOptimizer.go b/service/lakeformation/api_op_UpdateTableStorageOptimizer.go index 7dba3550c74..b8ef8be74bd 100644 --- a/service/lakeformation/api_op_UpdateTableStorageOptimizer.go +++ b/service/lakeformation/api_op_UpdateTableStorageOptimizer.go @@ -33,7 +33,7 @@ type UpdateTableStorageOptimizerInput struct { // This member is required. DatabaseName *string - // Name of the table for which to enable the storage optimizer. + // Name of the configuration for the storage optimizer. // // This member is required. StorageOptimizerConfig map[string]map[string]string diff --git a/service/lakeformation/deserializers.go b/service/lakeformation/deserializers.go index 47af61b1921..419e16b35a3 100644 --- a/service/lakeformation/deserializers.go +++ b/service/lakeformation/deserializers.go @@ -1468,6 +1468,109 @@ func awsRestjson1_deserializeOpErrorCreateLFTag(response *smithyhttp.Response, m } } +type awsRestjson1_deserializeOpCreateLFTagExpression struct { +} + +func (*awsRestjson1_deserializeOpCreateLFTagExpression) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateLFTagExpression) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCreateLFTagExpression(response, &metadata) + } + output := &CreateLFTagExpressionOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateLFTagExpression(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + case strings.EqualFold("ResourceNumberLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceNumberLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteDataCellsFilter struct { } @@ -1874,6 +1977,106 @@ func awsRestjson1_deserializeOpErrorDeleteLFTag(response *smithyhttp.Response, m } } +type awsRestjson1_deserializeOpDeleteLFTagExpression struct { +} + +func (*awsRestjson1_deserializeOpDeleteLFTagExpression) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteLFTagExpression) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorDeleteLFTagExpression(response, &metadata) + } + output := &DeleteLFTagExpressionOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteLFTagExpression(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteObjectsOnCancel struct { } @@ -3549,14 +3752,14 @@ func awsRestjson1_deserializeOpDocumentGetLFTagOutput(v **GetLFTagOutput, value return nil } -type awsRestjson1_deserializeOpGetQueryState struct { +type awsRestjson1_deserializeOpGetLFTagExpression struct { } -func (*awsRestjson1_deserializeOpGetQueryState) ID() string { +func (*awsRestjson1_deserializeOpGetLFTagExpression) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetQueryState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLFTagExpression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3574,9 +3777,9 @@ func (m *awsRestjson1_deserializeOpGetQueryState) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetQueryState(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLFTagExpression(response, &metadata) } - output := &GetQueryStateOutput{} + output := &GetLFTagExpressionOutput{} out.Result = output var buff [1024]byte @@ -3597,7 +3800,7 @@ func (m *awsRestjson1_deserializeOpGetQueryState) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetQueryStateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLFTagExpressionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3611,7 +3814,7 @@ func (m *awsRestjson1_deserializeOpGetQueryState) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetQueryState(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLFTagExpression(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3655,12 +3858,18 @@ func awsRestjson1_deserializeOpErrorGetQueryState(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3671,7 +3880,7 @@ func awsRestjson1_deserializeOpErrorGetQueryState(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetQueryStateOutput(v **GetQueryStateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLFTagExpressionOutput(v **GetLFTagExpressionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3684,31 +3893,45 @@ func awsRestjson1_deserializeOpDocumentGetQueryStateOutput(v **GetQueryStateOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetQueryStateOutput + var sv *GetLFTagExpressionOutput if *v == nil { - sv = &GetQueryStateOutput{} + sv = &GetLFTagExpressionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Error": + case "CatalogId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) + return fmt.Errorf("expected CatalogIdString to be of type string, got %T instead", value) } - sv.Error = ptr.String(jtv) + sv.CatalogId = ptr.String(jtv) } - case "State": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryStateString to be of type string, got %T instead", value) + return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) } - sv.State = types.QueryStateString(jtv) + sv.Description = ptr.String(jtv) + } + + case "Expression": + if err := awsRestjson1_deserializeDocumentExpression(&sv.Expression, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -3720,14 +3943,14 @@ func awsRestjson1_deserializeOpDocumentGetQueryStateOutput(v **GetQueryStateOutp return nil } -type awsRestjson1_deserializeOpGetQueryStatistics struct { +type awsRestjson1_deserializeOpGetQueryState struct { } -func (*awsRestjson1_deserializeOpGetQueryStatistics) ID() string { +func (*awsRestjson1_deserializeOpGetQueryState) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetQueryStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetQueryState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3745,9 +3968,9 @@ func (m *awsRestjson1_deserializeOpGetQueryStatistics) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetQueryStatistics(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetQueryState(response, &metadata) } - output := &GetQueryStatisticsOutput{} + output := &GetQueryStateOutput{} out.Result = output var buff [1024]byte @@ -3768,7 +3991,7 @@ func (m *awsRestjson1_deserializeOpGetQueryStatistics) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetQueryStatisticsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetQueryStateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3782,7 +4005,7 @@ func (m *awsRestjson1_deserializeOpGetQueryStatistics) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetQueryStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetQueryState(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3826,21 +4049,12 @@ func awsRestjson1_deserializeOpErrorGetQueryStatistics(response *smithyhttp.Resp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ExpiredException", errorCode): - return awsRestjson1_deserializeErrorExpiredException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) - case strings.EqualFold("StatisticsNotReadyYetException", errorCode): - return awsRestjson1_deserializeErrorStatisticsNotReadyYetException(response, errorBody) - - case strings.EqualFold("ThrottledException", errorCode): - return awsRestjson1_deserializeErrorThrottledException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3851,7 +4065,187 @@ func awsRestjson1_deserializeOpErrorGetQueryStatistics(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetQueryStatisticsOutput(v **GetQueryStatisticsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetQueryStateOutput(v **GetQueryStateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetQueryStateOutput + if *v == nil { + sv = &GetQueryStateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryStateString to be of type string, got %T instead", value) + } + sv.State = types.QueryStateString(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetQueryStatistics struct { +} + +func (*awsRestjson1_deserializeOpGetQueryStatistics) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetQueryStatistics) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetQueryStatistics(response, &metadata) + } + output := &GetQueryStatisticsOutput{} + 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_deserializeOpDocumentGetQueryStatisticsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetQueryStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("ExpiredException", errorCode): + return awsRestjson1_deserializeErrorExpiredException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("StatisticsNotReadyYetException", errorCode): + return awsRestjson1_deserializeErrorStatisticsNotReadyYetException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetQueryStatisticsOutput(v **GetQueryStatisticsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5236,14 +5630,184 @@ func awsRestjson1_deserializeOpDocumentListDataCellsFilterOutput(v **ListDataCel return nil } -type awsRestjson1_deserializeOpListLakeFormationOptIns struct { +type awsRestjson1_deserializeOpListLakeFormationOptIns struct { +} + +func (*awsRestjson1_deserializeOpListLakeFormationOptIns) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListLakeFormationOptIns(response, &metadata) + } + output := &ListLakeFormationOptInsOutput{} + 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_deserializeOpDocumentListLakeFormationOptInsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListLakeFormationOptIns(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLakeFormationOptInsOutput(v **ListLakeFormationOptInsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLakeFormationOptInsOutput + if *v == nil { + sv = &ListLakeFormationOptInsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LakeFormationOptInsInfoList": + if err := awsRestjson1_deserializeDocumentLakeFormationOptInsInfoList(&sv.LakeFormationOptInsInfoList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLFTagExpressions struct { } -func (*awsRestjson1_deserializeOpListLakeFormationOptIns) ID() string { +func (*awsRestjson1_deserializeOpListLFTagExpressions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListLFTagExpressions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5261,9 +5825,9 @@ func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListLakeFormationOptIns(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListLFTagExpressions(response, &metadata) } - output := &ListLakeFormationOptInsOutput{} + output := &ListLFTagExpressionsOutput{} out.Result = output var buff [1024]byte @@ -5284,7 +5848,7 @@ func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListLakeFormationOptInsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListLFTagExpressionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5298,7 +5862,7 @@ func (m *awsRestjson1_deserializeOpListLakeFormationOptIns) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListLakeFormationOptIns(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListLFTagExpressions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5342,6 +5906,9 @@ func awsRestjson1_deserializeOpErrorListLakeFormationOptIns(response *smithyhttp case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -5361,7 +5928,7 @@ func awsRestjson1_deserializeOpErrorListLakeFormationOptIns(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListLakeFormationOptInsOutput(v **ListLakeFormationOptInsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListLFTagExpressionsOutput(v **ListLFTagExpressionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5374,17 +5941,17 @@ func awsRestjson1_deserializeOpDocumentListLakeFormationOptInsOutput(v **ListLak return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListLakeFormationOptInsOutput + var sv *ListLFTagExpressionsOutput if *v == nil { - sv = &ListLakeFormationOptInsOutput{} + sv = &ListLFTagExpressionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "LakeFormationOptInsInfoList": - if err := awsRestjson1_deserializeDocumentLakeFormationOptInsInfoList(&sv.LakeFormationOptInsInfoList, value); err != nil { + case "LFTagExpressions": + if err := awsRestjson1_deserializeDocumentLFTagExpressionsList(&sv.LFTagExpressions, value); err != nil { return err } @@ -7696,6 +8263,109 @@ func awsRestjson1_deserializeOpErrorUpdateLFTag(response *smithyhttp.Response, m } } +type awsRestjson1_deserializeOpUpdateLFTagExpression struct { +} + +func (*awsRestjson1_deserializeOpUpdateLFTagExpression) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLFTagExpression) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorUpdateLFTagExpression(response, &metadata) + } + output := &UpdateLFTagExpressionOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateLFTagExpression(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("EntityNotFoundException", errorCode): + return awsRestjson1_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidInputException", errorCode): + return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("OperationTimeoutException", errorCode): + return awsRestjson1_deserializeErrorOperationTimeoutException(response, errorBody) + + case strings.EqualFold("ResourceNumberLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceNumberLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpUpdateResource struct { } @@ -10363,6 +11033,152 @@ func awsRestjson1_deserializeDocumentLFTagErrors(v *[]types.LFTagError, value in return nil } +func awsRestjson1_deserializeDocumentLFTagExpression(v **types.LFTagExpression, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LFTagExpression + if *v == nil { + sv = &types.LFTagExpression{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CatalogId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CatalogIdString to be of type string, got %T instead", value) + } + sv.CatalogId = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Expression": + if err := awsRestjson1_deserializeDocumentExpression(&sv.Expression, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLFTagExpressionResource(v **types.LFTagExpressionResource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LFTagExpressionResource + if *v == nil { + sv = &types.LFTagExpressionResource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CatalogId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CatalogIdString to be of type string, got %T instead", value) + } + sv.CatalogId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLFTagExpressionsList(v *[]types.LFTagExpression, 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.LFTagExpression + if *v == nil { + cv = []types.LFTagExpression{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LFTagExpression + destAddr := &col + if err := awsRestjson1_deserializeDocumentLFTagExpression(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentLFTagKeyResource(v **types.LFTagKeyResource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10507,6 +11323,15 @@ func awsRestjson1_deserializeDocumentLFTagPolicyResource(v **types.LFTagPolicyRe return err } + case "ExpressionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ExpressionName = ptr.String(jtv) + } + case "ResourceType": if value != nil { jtv, ok := value.(string) @@ -11178,6 +12003,11 @@ func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interfac return err } + case "LFTagExpression": + if err := awsRestjson1_deserializeDocumentLFTagExpressionResource(&sv.LFTagExpression, value); err != nil { + return err + } + case "LFTagPolicy": if err := awsRestjson1_deserializeDocumentLFTagPolicyResource(&sv.LFTagPolicy, value); err != nil { return err diff --git a/service/lakeformation/generated.json b/service/lakeformation/generated.json index c6679685af2..5ed86e9d068 100644 --- a/service/lakeformation/generated.json +++ b/service/lakeformation/generated.json @@ -16,10 +16,12 @@ "api_op_CommitTransaction.go", "api_op_CreateDataCellsFilter.go", "api_op_CreateLFTag.go", + "api_op_CreateLFTagExpression.go", "api_op_CreateLakeFormationIdentityCenterConfiguration.go", "api_op_CreateLakeFormationOptIn.go", "api_op_DeleteDataCellsFilter.go", "api_op_DeleteLFTag.go", + "api_op_DeleteLFTagExpression.go", "api_op_DeleteLakeFormationIdentityCenterConfiguration.go", "api_op_DeleteLakeFormationOptIn.go", "api_op_DeleteObjectsOnCancel.go", @@ -33,6 +35,7 @@ "api_op_GetDataLakeSettings.go", "api_op_GetEffectivePermissionsForPath.go", "api_op_GetLFTag.go", + "api_op_GetLFTagExpression.go", "api_op_GetQueryState.go", "api_op_GetQueryStatistics.go", "api_op_GetResourceLFTags.go", @@ -43,6 +46,7 @@ "api_op_GetWorkUnits.go", "api_op_GrantPermissions.go", "api_op_ListDataCellsFilter.go", + "api_op_ListLFTagExpressions.go", "api_op_ListLFTags.go", "api_op_ListLakeFormationOptIns.go", "api_op_ListPermissions.go", @@ -59,6 +63,7 @@ "api_op_StartTransaction.go", "api_op_UpdateDataCellsFilter.go", "api_op_UpdateLFTag.go", + "api_op_UpdateLFTagExpression.go", "api_op_UpdateLakeFormationIdentityCenterConfiguration.go", "api_op_UpdateResource.go", "api_op_UpdateTableObjects.go", diff --git a/service/lakeformation/serializers.go b/service/lakeformation/serializers.go index 168b2557c60..80f7346fb71 100644 --- a/service/lakeformation/serializers.go +++ b/service/lakeformation/serializers.go @@ -911,6 +911,104 @@ func awsRestjson1_serializeOpDocumentCreateLFTagInput(v *CreateLFTagInput, value return nil } +type awsRestjson1_serializeOpCreateLFTagExpression struct { +} + +func (*awsRestjson1_serializeOpCreateLFTagExpression) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateLFTagExpression) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLFTagExpressionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateLFTagExpression") + 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_serializeOpDocumentCreateLFTagExpressionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateLFTagExpressionInput(v *CreateLFTagExpressionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateLFTagExpressionInput(v *CreateLFTagExpressionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Expression != nil { + ok := object.Key("Expression") + if err := awsRestjson1_serializeDocumentExpression(v.Expression, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpDeleteDataCellsFilter struct { } @@ -1264,6 +1362,92 @@ func awsRestjson1_serializeOpDocumentDeleteLFTagInput(v *DeleteLFTagInput, value return nil } +type awsRestjson1_serializeOpDeleteLFTagExpression struct { +} + +func (*awsRestjson1_serializeOpDeleteLFTagExpression) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteLFTagExpression) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteLFTagExpressionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteLFTagExpression") + 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_serializeOpDocumentDeleteLFTagExpressionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteLFTagExpressionInput(v *DeleteLFTagExpressionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteLFTagExpressionInput(v *DeleteLFTagExpressionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpDeleteObjectsOnCancel struct { } @@ -2189,6 +2373,92 @@ func awsRestjson1_serializeOpDocumentGetLFTagInput(v *GetLFTagInput, value smith return nil } +type awsRestjson1_serializeOpGetLFTagExpression struct { +} + +func (*awsRestjson1_serializeOpGetLFTagExpression) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLFTagExpression) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLFTagExpressionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetLFTagExpression") + 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_serializeOpDocumentGetLFTagExpressionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetLFTagExpressionInput(v *GetLFTagExpressionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetLFTagExpressionInput(v *GetLFTagExpressionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpGetQueryState struct { } @@ -3277,6 +3547,97 @@ func awsRestjson1_serializeOpDocumentListLakeFormationOptInsInput(v *ListLakeFor return nil } +type awsRestjson1_serializeOpListLFTagExpressions struct { +} + +func (*awsRestjson1_serializeOpListLFTagExpressions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLFTagExpressions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLFTagExpressionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListLFTagExpressions") + 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_serializeOpDocumentListLFTagExpressionsInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListLFTagExpressionsInput(v *ListLFTagExpressionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListLFTagExpressionsInput(v *ListLFTagExpressionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListLFTags struct { } @@ -4824,6 +5185,104 @@ func awsRestjson1_serializeOpDocumentUpdateLFTagInput(v *UpdateLFTagInput, value return nil } +type awsRestjson1_serializeOpUpdateLFTagExpression struct { +} + +func (*awsRestjson1_serializeOpUpdateLFTagExpression) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLFTagExpression) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLFTagExpressionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateLFTagExpression") + 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_serializeOpDocumentUpdateLFTagExpressionInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateLFTagExpressionInput(v *UpdateLFTagExpressionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateLFTagExpressionInput(v *UpdateLFTagExpressionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Expression != nil { + ok := object.Key("Expression") + if err := awsRestjson1_serializeDocumentExpression(v.Expression, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpUpdateResource struct { } @@ -5600,6 +6059,23 @@ func awsRestjson1_serializeDocumentLFTag(v *types.LFTag, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentLFTagExpressionResource(v *types.LFTagExpressionResource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CatalogId != nil { + ok := object.Key("CatalogId") + ok.String(*v.CatalogId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + func awsRestjson1_serializeDocumentLFTagKeyResource(v *types.LFTagKeyResource, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5664,6 +6140,11 @@ func awsRestjson1_serializeDocumentLFTagPolicyResource(v *types.LFTagPolicyResou } } + if v.ExpressionName != nil { + ok := object.Key("ExpressionName") + ok.String(*v.ExpressionName) + } + if len(v.ResourceType) > 0 { ok := object.Key("ResourceType") ok.String(string(v.ResourceType)) @@ -5895,6 +6376,13 @@ func awsRestjson1_serializeDocumentResource(v *types.Resource, value smithyjson. } } + if v.LFTagExpression != nil { + ok := object.Key("LFTagExpression") + if err := awsRestjson1_serializeDocumentLFTagExpressionResource(v.LFTagExpression, ok); err != nil { + return err + } + } + if v.LFTagPolicy != nil { ok := object.Key("LFTagPolicy") if err := awsRestjson1_serializeDocumentLFTagPolicyResource(v.LFTagPolicy, ok); err != nil { diff --git a/service/lakeformation/snapshot/api_op_CreateLFTagExpression.go.snap b/service/lakeformation/snapshot/api_op_CreateLFTagExpression.go.snap new file mode 100644 index 00000000000..1199b577b54 --- /dev/null +++ b/service/lakeformation/snapshot/api_op_CreateLFTagExpression.go.snap @@ -0,0 +1,41 @@ +CreateLFTagExpression + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/lakeformation/snapshot/api_op_DeleteLFTagExpression.go.snap b/service/lakeformation/snapshot/api_op_DeleteLFTagExpression.go.snap new file mode 100644 index 00000000000..3cc4806137c --- /dev/null +++ b/service/lakeformation/snapshot/api_op_DeleteLFTagExpression.go.snap @@ -0,0 +1,41 @@ +DeleteLFTagExpression + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/lakeformation/snapshot/api_op_GetLFTagExpression.go.snap b/service/lakeformation/snapshot/api_op_GetLFTagExpression.go.snap new file mode 100644 index 00000000000..829beec7522 --- /dev/null +++ b/service/lakeformation/snapshot/api_op_GetLFTagExpression.go.snap @@ -0,0 +1,41 @@ +GetLFTagExpression + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/lakeformation/snapshot/api_op_ListLFTagExpressions.go.snap b/service/lakeformation/snapshot/api_op_ListLFTagExpressions.go.snap new file mode 100644 index 00000000000..4719d2bab34 --- /dev/null +++ b/service/lakeformation/snapshot/api_op_ListLFTagExpressions.go.snap @@ -0,0 +1,40 @@ +ListLFTagExpressions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/lakeformation/snapshot/api_op_UpdateLFTagExpression.go.snap b/service/lakeformation/snapshot/api_op_UpdateLFTagExpression.go.snap new file mode 100644 index 00000000000..2deb94e5e41 --- /dev/null +++ b/service/lakeformation/snapshot/api_op_UpdateLFTagExpression.go.snap @@ -0,0 +1,41 @@ +UpdateLFTagExpression + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/lakeformation/snapshot_test.go b/service/lakeformation/snapshot_test.go index 7a7cc59efa5..918b241b1eb 100644 --- a/service/lakeformation/snapshot_test.go +++ b/service/lakeformation/snapshot_test.go @@ -182,6 +182,18 @@ func TestCheckSnapshot_CreateLFTag(t *testing.T) { } } +func TestCheckSnapshot_CreateLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteDataCellsFilter(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataCellsFilter(context.Background(), nil, func(o *Options) { @@ -230,6 +242,18 @@ func TestCheckSnapshot_DeleteLFTag(t *testing.T) { } } +func TestCheckSnapshot_DeleteLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteObjectsOnCancel(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteObjectsOnCancel(context.Background(), nil, func(o *Options) { @@ -362,6 +386,18 @@ func TestCheckSnapshot_GetLFTag(t *testing.T) { } } +func TestCheckSnapshot_GetLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetQueryState(t *testing.T) { svc := New(Options{}) _, err := svc.GetQueryState(context.Background(), nil, func(o *Options) { @@ -494,6 +530,18 @@ func TestCheckSnapshot_ListLakeFormationOptIns(t *testing.T) { } } +func TestCheckSnapshot_ListLFTagExpressions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListLFTagExpressions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListLFTagExpressions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListLFTags(t *testing.T) { svc := New(Options{}) _, err := svc.ListLFTags(context.Background(), nil, func(o *Options) { @@ -686,6 +734,18 @@ func TestCheckSnapshot_UpdateLFTag(t *testing.T) { } } +func TestCheckSnapshot_UpdateLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateResource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateResource(context.Background(), nil, func(o *Options) { @@ -841,6 +901,18 @@ func TestUpdateSnapshot_CreateLFTag(t *testing.T) { } } +func TestUpdateSnapshot_CreateLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteDataCellsFilter(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteDataCellsFilter(context.Background(), nil, func(o *Options) { @@ -889,6 +961,18 @@ func TestUpdateSnapshot_DeleteLFTag(t *testing.T) { } } +func TestUpdateSnapshot_DeleteLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteObjectsOnCancel(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteObjectsOnCancel(context.Background(), nil, func(o *Options) { @@ -1021,6 +1105,18 @@ func TestUpdateSnapshot_GetLFTag(t *testing.T) { } } +func TestUpdateSnapshot_GetLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetQueryState(t *testing.T) { svc := New(Options{}) _, err := svc.GetQueryState(context.Background(), nil, func(o *Options) { @@ -1153,6 +1249,18 @@ func TestUpdateSnapshot_ListLakeFormationOptIns(t *testing.T) { } } +func TestUpdateSnapshot_ListLFTagExpressions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListLFTagExpressions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListLFTagExpressions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListLFTags(t *testing.T) { svc := New(Options{}) _, err := svc.ListLFTags(context.Background(), nil, func(o *Options) { @@ -1345,6 +1453,18 @@ func TestUpdateSnapshot_UpdateLFTag(t *testing.T) { } } +func TestUpdateSnapshot_UpdateLFTagExpression(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateLFTagExpression(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateLFTagExpression") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateResource(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateResource(context.Background(), nil, func(o *Options) { diff --git a/service/lakeformation/types/enums.go b/service/lakeformation/types/enums.go index 4d05ff78dc4..0d29adf7a55 100644 --- a/service/lakeformation/types/enums.go +++ b/service/lakeformation/types/enums.go @@ -62,14 +62,15 @@ type DataLakeResourceType string // Enum values for DataLakeResourceType const ( - DataLakeResourceTypeCatalog DataLakeResourceType = "CATALOG" - DataLakeResourceTypeDatabase DataLakeResourceType = "DATABASE" - DataLakeResourceTypeTable DataLakeResourceType = "TABLE" - DataLakeResourceTypeDataLocation DataLakeResourceType = "DATA_LOCATION" - DataLakeResourceTypeLfTag DataLakeResourceType = "LF_TAG" - DataLakeResourceTypeLfTagPolicy DataLakeResourceType = "LF_TAG_POLICY" - DataLakeResourceTypeLfTagPolicyDatabase DataLakeResourceType = "LF_TAG_POLICY_DATABASE" - DataLakeResourceTypeLfTagPolicyTable DataLakeResourceType = "LF_TAG_POLICY_TABLE" + DataLakeResourceTypeCatalog DataLakeResourceType = "CATALOG" + DataLakeResourceTypeDatabase DataLakeResourceType = "DATABASE" + DataLakeResourceTypeTable DataLakeResourceType = "TABLE" + DataLakeResourceTypeDataLocation DataLakeResourceType = "DATA_LOCATION" + DataLakeResourceTypeLfTag DataLakeResourceType = "LF_TAG" + DataLakeResourceTypeLfTagPolicy DataLakeResourceType = "LF_TAG_POLICY" + DataLakeResourceTypeLfTagPolicyDatabase DataLakeResourceType = "LF_TAG_POLICY_DATABASE" + DataLakeResourceTypeLfTagPolicyTable DataLakeResourceType = "LF_TAG_POLICY_TABLE" + DataLakeResourceTypeLfNamedTagExpression DataLakeResourceType = "LF_NAMED_TAG_EXPRESSION" ) // Values returns all known values for DataLakeResourceType. Note that this can be @@ -86,6 +87,7 @@ func (DataLakeResourceType) Values() []DataLakeResourceType { "LF_TAG_POLICY", "LF_TAG_POLICY_DATABASE", "LF_TAG_POLICY_TABLE", + "LF_NAMED_TAG_EXPRESSION", } } @@ -167,6 +169,7 @@ const ( PermissionCreateLfTag Permission = "CREATE_LF_TAG" PermissionAssociate Permission = "ASSOCIATE" PermissionGrantWithLfTagExpression Permission = "GRANT_WITH_LF_TAG_EXPRESSION" + PermissionCreateLfTagExpression Permission = "CREATE_LF_TAG_EXPRESSION" ) // Values returns all known values for Permission. Note that this can be expanded @@ -188,6 +191,7 @@ func (Permission) Values() []Permission { "CREATE_LF_TAG", "ASSOCIATE", "GRANT_WITH_LF_TAG_EXPRESSION", + "CREATE_LF_TAG_EXPRESSION", } } diff --git a/service/lakeformation/types/types.go b/service/lakeformation/types/types.go index 9b5ebf93dad..847472684c8 100644 --- a/service/lakeformation/types/types.go +++ b/service/lakeformation/types/types.go @@ -454,6 +454,38 @@ type LFTagError struct { noSmithyDocumentSerde } +// A structure consists LF-Tag expression name and catalog ID. +type LFTagExpression struct { + + // The identifier for the Data Catalog. By default, the account ID. + CatalogId *string + + // A structure that contains information about the LF-Tag expression. + Description *string + + // A logical expression composed of one or more LF-Tags. + Expression []LFTag + + // The name for saved the LF-Tag expression. + Name *string + + noSmithyDocumentSerde +} + +// A structure containing a LF-Tag expression (keys and values). +type LFTagExpressionResource struct { + + // The name of the LF-Tag expression to grant permissions on. + // + // This member is required. + Name *string + + // The identifier for the Data Catalog. By default, the account ID. + CatalogId *string + + noSmithyDocumentSerde +} + // A structure containing an LF-tag key and values for a resource. type LFTagKeyResource struct { @@ -498,15 +530,10 @@ type LFTagPair struct { noSmithyDocumentSerde } -// A structure containing a list of LF-tag conditions that apply to a resource's -// LF-tag policy. +// A structure containing a list of LF-tag conditions or saved LF-Tag expressions +// that apply to a resource's LF-tag policy. type LFTagPolicyResource struct { - // A list of LF-tag conditions that apply to the resource's LF-tag policy. - // - // This member is required. - Expression []LFTag - // The resource type for which the LF-tag policy applies. // // This member is required. @@ -518,6 +545,15 @@ type LFTagPolicyResource struct { // environment. CatalogId *string + // A list of LF-tag conditions or a saved expression that apply to the resource's + // LF-tag policy. + Expression []LFTag + + // If provided, permissions are granted to the Data Catalog resources whose + // assigned LF-Tags match the expression body of the saved expression under the + // provided ExpressionName . + ExpressionName *string + noSmithyDocumentSerde } @@ -681,7 +717,12 @@ type Resource struct { // The LF-tag key and values attached to a resource. LFTag *LFTagKeyResource - // A list of LF-tag conditions that define a resource's LF-tag policy. + // LF-Tag expression resource. A logical expression composed of one or more LF-Tag + // key:value pairs. + LFTagExpression *LFTagExpressionResource + + // A list of LF-tag conditions or saved LF-Tag expressions that define a + // resource's LF-tag policy. LFTagPolicy *LFTagPolicyResource // The table for the resource. A table is a metadata definition that represents diff --git a/service/lakeformation/validators.go b/service/lakeformation/validators.go index f7f4ec1aef3..973d456b1e5 100644 --- a/service/lakeformation/validators.go +++ b/service/lakeformation/validators.go @@ -190,6 +190,26 @@ func (m *validateOpCreateLakeFormationOptIn) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpCreateLFTagExpression struct { +} + +func (*validateOpCreateLFTagExpression) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLFTagExpression) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLFTagExpressionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLFTagExpressionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLFTag struct { } @@ -230,6 +250,26 @@ func (m *validateOpDeleteLakeFormationOptIn) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpDeleteLFTagExpression struct { +} + +func (*validateOpDeleteLFTagExpression) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteLFTagExpression) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteLFTagExpressionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteLFTagExpressionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteLFTag struct { } @@ -370,6 +410,26 @@ func (m *validateOpGetEffectivePermissionsForPath) HandleInitialize(ctx context. return next.HandleInitialize(ctx, in) } +type validateOpGetLFTagExpression struct { +} + +func (*validateOpGetLFTagExpression) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLFTagExpression) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLFTagExpressionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLFTagExpressionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetLFTag struct { } @@ -830,6 +890,26 @@ func (m *validateOpUpdateLakeFormationIdentityCenterConfiguration) HandleInitial return next.HandleInitialize(ctx, in) } +type validateOpUpdateLFTagExpression struct { +} + +func (*validateOpUpdateLFTagExpression) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLFTagExpression) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLFTagExpressionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLFTagExpressionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateLFTag struct { } @@ -946,6 +1026,10 @@ func addOpCreateLakeFormationOptInValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpCreateLakeFormationOptIn{}, middleware.After) } +func addOpCreateLFTagExpressionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLFTagExpression{}, middleware.After) +} + func addOpCreateLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLFTag{}, middleware.After) } @@ -954,6 +1038,10 @@ func addOpDeleteLakeFormationOptInValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteLakeFormationOptIn{}, middleware.After) } +func addOpDeleteLFTagExpressionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteLFTagExpression{}, middleware.After) +} + func addOpDeleteLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLFTag{}, middleware.After) } @@ -982,6 +1070,10 @@ func addOpGetEffectivePermissionsForPathValidationMiddleware(stack *middleware.S return stack.Initialize.Add(&validateOpGetEffectivePermissionsForPath{}, middleware.After) } +func addOpGetLFTagExpressionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLFTagExpression{}, middleware.After) +} + func addOpGetLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLFTag{}, middleware.After) } @@ -1074,6 +1166,10 @@ func addOpUpdateLakeFormationIdentityCenterConfigurationValidationMiddleware(sta return stack.Initialize.Add(&validateOpUpdateLakeFormationIdentityCenterConfiguration{}, middleware.After) } +func addOpUpdateLFTagExpressionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLFTagExpression{}, middleware.After) +} + func addOpUpdateLFTagValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLFTag{}, middleware.After) } @@ -1267,6 +1363,21 @@ func validateLFTag(v *types.LFTag) error { } } +func validateLFTagExpressionResource(v *types.LFTagExpressionResource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LFTagExpressionResource"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLFTagKeyResource(v *types.LFTagKeyResource) error { if v == nil { return nil @@ -1311,9 +1422,7 @@ func validateLFTagPolicyResource(v *types.LFTagPolicyResource) error { if len(v.ResourceType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) } - if v.Expression == nil { - invalidParams.Add(smithy.NewErrParamRequired("Expression")) - } else if v.Expression != nil { + if v.Expression != nil { if err := validateExpression(v.Expression); err != nil { invalidParams.AddNested("Expression", err.(smithy.InvalidParamsError)) } @@ -1407,6 +1516,11 @@ func validateResource(v *types.Resource) error { invalidParams.AddNested("LFTagPolicy", err.(smithy.InvalidParamsError)) } } + if v.LFTagExpression != nil { + if err := validateLFTagExpressionResource(v.LFTagExpression); err != nil { + invalidParams.AddNested("LFTagExpression", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1691,6 +1805,28 @@ func validateOpCreateLakeFormationOptInInput(v *CreateLakeFormationOptInInput) e } } +func validateOpCreateLFTagExpressionInput(v *CreateLFTagExpressionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLFTagExpressionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Expression == nil { + invalidParams.Add(smithy.NewErrParamRequired("Expression")) + } else if v.Expression != nil { + if err := validateExpression(v.Expression); err != nil { + invalidParams.AddNested("Expression", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLFTagInput(v *CreateLFTagInput) error { if v == nil { return nil @@ -1731,6 +1867,21 @@ func validateOpDeleteLakeFormationOptInInput(v *DeleteLakeFormationOptInInput) e } } +func validateOpDeleteLFTagExpressionInput(v *DeleteLFTagExpressionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteLFTagExpressionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteLFTagInput(v *DeleteLFTagInput) error { if v == nil { return nil @@ -1858,6 +2009,21 @@ func validateOpGetEffectivePermissionsForPathInput(v *GetEffectivePermissionsFor } } +func validateOpGetLFTagExpressionInput(v *GetLFTagExpressionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLFTagExpressionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetLFTagInput(v *GetLFTagInput) error { if v == nil { return nil @@ -2281,6 +2447,28 @@ func validateOpUpdateLakeFormationIdentityCenterConfigurationInput(v *UpdateLake } } +func validateOpUpdateLFTagExpressionInput(v *UpdateLFTagExpressionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLFTagExpressionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Expression == nil { + invalidParams.Add(smithy.NewErrParamRequired("Expression")) + } else if v.Expression != nil { + if err := validateExpression(v.Expression); err != nil { + invalidParams.AddNested("Expression", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateLFTagInput(v *UpdateLFTagInput) error { if v == nil { return nil diff --git a/service/qapps/api_op_BatchCreateCategory.go b/service/qapps/api_op_BatchCreateCategory.go new file mode 100644 index 00000000000..ce3bba7ba49 --- /dev/null +++ b/service/qapps/api_op_BatchCreateCategory.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qapps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qapps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates Categories for the Amazon Q Business application environment instance. +// Web experience users use Categories to tag and filter library items. For more +// information, see [Custom labels for Amazon Q Apps]. +// +// [Custom labels for Amazon Q Apps]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html +func (c *Client) BatchCreateCategory(ctx context.Context, params *BatchCreateCategoryInput, optFns ...func(*Options)) (*BatchCreateCategoryOutput, error) { + if params == nil { + params = &BatchCreateCategoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchCreateCategory", params, optFns, c.addOperationBatchCreateCategoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchCreateCategoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchCreateCategoryInput struct { + + // The list of category objects to be created + // + // This member is required. + Categories []types.BatchCreateCategoryInputCategory + + // The unique identifier of the Amazon Q Business application environment instance. + // + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type BatchCreateCategoryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchCreateCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchCreateCategory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchCreateCategory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchCreateCategory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpBatchCreateCategoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCreateCategory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchCreateCategory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchCreateCategory", + } +} diff --git a/service/qapps/api_op_BatchDeleteCategory.go b/service/qapps/api_op_BatchDeleteCategory.go new file mode 100644 index 00000000000..83a8f3ddb04 --- /dev/null +++ b/service/qapps/api_op_BatchDeleteCategory.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qapps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes Categories for the Amazon Q Business application environment instance. +// Web experience users use Categories to tag and filter library items. For more +// information, see [Custom labels for Amazon Q Apps]. +// +// [Custom labels for Amazon Q Apps]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html +func (c *Client) BatchDeleteCategory(ctx context.Context, params *BatchDeleteCategoryInput, optFns ...func(*Options)) (*BatchDeleteCategoryOutput, error) { + if params == nil { + params = &BatchDeleteCategoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeleteCategory", params, optFns, c.addOperationBatchDeleteCategoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeleteCategoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeleteCategoryInput struct { + + // The list of IDs of the categories to be deleted. + // + // This member is required. + Categories []string + + // The unique identifier of the Amazon Q Business application environment instance. + // + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type BatchDeleteCategoryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeleteCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteCategory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteCategory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchDeleteCategory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpBatchDeleteCategoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteCategory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchDeleteCategory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchDeleteCategory", + } +} diff --git a/service/qapps/api_op_BatchUpdateCategory.go b/service/qapps/api_op_BatchUpdateCategory.go new file mode 100644 index 00000000000..01b9917b33f --- /dev/null +++ b/service/qapps/api_op_BatchUpdateCategory.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qapps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qapps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates Categories for the Amazon Q Business application environment instance. +// Web experience users use Categories to tag and filter library items. For more +// information, see [Custom labels for Amazon Q Apps]. +// +// [Custom labels for Amazon Q Apps]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html +func (c *Client) BatchUpdateCategory(ctx context.Context, params *BatchUpdateCategoryInput, optFns ...func(*Options)) (*BatchUpdateCategoryOutput, error) { + if params == nil { + params = &BatchUpdateCategoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchUpdateCategory", params, optFns, c.addOperationBatchUpdateCategoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchUpdateCategoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchUpdateCategoryInput struct { + + // The list of categories to be updated with their new values. + // + // This member is required. + Categories []types.CategoryInput + + // The unique identifier of the Amazon Q Business application environment instance. + // + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type BatchUpdateCategoryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchUpdateCategoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateCategory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateCategory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchUpdateCategory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpBatchUpdateCategoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateCategory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchUpdateCategory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchUpdateCategory", + } +} diff --git a/service/qapps/api_op_ListCategories.go b/service/qapps/api_op_ListCategories.go new file mode 100644 index 00000000000..95586ec588c --- /dev/null +++ b/service/qapps/api_op_ListCategories.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qapps + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/qapps/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the categories of a Amazon Q Business application environment instance. +// For more information, see [Custom labels for Amazon Q Apps]. +// +// [Custom labels for Amazon Q Apps]: https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html +func (c *Client) ListCategories(ctx context.Context, params *ListCategoriesInput, optFns ...func(*Options)) (*ListCategoriesOutput, error) { + if params == nil { + params = &ListCategoriesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCategories", params, optFns, c.addOperationListCategoriesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCategoriesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCategoriesInput struct { + + // The unique identifier of the Amazon Q Business application environment instance. + // + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type ListCategoriesOutput struct { + + // The categories of a Amazon Q Business application environment instance. + Categories []types.Category + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCategoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCategories{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCategories{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCategories"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListCategoriesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCategories(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListCategories(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCategories", + } +} diff --git a/service/qapps/deserializers.go b/service/qapps/deserializers.go index 9de943f0ad8..d3ec8ab08f1 100644 --- a/service/qapps/deserializers.go +++ b/service/qapps/deserializers.go @@ -258,6 +258,342 @@ func awsRestjson1_deserializeOpErrorAssociateQAppWithUser(response *smithyhttp.R } } +type awsRestjson1_deserializeOpBatchCreateCategory struct { +} + +func (*awsRestjson1_deserializeOpBatchCreateCategory) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchCreateCategory) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorBatchCreateCategory(response, &metadata) + } + output := &BatchCreateCategoryOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchCreateCategory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpBatchDeleteCategory struct { +} + +func (*awsRestjson1_deserializeOpBatchDeleteCategory) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchDeleteCategory) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorBatchDeleteCategory(response, &metadata) + } + output := &BatchDeleteCategoryOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchDeleteCategory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpBatchUpdateCategory struct { +} + +func (*awsRestjson1_deserializeOpBatchUpdateCategory) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchUpdateCategory) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorBatchUpdateCategory(response, &metadata) + } + output := &BatchUpdateCategoryOutput{} + 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), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchUpdateCategory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpCreateLibraryItem struct { } @@ -2188,6 +2524,173 @@ func awsRestjson1_deserializeOpDocumentImportDocumentOutput(v **ImportDocumentOu return nil } +type awsRestjson1_deserializeOpListCategories struct { +} + +func (*awsRestjson1_deserializeOpListCategories) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCategories) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListCategories(response, &metadata) + } + output := &ListCategoriesOutput{} + 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_deserializeOpDocumentListCategoriesOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCategories(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCategoriesOutput(v **ListCategoriesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCategoriesOutput + if *v == nil { + sv = &ListCategoriesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "categories": + if err := awsRestjson1_deserializeDocumentCategoriesList(&sv.Categories, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListLibraryItems struct { } @@ -5188,6 +5691,40 @@ func awsRestjson1_deserializeDocumentCardStatusMap(v *map[string]types.CardStatu return nil } +func awsRestjson1_deserializeDocumentCategoriesList(v *[]types.Category, 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.Category + if *v == nil { + cv = []types.Category{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Category + destAddr := &col + if err := awsRestjson1_deserializeDocumentCategory(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCategory(v **types.Category, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5210,6 +5747,28 @@ func awsRestjson1_deserializeDocumentCategory(v **types.Category, value interfac for key, value := range shape { switch key { + case "appCount": + 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.AppCount = ptr.Int32(int32(i64)) + } + + case "color": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Color = ptr.String(jtv) + } + case "id": if value != nil { jtv, ok := value.(string) diff --git a/service/qapps/generated.json b/service/qapps/generated.json index dee7d2bc07a..ea2003dbbc2 100644 --- a/service/qapps/generated.json +++ b/service/qapps/generated.json @@ -10,6 +10,9 @@ "api_client_test.go", "api_op_AssociateLibraryItemReview.go", "api_op_AssociateQAppWithUser.go", + "api_op_BatchCreateCategory.go", + "api_op_BatchDeleteCategory.go", + "api_op_BatchUpdateCategory.go", "api_op_CreateLibraryItem.go", "api_op_CreateQApp.go", "api_op_DeleteLibraryItem.go", @@ -20,6 +23,7 @@ "api_op_GetQApp.go", "api_op_GetQAppSession.go", "api_op_ImportDocument.go", + "api_op_ListCategories.go", "api_op_ListLibraryItems.go", "api_op_ListQApps.go", "api_op_ListTagsForResource.go", diff --git a/service/qapps/serializers.go b/service/qapps/serializers.go index 0372d495285..43e60d6bb9c 100644 --- a/service/qapps/serializers.go +++ b/service/qapps/serializers.go @@ -196,6 +196,282 @@ func awsRestjson1_serializeOpDocumentAssociateQAppWithUserInput(v *AssociateQApp return nil } +type awsRestjson1_serializeOpBatchCreateCategory struct { +} + +func (*awsRestjson1_serializeOpBatchCreateCategory) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchCreateCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchCreateCategoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/catalog.createCategories") + 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_serializeOpHttpBindingsBatchCreateCategoryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchCreateCategoryInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchCreateCategoryInput(v *BatchCreateCategoryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId != nil { + locationName := "Instance-Id" + encoder.SetHeader(locationName).String(*v.InstanceId) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchCreateCategoryInput(v *BatchCreateCategoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Categories != nil { + ok := object.Key("categories") + if err := awsRestjson1_serializeDocumentBatchCreateCategoryInputCategoryList(v.Categories, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchDeleteCategory struct { +} + +func (*awsRestjson1_serializeOpBatchDeleteCategory) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchDeleteCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchDeleteCategoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/catalog.deleteCategories") + 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_serializeOpHttpBindingsBatchDeleteCategoryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchDeleteCategoryInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchDeleteCategoryInput(v *BatchDeleteCategoryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId != nil { + locationName := "Instance-Id" + encoder.SetHeader(locationName).String(*v.InstanceId) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchDeleteCategoryInput(v *BatchDeleteCategoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Categories != nil { + ok := object.Key("categories") + if err := awsRestjson1_serializeDocumentDeleteCategoryInputList(v.Categories, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchUpdateCategory struct { +} + +func (*awsRestjson1_serializeOpBatchUpdateCategory) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchUpdateCategory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchUpdateCategoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/catalog.updateCategories") + 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_serializeOpHttpBindingsBatchUpdateCategoryInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchUpdateCategoryInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchUpdateCategoryInput(v *BatchUpdateCategoryInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId != nil { + locationName := "Instance-Id" + encoder.SetHeader(locationName).String(*v.InstanceId) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchUpdateCategoryInput(v *BatchUpdateCategoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Categories != nil { + ok := object.Key("categories") + if err := awsRestjson1_serializeDocumentCategoryListInput(v.Categories, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateLibraryItem struct { } @@ -1099,6 +1375,73 @@ func awsRestjson1_serializeOpDocumentImportDocumentInput(v *ImportDocumentInput, return nil } +type awsRestjson1_serializeOpListCategories struct { +} + +func (*awsRestjson1_serializeOpListCategories) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCategories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCategoriesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/catalog.listCategories") + 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_serializeOpHttpBindingsListCategoriesInput(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 + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListCategoriesInput(v *ListCategoriesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId != nil { + locationName := "Instance-Id" + encoder.SetHeader(locationName).String(*v.InstanceId) + } + + return nil +} + type awsRestjson1_serializeOpListLibraryItems struct { } @@ -2298,6 +2641,41 @@ func awsRestjson1_serializeDocumentAttributeFilters(v []types.AttributeFilter, v return nil } +func awsRestjson1_serializeDocumentBatchCreateCategoryInputCategory(v *types.BatchCreateCategoryInputCategory, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Color != nil { + ok := object.Key("color") + ok.String(*v.Color) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchCreateCategoryInputCategoryList(v []types.BatchCreateCategoryInputCategory, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentBatchCreateCategoryInputCategory(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentCardInput(v types.CardInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2391,6 +2769,41 @@ func awsRestjson1_serializeDocumentCategoryIdList(v []string, value smithyjson.V return nil } +func awsRestjson1_serializeDocumentCategoryInput(v *types.CategoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Color != nil { + ok := object.Key("color") + ok.String(*v.Color) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Title != nil { + ok := object.Key("title") + ok.String(*v.Title) + } + + return nil +} + +func awsRestjson1_serializeDocumentCategoryListInput(v []types.CategoryInput, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCategoryInput(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentConversationMessage(v *types.ConversationMessage, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2408,6 +2821,17 @@ func awsRestjson1_serializeDocumentConversationMessage(v *types.ConversationMess return nil } +func awsRestjson1_serializeDocumentDeleteCategoryInputList(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_serializeDocumentDocumentAttribute(v *types.DocumentAttribute, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/qapps/snapshot/api_op_BatchCreateCategory.go.snap b/service/qapps/snapshot/api_op_BatchCreateCategory.go.snap new file mode 100644 index 00000000000..f987cb98ba4 --- /dev/null +++ b/service/qapps/snapshot/api_op_BatchCreateCategory.go.snap @@ -0,0 +1,41 @@ +BatchCreateCategory + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qapps/snapshot/api_op_BatchDeleteCategory.go.snap b/service/qapps/snapshot/api_op_BatchDeleteCategory.go.snap new file mode 100644 index 00000000000..bf6514f12cd --- /dev/null +++ b/service/qapps/snapshot/api_op_BatchDeleteCategory.go.snap @@ -0,0 +1,41 @@ +BatchDeleteCategory + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qapps/snapshot/api_op_BatchUpdateCategory.go.snap b/service/qapps/snapshot/api_op_BatchUpdateCategory.go.snap new file mode 100644 index 00000000000..8e8bc2d44c9 --- /dev/null +++ b/service/qapps/snapshot/api_op_BatchUpdateCategory.go.snap @@ -0,0 +1,41 @@ +BatchUpdateCategory + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qapps/snapshot/api_op_ListCategories.go.snap b/service/qapps/snapshot/api_op_ListCategories.go.snap new file mode 100644 index 00000000000..fe3e1a203a3 --- /dev/null +++ b/service/qapps/snapshot/api_op_ListCategories.go.snap @@ -0,0 +1,41 @@ +ListCategories + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/qapps/snapshot_test.go b/service/qapps/snapshot_test.go index d650fa1a539..9800f4d14ee 100644 --- a/service/qapps/snapshot_test.go +++ b/service/qapps/snapshot_test.go @@ -86,6 +86,42 @@ func TestCheckSnapshot_AssociateQAppWithUser(t *testing.T) { } } +func TestCheckSnapshot_BatchCreateCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchCreateCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchCreateCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_BatchDeleteCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchDeleteCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchDeleteCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_BatchUpdateCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchUpdateCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchUpdateCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateLibraryItem(t *testing.T) { svc := New(Options{}) _, err := svc.CreateLibraryItem(context.Background(), nil, func(o *Options) { @@ -206,6 +242,18 @@ func TestCheckSnapshot_ImportDocument(t *testing.T) { } } +func TestCheckSnapshot_ListCategories(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCategories(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCategories") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListLibraryItems(t *testing.T) { svc := New(Options{}) _, err := svc.ListLibraryItems(context.Background(), nil, func(o *Options) { @@ -373,6 +421,42 @@ func TestUpdateSnapshot_AssociateQAppWithUser(t *testing.T) { } } +func TestUpdateSnapshot_BatchCreateCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchCreateCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchCreateCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_BatchDeleteCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchDeleteCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchDeleteCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_BatchUpdateCategory(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchUpdateCategory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchUpdateCategory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateLibraryItem(t *testing.T) { svc := New(Options{}) _, err := svc.CreateLibraryItem(context.Background(), nil, func(o *Options) { @@ -493,6 +577,18 @@ func TestUpdateSnapshot_ImportDocument(t *testing.T) { } } +func TestUpdateSnapshot_ListCategories(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCategories(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCategories") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListLibraryItems(t *testing.T) { svc := New(Options{}) _, err := svc.ListLibraryItems(context.Background(), nil, func(o *Options) { diff --git a/service/qapps/types/types.go b/service/qapps/types/types.go index 0e0cbfdc75a..886836dea74 100644 --- a/service/qapps/types/types.go +++ b/service/qapps/types/types.go @@ -100,6 +100,25 @@ type AttributeFilter struct { noSmithyDocumentSerde } +// The category object to be created. +type BatchCreateCategoryInputCategory struct { + + // The name of the category. + // + // This member is required. + Title *string + + // The color to be associated with a category. The color must be a hexadecimal + // value of either 3 or 6 digits. + Color *string + + // The unique identifier to be associated with a category. If you don't include a + // value, the category is automatically assigned a unique identifier. + Id *string + + noSmithyDocumentSerde +} + // A card representing a component or step in an Amazon Q App's flow. // // The following types satisfy this interface: @@ -241,6 +260,33 @@ type Category struct { // This member is required. Title *string + // The number of published Amazon Q Apps associated with a category + AppCount *int32 + + // The color of the category + Color *string + + noSmithyDocumentSerde +} + +// A label that web experience users associate with a library item. Web experience +// users use Categories to tag and filter library items. +type CategoryInput struct { + + // The unique identifier of the category. + // + // This member is required. + Id *string + + // The name of the category. + // + // This member is required. + Title *string + + // The color of the category, represented as a hexadecimal value of either 3 or 6 + // digits. + Color *string + noSmithyDocumentSerde } diff --git a/service/qapps/validators.go b/service/qapps/validators.go index dfaf3e0b8f8..6fac706838b 100644 --- a/service/qapps/validators.go +++ b/service/qapps/validators.go @@ -50,6 +50,66 @@ func (m *validateOpAssociateQAppWithUser) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpBatchCreateCategory struct { +} + +func (*validateOpBatchCreateCategory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchCreateCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchCreateCategoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchCreateCategoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchDeleteCategory struct { +} + +func (*validateOpBatchDeleteCategory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeleteCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeleteCategoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeleteCategoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchUpdateCategory struct { +} + +func (*validateOpBatchUpdateCategory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchUpdateCategory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchUpdateCategoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchUpdateCategoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateLibraryItem struct { } @@ -250,6 +310,26 @@ func (m *validateOpImportDocument) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpListCategories struct { +} + +func (*validateOpListCategories) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCategories) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCategoriesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCategoriesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListLibraryItems struct { } @@ -498,6 +578,18 @@ func addOpAssociateQAppWithUserValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpAssociateQAppWithUser{}, middleware.After) } +func addOpBatchCreateCategoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchCreateCategory{}, middleware.After) +} + +func addOpBatchDeleteCategoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeleteCategory{}, middleware.After) +} + +func addOpBatchUpdateCategoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchUpdateCategory{}, middleware.After) +} + func addOpCreateLibraryItemValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateLibraryItem{}, middleware.After) } @@ -538,6 +630,10 @@ func addOpImportDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportDocument{}, middleware.After) } +func addOpListCategoriesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCategories{}, middleware.After) +} + func addOpListLibraryItemsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListLibraryItems{}, middleware.After) } @@ -684,6 +780,38 @@ func validateAttributeFilters(v []types.AttributeFilter) error { } } +func validateBatchCreateCategoryInputCategory(v *types.BatchCreateCategoryInputCategory) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchCreateCategoryInputCategory"} + if v.Title == nil { + invalidParams.Add(smithy.NewErrParamRequired("Title")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchCreateCategoryInputCategoryList(v []types.BatchCreateCategoryInputCategory) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchCreateCategoryInputCategoryList"} + for i := range v { + if err := validateBatchCreateCategoryInputCategory(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCardInput(v types.CardInput) error { if v == nil { return nil @@ -770,6 +898,41 @@ func validateCardValueList(v []types.CardValue) error { } } +func validateCategoryInput(v *types.CategoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CategoryInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.Title == nil { + invalidParams.Add(smithy.NewErrParamRequired("Title")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCategoryListInput(v []types.CategoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CategoryListInput"} + for i := range v { + if err := validateCategoryInput(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateConversationMessage(v *types.ConversationMessage) error { if v == nil { return nil @@ -976,6 +1139,68 @@ func validateOpAssociateQAppWithUserInput(v *AssociateQAppWithUserInput) error { } } +func validateOpBatchCreateCategoryInput(v *BatchCreateCategoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchCreateCategoryInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Categories == nil { + invalidParams.Add(smithy.NewErrParamRequired("Categories")) + } else if v.Categories != nil { + if err := validateBatchCreateCategoryInputCategoryList(v.Categories); err != nil { + invalidParams.AddNested("Categories", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchDeleteCategoryInput(v *BatchDeleteCategoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteCategoryInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Categories == nil { + invalidParams.Add(smithy.NewErrParamRequired("Categories")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchUpdateCategoryInput(v *BatchUpdateCategoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchUpdateCategoryInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Categories == nil { + invalidParams.Add(smithy.NewErrParamRequired("Categories")) + } else if v.Categories != nil { + if err := validateCategoryListInput(v.Categories); err != nil { + invalidParams.AddNested("Categories", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateLibraryItemInput(v *CreateLibraryItemInput) error { if v == nil { return nil @@ -1181,6 +1406,21 @@ func validateOpImportDocumentInput(v *ImportDocumentInput) error { } } +func validateOpListCategoriesInput(v *ListCategoriesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCategoriesInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListLibraryItemsInput(v *ListLibraryItemsInput) error { if v == nil { return nil diff --git a/service/s3control/api_op_GetAccessPoint.go b/service/s3control/api_op_GetAccessPoint.go index bff52bcd7fd..e0e322a9d88 100644 --- a/service/s3control/api_op_GetAccessPoint.go +++ b/service/s3control/api_op_GetAccessPoint.go @@ -137,7 +137,7 @@ type GetAccessPointOutput struct { // point. // // This element is empty if this access point is an Amazon S3 on Outposts access - // point that is used by other Amazon Web Servicesservices. + // point that is used by other Amazon Web Services services. VpcConfiguration *types.VpcConfiguration // Metadata pertaining to the operation's result. diff --git a/service/s3control/deserializers.go b/service/s3control/deserializers.go index fa10fff8410..0c8ca5bf39a 100644 --- a/service/s3control/deserializers.go +++ b/service/s3control/deserializers.go @@ -9792,7 +9792,7 @@ func awsRestxml_deserializeOpDocumentListStorageLensConfigurationsOutput(v **Lis sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("StorageLensConfigurationList", t.Name.Local): + case strings.EqualFold("StorageLensConfiguration", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsRestxml_deserializeDocumentStorageLensConfigurationListUnwrapped(&sv.StorageLensConfigurationList, nodeDecoder); err != nil { return err @@ -9949,7 +9949,7 @@ func awsRestxml_deserializeOpDocumentListStorageLensGroupsOutput(v **ListStorage sv.NextToken = ptr.String(xtv) } - case strings.EqualFold("StorageLensGroupList", t.Name.Local): + case strings.EqualFold("StorageLensGroup", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsRestxml_deserializeDocumentStorageLensGroupListUnwrapped(&sv.StorageLensGroupList, nodeDecoder); err != nil { return err diff --git a/service/s3control/types/types.go b/service/s3control/types/types.go index 66fd6cec38e..b9538fceb98 100644 --- a/service/s3control/types/types.go +++ b/service/s3control/types/types.go @@ -89,7 +89,7 @@ type AccessPoint struct { // exists. // // This element is empty if this access point is an Amazon S3 on Outposts access - // point that is used by other Amazon Web Servicesservices. + // point that is used by other Amazon Web Services services. VpcConfiguration *VpcConfiguration noSmithyDocumentSerde @@ -1767,7 +1767,7 @@ type PublicAccessBlockConfiguration struct { // Specifies whether Amazon S3 should restrict public bucket policies for buckets // in this account. Setting this element to TRUE restricts access to buckets with - // public policies to only Amazon Web Servicesservice principals and authorized + // public policies to only Amazon Web Services service principals and authorized // users within this account. // // Enabling this setting doesn't affect previously stored bucket policies, except diff --git a/service/verifiedpermissions/api_op_BatchGetPolicy.go b/service/verifiedpermissions/api_op_BatchGetPolicy.go new file mode 100644 index 00000000000..60c22080a30 --- /dev/null +++ b/service/verifiedpermissions/api_op_BatchGetPolicy.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves information about a group (batch) of policies. +// +// The BatchGetPolicy operation doesn't have its own IAM permission. To authorize +// this operation for Amazon Web Services principals, include the permission +// verifiedpermissions:GetPolicy in their IAM policies. +func (c *Client) BatchGetPolicy(ctx context.Context, params *BatchGetPolicyInput, optFns ...func(*Options)) (*BatchGetPolicyOutput, error) { + if params == nil { + params = &BatchGetPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetPolicy", params, optFns, c.addOperationBatchGetPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetPolicyInput struct { + + // An array of up to 100 policies you want information about. + // + // This member is required. + Requests []types.BatchGetPolicyInputItem + + noSmithyDocumentSerde +} + +type BatchGetPolicyOutput struct { + + // Information about the policies from the request that resulted in an error. + // These results are returned in the order they were requested. + // + // This member is required. + Errors []types.BatchGetPolicyErrorItem + + // Information about the policies listed in the request that were successfully + // returned. These results are returned in the order they were requested. + // + // This member is required. + Results []types.BatchGetPolicyOutputItem + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpBatchGetPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpBatchGetPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpBatchGetPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchGetPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchGetPolicy", + } +} diff --git a/service/verifiedpermissions/api_op_BatchIsAuthorized.go b/service/verifiedpermissions/api_op_BatchIsAuthorized.go index 22b0a7ffe14..7e159f2451b 100644 --- a/service/verifiedpermissions/api_op_BatchIsAuthorized.go +++ b/service/verifiedpermissions/api_op_BatchIsAuthorized.go @@ -72,7 +72,7 @@ type BatchIsAuthorizedInput struct { type BatchIsAuthorizedOutput struct { // A series of Allow or Deny decisions for each request, and the policies that - // produced them. + // produced them. These results are returned in the order they were requested. // // This member is required. Results []types.BatchIsAuthorizedOutputItem diff --git a/service/verifiedpermissions/api_op_BatchIsAuthorizedWithToken.go b/service/verifiedpermissions/api_op_BatchIsAuthorizedWithToken.go index 26b23d73cef..e47b188848d 100644 --- a/service/verifiedpermissions/api_op_BatchIsAuthorizedWithToken.go +++ b/service/verifiedpermissions/api_op_BatchIsAuthorizedWithToken.go @@ -96,7 +96,7 @@ type BatchIsAuthorizedWithTokenInput struct { type BatchIsAuthorizedWithTokenOutput struct { // A series of Allow or Deny decisions for each request, and the policies that - // produced them. + // produced them. These results are returned in the order they were requested. // // This member is required. Results []types.BatchIsAuthorizedWithTokenOutputItem diff --git a/service/verifiedpermissions/deserializers.go b/service/verifiedpermissions/deserializers.go index 3dff04d8d47..0e616002c22 100644 --- a/service/verifiedpermissions/deserializers.go +++ b/service/verifiedpermissions/deserializers.go @@ -29,6 +29,126 @@ func deserializeS3Expires(v string) (*time.Time, error) { return &t, nil } +type awsAwsjson10_deserializeOpBatchGetPolicy struct { +} + +func (*awsAwsjson10_deserializeOpBatchGetPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpBatchGetPolicy) HandleDeserialize(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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorBatchGetPolicy(response, &metadata) + } + output := &BatchGetPolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentBatchGetPolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorBatchGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpBatchIsAuthorized struct { } @@ -3672,6 +3792,18 @@ loop: uv = &types.AttributeValueMemberBoolean{Value: mv} break loop + case "decimal": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Decimal to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.AttributeValueMemberDecimal{Value: mv} + break loop + case "entityIdentifier": var mv types.EntityIdentifier destAddr := &mv @@ -3682,6 +3814,18 @@ loop: uv = &types.AttributeValueMemberEntityIdentifier{Value: mv} break loop + case "ipaddr": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpAddr to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.AttributeValueMemberIpaddr{Value: mv} + break loop + case "long": var mv int64 if value != nil { @@ -3772,6 +3916,230 @@ func awsAwsjson10_deserializeDocumentAudiences(v *[]string, value interface{}) e return nil } +func awsAwsjson10_deserializeDocumentBatchGetPolicyErrorItem(v **types.BatchGetPolicyErrorItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchGetPolicyErrorItem + if *v == nil { + sv = &types.BatchGetPolicyErrorItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BatchGetPolicyErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.BatchGetPolicyErrorCode(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchGetPolicyErrorList(v *[]types.BatchGetPolicyErrorItem, 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.BatchGetPolicyErrorItem + if *v == nil { + cv = []types.BatchGetPolicyErrorItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetPolicyErrorItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentBatchGetPolicyErrorItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchGetPolicyOutputItem(v **types.BatchGetPolicyOutputItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BatchGetPolicyOutputItem + if *v == nil { + sv = &types.BatchGetPolicyOutputItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case "definition": + if err := awsAwsjson10_deserializeDocumentPolicyDefinitionDetail(&sv.Definition, value); err != nil { + return err + } + + case "lastUpdatedDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimestampFormat to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(t) + } + + case "policyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + case "policyStoreId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyStoreId to be of type string, got %T instead", value) + } + sv.PolicyStoreId = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentBatchGetPolicyOutputList(v *[]types.BatchGetPolicyOutputItem, 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.BatchGetPolicyOutputItem + if *v == nil { + cv = []types.BatchGetPolicyOutputItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BatchGetPolicyOutputItem + destAddr := &col + if err := awsAwsjson10_deserializeDocumentBatchGetPolicyOutputItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentBatchIsAuthorizedInputItem(v **types.BatchIsAuthorizedInputItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6702,6 +7070,47 @@ func awsAwsjson10_deserializeDocumentValidationSettings(v **types.ValidationSett return nil } +func awsAwsjson10_deserializeOpDocumentBatchGetPolicyOutput(v **BatchGetPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetPolicyOutput + if *v == nil { + sv = &BatchGetPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsAwsjson10_deserializeDocumentBatchGetPolicyErrorList(&sv.Errors, value); err != nil { + return err + } + + case "results": + if err := awsAwsjson10_deserializeDocumentBatchGetPolicyOutputList(&sv.Results, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentBatchIsAuthorizedOutput(v **BatchIsAuthorizedOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/verifiedpermissions/generated.json b/service/verifiedpermissions/generated.json index ef8d8039901..a5b846400fe 100644 --- a/service/verifiedpermissions/generated.json +++ b/service/verifiedpermissions/generated.json @@ -8,6 +8,7 @@ "files": [ "api_client.go", "api_client_test.go", + "api_op_BatchGetPolicy.go", "api_op_BatchIsAuthorized.go", "api_op_BatchIsAuthorizedWithToken.go", "api_op_CreateIdentitySource.go", diff --git a/service/verifiedpermissions/serializers.go b/service/verifiedpermissions/serializers.go index 7065dddbb70..ea63b5519d1 100644 --- a/service/verifiedpermissions/serializers.go +++ b/service/verifiedpermissions/serializers.go @@ -16,6 +16,67 @@ import ( "path" ) +type awsAwsjson10_serializeOpBatchGetPolicy struct { +} + +func (*awsAwsjson10_serializeOpBatchGetPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpBatchGetPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("VerifiedPermissions.BatchGetPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentBatchGetPolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpBatchIsAuthorized struct { } @@ -1627,12 +1688,20 @@ func awsAwsjson10_serializeDocumentAttributeValue(v types.AttributeValue, value av := object.Key("boolean") av.Boolean(uv.Value) + case *types.AttributeValueMemberDecimal: + av := object.Key("decimal") + av.String(uv.Value) + case *types.AttributeValueMemberEntityIdentifier: av := object.Key("entityIdentifier") if err := awsAwsjson10_serializeDocumentEntityIdentifier(&uv.Value, av); err != nil { return err } + case *types.AttributeValueMemberIpaddr: + av := object.Key("ipaddr") + av.String(uv.Value) + case *types.AttributeValueMemberLong: av := object.Key("long") av.Long(uv.Value) @@ -1671,6 +1740,36 @@ func awsAwsjson10_serializeDocumentAudiences(v []string, value smithyjson.Value) return nil } +func awsAwsjson10_serializeDocumentBatchGetPolicyInputItem(v *types.BatchGetPolicyInputItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyId != nil { + ok := object.Key("policyId") + ok.String(*v.PolicyId) + } + + if v.PolicyStoreId != nil { + ok := object.Key("policyStoreId") + ok.String(*v.PolicyStoreId) + } + + return nil +} + +func awsAwsjson10_serializeDocumentBatchGetPolicyInputList(v []types.BatchGetPolicyInputItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentBatchGetPolicyInputItem(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson10_serializeDocumentBatchIsAuthorizedInputItem(v *types.BatchIsAuthorizedInputItem, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2494,6 +2593,20 @@ func awsAwsjson10_serializeDocumentValidationSettings(v *types.ValidationSetting return nil } +func awsAwsjson10_serializeOpDocumentBatchGetPolicyInput(v *BatchGetPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Requests != nil { + ok := object.Key("requests") + if err := awsAwsjson10_serializeDocumentBatchGetPolicyInputList(v.Requests, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentBatchIsAuthorizedInput(v *BatchIsAuthorizedInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/verifiedpermissions/snapshot/api_op_BatchGetPolicy.go.snap b/service/verifiedpermissions/snapshot/api_op_BatchGetPolicy.go.snap new file mode 100644 index 00000000000..daed851c931 --- /dev/null +++ b/service/verifiedpermissions/snapshot/api_op_BatchGetPolicy.go.snap @@ -0,0 +1,41 @@ +BatchGetPolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/verifiedpermissions/snapshot_test.go b/service/verifiedpermissions/snapshot_test.go index c701652db90..9077c299eff 100644 --- a/service/verifiedpermissions/snapshot_test.go +++ b/service/verifiedpermissions/snapshot_test.go @@ -62,6 +62,18 @@ func testSnapshot(stack *middleware.Stack, operation string) error { } return snapshotOK{} } +func TestCheckSnapshot_BatchGetPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchGetPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "BatchGetPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_BatchIsAuthorized(t *testing.T) { svc := New(Options{}) _, err := svc.BatchIsAuthorized(context.Background(), nil, func(o *Options) { @@ -373,6 +385,18 @@ func TestCheckSnapshot_UpdatePolicyTemplate(t *testing.T) { t.Fatal(err) } } +func TestUpdateSnapshot_BatchGetPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.BatchGetPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "BatchGetPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_BatchIsAuthorized(t *testing.T) { svc := New(Options{}) _, err := svc.BatchIsAuthorized(context.Background(), nil, func(o *Options) { diff --git a/service/verifiedpermissions/types/enums.go b/service/verifiedpermissions/types/enums.go index a32206a3cff..f56f3716ca2 100644 --- a/service/verifiedpermissions/types/enums.go +++ b/service/verifiedpermissions/types/enums.go @@ -2,6 +2,25 @@ package types +type BatchGetPolicyErrorCode string + +// Enum values for BatchGetPolicyErrorCode +const ( + BatchGetPolicyErrorCodePolicyStoreNotFound BatchGetPolicyErrorCode = "POLICY_STORE_NOT_FOUND" + BatchGetPolicyErrorCodePolicyNotFound BatchGetPolicyErrorCode = "POLICY_NOT_FOUND" +) + +// Values returns all known values for BatchGetPolicyErrorCode. 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 (BatchGetPolicyErrorCode) Values() []BatchGetPolicyErrorCode { + return []BatchGetPolicyErrorCode{ + "POLICY_STORE_NOT_FOUND", + "POLICY_NOT_FOUND", + } +} + type Decision string // Enum values for Decision diff --git a/service/verifiedpermissions/types/types.go b/service/verifiedpermissions/types/types.go index a04f33e4e5f..72783fd618f 100644 --- a/service/verifiedpermissions/types/types.go +++ b/service/verifiedpermissions/types/types.go @@ -43,7 +43,9 @@ type ActionIdentifier struct { // The following types satisfy this interface: // // AttributeValueMemberBoolean +// AttributeValueMemberDecimal // AttributeValueMemberEntityIdentifier +// AttributeValueMemberIpaddr // AttributeValueMemberLong // AttributeValueMemberRecord // AttributeValueMemberSet @@ -70,6 +72,19 @@ type AttributeValueMemberBoolean struct { func (*AttributeValueMemberBoolean) isAttributeValue() {} +// An attribute value of [decimal] type. +// +// Example: {"decimal": "1.1"} +// +// [decimal]: https://docs.cedarpolicy.com/policies/syntax-datatypes.html#datatype-decimal +type AttributeValueMemberDecimal struct { + Value string + + noSmithyDocumentSerde +} + +func (*AttributeValueMemberDecimal) isAttributeValue() {} + // An attribute value of type [EntityIdentifier]. // // Example: "entityIdentifier": { "entityId": "", "entityType": " 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchGetPolicyInputList(v []types.BatchGetPolicyInputItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetPolicyInputList"} + for i := range v { + if err := validateBatchGetPolicyInputItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateBatchIsAuthorizedInputItem(v *types.BatchIsAuthorizedInputItem) error { if v == nil { return nil @@ -1291,6 +1350,25 @@ func validateValidationSettings(v *types.ValidationSettings) error { } } +func validateOpBatchGetPolicyInput(v *BatchGetPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetPolicyInput"} + if v.Requests == nil { + invalidParams.Add(smithy.NewErrParamRequired("Requests")) + } else if v.Requests != nil { + if err := validateBatchGetPolicyInputList(v.Requests); err != nil { + invalidParams.AddNested("Requests", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpBatchIsAuthorizedInput(v *BatchIsAuthorizedInput) error { if v == nil { return nil