From 262bba071d8b437ef547f7009f5a8d97e12f38d7 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Tue, 4 Oct 2022 18:17:59 +0000 Subject: [PATCH] Regenerated Clients --- .../06705787df21488d95123bbd838bc7d1.json | 8 + .../137516a5255348259d9eb91abfe61d1e.json | 8 + .../2f459a6bfbad4942b771264fd688501a.json | 8 + .../41575353444b40ffbf474f4155544f00.json | 8 + .../7dd08d8b56f94edea94f719bb638ea10.json | 8 + .../94699c91849449949796640b8cf01b28.json | 8 + .../d6d470d3d7ec405a8903bdc6a3d26394.json | 8 + service/connect/types/enums.go | 2 + service/connectcases/LICENSE.txt | 202 + service/connectcases/api_client.go | 453 ++ service/connectcases/api_client_test.go | 123 + service/connectcases/api_op_BatchGetField.go | 133 + .../api_op_BatchPutFieldOptions.go | 132 + service/connectcases/api_op_CreateCase.go | 182 + service/connectcases/api_op_CreateDomain.go | 139 + service/connectcases/api_op_CreateField.go | 144 + service/connectcases/api_op_CreateLayout.go | 148 + .../connectcases/api_op_CreateRelatedItem.go | 147 + service/connectcases/api_op_CreateTemplate.go | 147 + service/connectcases/api_op_GetCase.go | 228 + .../api_op_GetCaseEventConfiguration.go | 124 + service/connectcases/api_op_GetDomain.go | 148 + service/connectcases/api_op_GetLayout.go | 148 + service/connectcases/api_op_GetTemplate.go | 152 + .../api_op_ListCasesForContact.go | 231 + service/connectcases/api_op_ListDomains.go | 217 + .../connectcases/api_op_ListFieldOptions.go | 233 + service/connectcases/api_op_ListFields.go | 224 + service/connectcases/api_op_ListLayouts.go | 225 + .../api_op_ListTagsForResource.go | 121 + service/connectcases/api_op_ListTemplates.go | 225 + .../api_op_PutCaseEventConfiguration.go | 123 + service/connectcases/api_op_SearchCases.go | 241 + .../connectcases/api_op_SearchRelatedItems.go | 235 + service/connectcases/api_op_TagResource.go | 122 + service/connectcases/api_op_UntagResource.go | 121 + service/connectcases/api_op_UpdateCase.go | 130 + service/connectcases/api_op_UpdateField.go | 127 + service/connectcases/api_op_UpdateLayout.go | 133 + service/connectcases/api_op_UpdateTemplate.go | 138 + service/connectcases/deserializers.go | 7220 +++++++++++++++++ service/connectcases/doc.go | 13 + service/connectcases/endpoints.go | 200 + service/connectcases/generated.json | 57 + service/connectcases/go.mod | 16 + service/connectcases/go.sum | 11 + service/connectcases/go_module_metadata.go | 6 + .../internal/endpoints/endpoints.go | 258 + .../internal/endpoints/endpoints_test.go | 11 + service/connectcases/protocol_test.go | 3 + service/connectcases/serializers.go | 3042 +++++++ service/connectcases/types/enums.go | 117 + service/connectcases/types/errors.go | 154 + service/connectcases/types/types.go | 788 ++ .../connectcases/types/types_exported_test.go | 195 + service/connectcases/validators.go | 1806 +++++ service/ec2/api_op_DescribeVpcAttribute.go | 3 + service/ec2/api_op_ModifyVpcAttribute.go | 3 + service/ec2/deserializers.go | 6 + service/ec2/serializers.go | 7 + service/ec2/types/enums.go | 6 +- .../ecs/api_op_PutAccountSettingDefault.go | 7 +- service/ecs/api_op_RegisterTaskDefinition.go | 2 - service/ecs/types/types.go | 18 +- service/s3control/types/enums.go | 16 +- .../api_op_AssumeImpersonationRole.go | 129 + service/workmail/api_op_CreateAlias.go | 2 +- .../api_op_CreateAvailabilityConfiguration.go | 2 +- service/workmail/api_op_CreateGroup.go | 4 +- .../api_op_CreateImpersonationRole.go | 183 + .../api_op_CreateMobileDeviceAccessRule.go | 5 +- service/workmail/api_op_CreateOrganization.go | 35 +- service/workmail/api_op_CreateResource.go | 2 +- service/workmail/api_op_CreateUser.go | 4 +- .../api_op_DeleteAvailabilityConfiguration.go | 2 +- service/workmail/api_op_DeleteGroup.go | 2 +- .../api_op_DeleteImpersonationRole.go | 121 + ...api_op_DeleteMobileDeviceAccessOverride.go | 2 +- .../api_op_DeleteMobileDeviceAccessRule.go | 10 +- service/workmail/api_op_DeleteOrganization.go | 8 +- service/workmail/api_op_DeleteUser.go | 9 +- .../workmail/api_op_DeregisterFromWorkMail.go | 7 +- .../workmail/api_op_DeregisterMailDomain.go | 8 +- service/workmail/api_op_DescribeGroup.go | 2 +- .../workmail/api_op_DescribeOrganization.go | 3 +- service/workmail/api_op_DescribeResource.go | 2 +- service/workmail/api_op_DescribeUser.go | 14 +- .../workmail/api_op_GetAccessControlEffect.go | 9 +- .../workmail/api_op_GetImpersonationRole.go | 145 + .../api_op_GetImpersonationRoleEffect.go | 148 + service/workmail/api_op_GetMailDomain.go | 10 +- .../api_op_GetMobileDeviceAccessEffect.go | 8 +- .../api_op_GetMobileDeviceAccessOverride.go | 2 +- .../api_op_ListAvailabilityConfigurations.go | 8 +- .../workmail/api_op_ListImpersonationRoles.go | 224 + service/workmail/api_op_ListMailDomains.go | 8 +- .../api_op_ListMobileDeviceAccessOverrides.go | 7 +- .../api_op_ListMobileDeviceAccessRules.go | 9 +- .../workmail/api_op_ListTagsForResource.go | 2 +- .../workmail/api_op_PutAccessControlRule.go | 10 +- .../api_op_PutMobileDeviceAccessOverride.go | 2 +- service/workmail/api_op_RegisterMailDomain.go | 6 +- service/workmail/api_op_RegisterToWorkMail.go | 10 +- .../workmail/api_op_StartMailboxExportJob.go | 2 +- service/workmail/api_op_TagResource.go | 3 +- .../api_op_TestAvailabilityConfiguration.go | 2 +- service/workmail/api_op_UntagResource.go | 3 +- .../api_op_UpdateAvailabilityConfiguration.go | 2 +- .../api_op_UpdateDefaultMailDomain.go | 2 +- .../api_op_UpdateImpersonationRole.go | 140 + .../api_op_UpdateMobileDeviceAccessRule.go | 5 +- service/workmail/deserializers.go | 2941 +++++-- service/workmail/doc.go | 2 +- service/workmail/generated.json | 7 + service/workmail/serializers.go | 671 +- service/workmail/types/enums.go | 36 + service/workmail/types/errors.go | 10 +- service/workmail/types/types.go | 100 +- service/workmail/validators.go | 355 +- 119 files changed, 24234 insertions(+), 830 deletions(-) create mode 100644 .changelog/06705787df21488d95123bbd838bc7d1.json create mode 100644 .changelog/137516a5255348259d9eb91abfe61d1e.json create mode 100644 .changelog/2f459a6bfbad4942b771264fd688501a.json create mode 100644 .changelog/41575353444b40ffbf474f4155544f00.json create mode 100644 .changelog/7dd08d8b56f94edea94f719bb638ea10.json create mode 100644 .changelog/94699c91849449949796640b8cf01b28.json create mode 100644 .changelog/d6d470d3d7ec405a8903bdc6a3d26394.json create mode 100644 service/connectcases/LICENSE.txt create mode 100644 service/connectcases/api_client.go create mode 100644 service/connectcases/api_client_test.go create mode 100644 service/connectcases/api_op_BatchGetField.go create mode 100644 service/connectcases/api_op_BatchPutFieldOptions.go create mode 100644 service/connectcases/api_op_CreateCase.go create mode 100644 service/connectcases/api_op_CreateDomain.go create mode 100644 service/connectcases/api_op_CreateField.go create mode 100644 service/connectcases/api_op_CreateLayout.go create mode 100644 service/connectcases/api_op_CreateRelatedItem.go create mode 100644 service/connectcases/api_op_CreateTemplate.go create mode 100644 service/connectcases/api_op_GetCase.go create mode 100644 service/connectcases/api_op_GetCaseEventConfiguration.go create mode 100644 service/connectcases/api_op_GetDomain.go create mode 100644 service/connectcases/api_op_GetLayout.go create mode 100644 service/connectcases/api_op_GetTemplate.go create mode 100644 service/connectcases/api_op_ListCasesForContact.go create mode 100644 service/connectcases/api_op_ListDomains.go create mode 100644 service/connectcases/api_op_ListFieldOptions.go create mode 100644 service/connectcases/api_op_ListFields.go create mode 100644 service/connectcases/api_op_ListLayouts.go create mode 100644 service/connectcases/api_op_ListTagsForResource.go create mode 100644 service/connectcases/api_op_ListTemplates.go create mode 100644 service/connectcases/api_op_PutCaseEventConfiguration.go create mode 100644 service/connectcases/api_op_SearchCases.go create mode 100644 service/connectcases/api_op_SearchRelatedItems.go create mode 100644 service/connectcases/api_op_TagResource.go create mode 100644 service/connectcases/api_op_UntagResource.go create mode 100644 service/connectcases/api_op_UpdateCase.go create mode 100644 service/connectcases/api_op_UpdateField.go create mode 100644 service/connectcases/api_op_UpdateLayout.go create mode 100644 service/connectcases/api_op_UpdateTemplate.go create mode 100644 service/connectcases/deserializers.go create mode 100644 service/connectcases/doc.go create mode 100644 service/connectcases/endpoints.go create mode 100644 service/connectcases/generated.json create mode 100644 service/connectcases/go.mod create mode 100644 service/connectcases/go.sum create mode 100644 service/connectcases/go_module_metadata.go create mode 100644 service/connectcases/internal/endpoints/endpoints.go create mode 100644 service/connectcases/internal/endpoints/endpoints_test.go create mode 100644 service/connectcases/protocol_test.go create mode 100644 service/connectcases/serializers.go create mode 100644 service/connectcases/types/enums.go create mode 100644 service/connectcases/types/errors.go create mode 100644 service/connectcases/types/types.go create mode 100644 service/connectcases/types/types_exported_test.go create mode 100644 service/connectcases/validators.go create mode 100644 service/workmail/api_op_AssumeImpersonationRole.go create mode 100644 service/workmail/api_op_CreateImpersonationRole.go create mode 100644 service/workmail/api_op_DeleteImpersonationRole.go create mode 100644 service/workmail/api_op_GetImpersonationRole.go create mode 100644 service/workmail/api_op_GetImpersonationRoleEffect.go create mode 100644 service/workmail/api_op_ListImpersonationRoles.go create mode 100644 service/workmail/api_op_UpdateImpersonationRole.go diff --git a/.changelog/06705787df21488d95123bbd838bc7d1.json b/.changelog/06705787df21488d95123bbd838bc7d1.json new file mode 100644 index 00000000000..4b6fc62af73 --- /dev/null +++ b/.changelog/06705787df21488d95123bbd838bc7d1.json @@ -0,0 +1,8 @@ +{ + "id": "06705787-df21-488d-9512-3bbd838bc7d1", + "type": "documentation", + "description": "Documentation updates to address various Amazon ECS tickets.", + "modules": [ + "service/ecs" + ] +} \ No newline at end of file diff --git a/.changelog/137516a5255348259d9eb91abfe61d1e.json b/.changelog/137516a5255348259d9eb91abfe61d1e.json new file mode 100644 index 00000000000..c99aa27fe3b --- /dev/null +++ b/.changelog/137516a5255348259d9eb91abfe61d1e.json @@ -0,0 +1,8 @@ +{ + "id": "137516a5-2553-4825-9d9e-b91abfe61d1e", + "type": "feature", + "description": "This release adds support for impersonation roles in Amazon WorkMail.", + "modules": [ + "service/workmail" + ] +} \ No newline at end of file diff --git a/.changelog/2f459a6bfbad4942b771264fd688501a.json b/.changelog/2f459a6bfbad4942b771264fd688501a.json new file mode 100644 index 00000000000..bb0ff79b875 --- /dev/null +++ b/.changelog/2f459a6bfbad4942b771264fd688501a.json @@ -0,0 +1,8 @@ +{ + "id": "2f459a6b-fbad-4942-b771-264fd688501a", + "type": "feature", + "description": "This release adds APIs for Amazon Connect Cases. Cases allows your agents to quickly track and manage customer issues that require multiple interactions, follow-up tasks, and teams in your contact center. For more information, see https://docs.aws.amazon.com/cases/latest/APIReference/Welcome.html", + "modules": [ + "service/connectcases" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..e8fee2f2eaa --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/connectcases" + ] +} \ No newline at end of file diff --git a/.changelog/7dd08d8b56f94edea94f719bb638ea10.json b/.changelog/7dd08d8b56f94edea94f719bb638ea10.json new file mode 100644 index 00000000000..8b891ad45ae --- /dev/null +++ b/.changelog/7dd08d8b56f94edea94f719bb638ea10.json @@ -0,0 +1,8 @@ +{ + "id": "7dd08d8b-56f9-4ede-a94f-719bb638ea10", + "type": "feature", + "description": "Added EnableNetworkAddressUsageMetrics flag for ModifyVpcAttribute, DescribeVpcAttribute APIs.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/94699c91849449949796640b8cf01b28.json b/.changelog/94699c91849449949796640b8cf01b28.json new file mode 100644 index 00000000000..f54e3b3d2d8 --- /dev/null +++ b/.changelog/94699c91849449949796640b8cf01b28.json @@ -0,0 +1,8 @@ +{ + "id": "94699c91-8494-4994-9796-640b8cf01b28", + "type": "feature", + "description": "S3 Object Lambda adds support to allow customers to intercept HeadObject and ListObjects requests and introduce their own compute. These requests were previously proxied to S3.", + "modules": [ + "service/s3control" + ] +} \ No newline at end of file diff --git a/.changelog/d6d470d3d7ec405a8903bdc6a3d26394.json b/.changelog/d6d470d3d7ec405a8903bdc6a3d26394.json new file mode 100644 index 00000000000..ec3eb4f27d4 --- /dev/null +++ b/.changelog/d6d470d3d7ec405a8903bdc6a3d26394.json @@ -0,0 +1,8 @@ +{ + "id": "d6d470d3-d7ec-405a-8903-bdc6a3d26394", + "type": "feature", + "description": "Updated the CreateIntegrationAssociation API to support the CASES_DOMAIN IntegrationType.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index a893d43d942..355e9f6007f 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -513,6 +513,7 @@ const ( IntegrationTypePinpointApp IntegrationType = "PINPOINT_APP" IntegrationTypeWisdomAssistant IntegrationType = "WISDOM_ASSISTANT" IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" + IntegrationTypeCasesDomain IntegrationType = "CASES_DOMAIN" ) // Values returns all known values for IntegrationType. Note that this can be @@ -525,6 +526,7 @@ func (IntegrationType) Values() []IntegrationType { "PINPOINT_APP", "WISDOM_ASSISTANT", "WISDOM_KNOWLEDGE_BASE", + "CASES_DOMAIN", } } diff --git a/service/connectcases/LICENSE.txt b/service/connectcases/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/connectcases/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/connectcases/api_client.go b/service/connectcases/api_client.go new file mode 100644 index 00000000000..81ae0d7f8e5 --- /dev/null +++ b/service/connectcases/api_client.go @@ -0,0 +1,453 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "ConnectCases" +const ServiceAPIVersion = "2022-10-03" + +// Client provides the API client to make operations call for Amazon Connect Cases. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "connectcases", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/connectcases/api_client_test.go b/service/connectcases/api_client_test.go new file mode 100644 index 00000000000..76a439a00f3 --- /dev/null +++ b/service/connectcases/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/connectcases/api_op_BatchGetField.go b/service/connectcases/api_op_BatchGetField.go new file mode 100644 index 00000000000..785de7ba5ba --- /dev/null +++ b/service/connectcases/api_op_BatchGetField.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the description for the list of fields in the request parameters. +func (c *Client) BatchGetField(ctx context.Context, params *BatchGetFieldInput, optFns ...func(*Options)) (*BatchGetFieldOutput, error) { + if params == nil { + params = &BatchGetFieldInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetField", params, optFns, c.addOperationBatchGetFieldMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetFieldOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetFieldInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // A list of unique field identifiers. + // + // This member is required. + Fields []types.FieldIdentifier + + noSmithyDocumentSerde +} + +type BatchGetFieldOutput struct { + + // A list of field errors. + // + // This member is required. + Errors []types.FieldError + + // A list of detailed field information. + // + // This member is required. + Fields []types.GetFieldResponse + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetFieldMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetField{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetField{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchGetFieldValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetField(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchGetField(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "BatchGetField", + } +} diff --git a/service/connectcases/api_op_BatchPutFieldOptions.go b/service/connectcases/api_op_BatchPutFieldOptions.go new file mode 100644 index 00000000000..a9218349fec --- /dev/null +++ b/service/connectcases/api_op_BatchPutFieldOptions.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and updates a set of field options for a single select field in a Cases +// domain. +func (c *Client) BatchPutFieldOptions(ctx context.Context, params *BatchPutFieldOptionsInput, optFns ...func(*Options)) (*BatchPutFieldOptionsOutput, error) { + if params == nil { + params = &BatchPutFieldOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchPutFieldOptions", params, optFns, c.addOperationBatchPutFieldOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchPutFieldOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchPutFieldOptionsInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The unique identifier of a field. + // + // This member is required. + FieldId *string + + // A list of FieldOption objects. + // + // This member is required. + Options []types.FieldOption + + noSmithyDocumentSerde +} + +type BatchPutFieldOptionsOutput struct { + + // A list of field errors. + Errors []types.FieldOptionError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchPutFieldOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchPutFieldOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchPutFieldOptions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchPutFieldOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchPutFieldOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchPutFieldOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "BatchPutFieldOptions", + } +} diff --git a/service/connectcases/api_op_CreateCase.go b/service/connectcases/api_op_CreateCase.go new file mode 100644 index 00000000000..26b1877e327 --- /dev/null +++ b/service/connectcases/api_op_CreateCase.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a case in the specified Cases domain. Case system and custom fields are +// taken as an array id/value pairs with a declared data types. customer_id is a +// required field when creating a case. +func (c *Client) CreateCase(ctx context.Context, params *CreateCaseInput, optFns ...func(*Options)) (*CreateCaseOutput, error) { + if params == nil { + params = &CreateCaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCase", params, optFns, c.addOperationCreateCaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateCaseInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // An array of objects with field ID (matching ListFields/DescribeField) and value + // union data. + // + // This member is required. + Fields []types.FieldValue + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateCaseOutput struct { + + // The Amazon Resource Name (ARN) of the case. + // + // This member is required. + CaseArn *string + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateCaseMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateCaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateCase struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateCase) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateCaseInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateCaseInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateCaseMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateCase{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateCase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateCase", + } +} diff --git a/service/connectcases/api_op_CreateDomain.go b/service/connectcases/api_op_CreateDomain.go new file mode 100644 index 00000000000..fd3363a4e0a --- /dev/null +++ b/service/connectcases/api_op_CreateDomain.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a domain, which is a container for all case data, such as cases, fields, +// templates and layouts. Each Amazon Connect instance can be associated with only +// one Cases domain. This will not associate your connect instance to Cases domain. +// Instead, use the Amazon Connect CreateIntegrationAssociation +// (https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateIntegrationAssociation.html) +// API. +func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, optFns ...func(*Options)) (*CreateDomainOutput, error) { + if params == nil { + params = &CreateDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDomain", params, optFns, c.addOperationCreateDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDomainInput struct { + + // The name for your Cases domain. It must be unique for your Amazon Web Services + // account. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type CreateDomainOutput struct { + + // The Amazon Resource Name (ARN) for the Cases domain. + // + // This member is required. + DomainArn *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The status of the domain. + // + // This member is required. + DomainStatus types.DomainStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateDomain", + } +} diff --git a/service/connectcases/api_op_CreateField.go b/service/connectcases/api_op_CreateField.go new file mode 100644 index 00000000000..2b726f1f669 --- /dev/null +++ b/service/connectcases/api_op_CreateField.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a field in the Cases domain. This field is used to define the case +// object model (that is, defines what data can be captured on cases) in a Cases +// domain. +func (c *Client) CreateField(ctx context.Context, params *CreateFieldInput, optFns ...func(*Options)) (*CreateFieldOutput, error) { + if params == nil { + params = &CreateFieldInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateField", params, optFns, c.addOperationCreateFieldMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFieldOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFieldInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The name of the field. + // + // This member is required. + Name *string + + // Defines the data type, some system constraints, and default display of the + // field. + // + // This member is required. + Type types.FieldType + + // The description of the field. + Description *string + + noSmithyDocumentSerde +} + +type CreateFieldOutput struct { + + // The Amazon Resource Name (ARN) of the field. + // + // This member is required. + FieldArn *string + + // The unique identifier of a field. + // + // This member is required. + FieldId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFieldMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateField{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateField{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateFieldValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateField(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateField(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateField", + } +} diff --git a/service/connectcases/api_op_CreateLayout.go b/service/connectcases/api_op_CreateLayout.go new file mode 100644 index 00000000000..8f1a44794f3 --- /dev/null +++ b/service/connectcases/api_op_CreateLayout.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a layout in the Cases domain. Layouts define the following configuration +// in the top section and More Info tab of the Cases user interface: +// +// * Fields to +// display to the users +// +// * Field ordering +// +// Title and Status fields cannot be part +// of layouts since they are not configurable. +func (c *Client) CreateLayout(ctx context.Context, params *CreateLayoutInput, optFns ...func(*Options)) (*CreateLayoutOutput, error) { + if params == nil { + params = &CreateLayoutInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateLayout", params, optFns, c.addOperationCreateLayoutMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateLayoutOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateLayoutInput struct { + + // Information about which fields will be present in the layout, and information + // about the order of the fields. + // + // This member is required. + Content types.LayoutContent + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The name of the layout. It must be unique for the Cases domain. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type CreateLayoutOutput struct { + + // The Amazon Resource Name (ARN) of the newly created layout. + // + // This member is required. + LayoutArn *string + + // The unique identifier of the layout. + // + // This member is required. + LayoutId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateLayoutMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLayout{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLayout{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateLayoutValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLayout(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateLayout(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateLayout", + } +} diff --git a/service/connectcases/api_op_CreateRelatedItem.go b/service/connectcases/api_op_CreateRelatedItem.go new file mode 100644 index 00000000000..19d4d3a35b2 --- /dev/null +++ b/service/connectcases/api_op_CreateRelatedItem.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a related item (comments, tasks, and contacts) and associates it with a +// case. A Related Item is a resource that is associated with a case. It may or may +// not have an external identifier linking it to an external resource (for example, +// a contactArn). All Related Items have their own internal identifier, the +// relatedItemArn. Examples of related items include comments and contacts. +func (c *Client) CreateRelatedItem(ctx context.Context, params *CreateRelatedItemInput, optFns ...func(*Options)) (*CreateRelatedItemOutput, error) { + if params == nil { + params = &CreateRelatedItemInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRelatedItem", params, optFns, c.addOperationCreateRelatedItemMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRelatedItemOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRelatedItemInput struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // The content of a related item to be created. + // + // This member is required. + Content types.RelatedItemInputContent + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The type of a related item. + // + // This member is required. + Type types.RelatedItemType + + noSmithyDocumentSerde +} + +type CreateRelatedItemOutput struct { + + // The Amazon Resource Name (ARN) of the related item. + // + // This member is required. + RelatedItemArn *string + + // The unique identifier of the related item. + // + // This member is required. + RelatedItemId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRelatedItem{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRelatedItem{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRelatedItemValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRelatedItem(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateRelatedItem", + } +} diff --git a/service/connectcases/api_op_CreateTemplate.go b/service/connectcases/api_op_CreateTemplate.go new file mode 100644 index 00000000000..688e1348a19 --- /dev/null +++ b/service/connectcases/api_op_CreateTemplate.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a template in the Cases domain. This template is used to define the case +// object model (that is, define what data can be captured on cases) in a Cases +// domain. A template must have a unique name within a domain, and it must +// reference existing field IDs and layout IDs. Additionally, multiple fields with +// same IDs are not allowed within the same Template. +func (c *Client) CreateTemplate(ctx context.Context, params *CreateTemplateInput, optFns ...func(*Options)) (*CreateTemplateOutput, error) { + if params == nil { + params = &CreateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTemplate", params, optFns, c.addOperationCreateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTemplateInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // A name for the template. It must be unique per domain. + // + // This member is required. + Name *string + + // A brief description of the template. + Description *string + + // Configuration of layouts associated to the template. + LayoutConfiguration *types.LayoutConfiguration + + // A list of fields that must contain a value for a case to be successfully created + // with this template. + RequiredFields []types.RequiredField + + noSmithyDocumentSerde +} + +type CreateTemplateOutput struct { + + // The Amazon Resource Name (ARN) of the newly created template. + // + // This member is required. + TemplateArn *string + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "CreateTemplate", + } +} diff --git a/service/connectcases/api_op_GetCase.go b/service/connectcases/api_op_GetCase.go new file mode 100644 index 00000000000..7e719e7242d --- /dev/null +++ b/service/connectcases/api_op_GetCase.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a specific case if it exists. +func (c *Client) GetCase(ctx context.Context, params *GetCaseInput, optFns ...func(*Options)) (*GetCaseOutput, error) { + if params == nil { + params = &GetCaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCase", params, optFns, c.addOperationGetCaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCaseInput struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // A list of unique field identifiers. + // + // This member is required. + Fields []types.FieldIdentifier + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type GetCaseOutput struct { + + // A list of detailed field information. + // + // This member is required. + Fields []types.FieldValue + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetCaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// GetCaseAPIClient is a client that implements the GetCase operation. +type GetCaseAPIClient interface { + GetCase(context.Context, *GetCaseInput, ...func(*Options)) (*GetCaseOutput, error) +} + +var _ GetCaseAPIClient = (*Client)(nil) + +// GetCasePaginatorOptions is the paginator options for GetCase +type GetCasePaginatorOptions struct { + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetCasePaginator is a paginator for GetCase +type GetCasePaginator struct { + options GetCasePaginatorOptions + client GetCaseAPIClient + params *GetCaseInput + nextToken *string + firstPage bool +} + +// NewGetCasePaginator returns a new GetCasePaginator +func NewGetCasePaginator(client GetCaseAPIClient, params *GetCaseInput, optFns ...func(*GetCasePaginatorOptions)) *GetCasePaginator { + if params == nil { + params = &GetCaseInput{} + } + + options := GetCasePaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &GetCasePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCasePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetCase page. +func (p *GetCasePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCaseOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + result, err := p.client.GetCase(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opGetCase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "GetCase", + } +} diff --git a/service/connectcases/api_op_GetCaseEventConfiguration.go b/service/connectcases/api_op_GetCaseEventConfiguration.go new file mode 100644 index 00000000000..22d2869f439 --- /dev/null +++ b/service/connectcases/api_op_GetCaseEventConfiguration.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the case event publishing configuration. +func (c *Client) GetCaseEventConfiguration(ctx context.Context, params *GetCaseEventConfigurationInput, optFns ...func(*Options)) (*GetCaseEventConfigurationOutput, error) { + if params == nil { + params = &GetCaseEventConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCaseEventConfiguration", params, optFns, c.addOperationGetCaseEventConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCaseEventConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCaseEventConfigurationInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + noSmithyDocumentSerde +} + +type GetCaseEventConfigurationOutput struct { + + // Configuration to enable EventBridge case event delivery and determine what data + // is delivered. + // + // This member is required. + EventBridge *types.EventBridgeConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCaseEventConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCaseEventConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCaseEventConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetCaseEventConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCaseEventConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCaseEventConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "GetCaseEventConfiguration", + } +} diff --git a/service/connectcases/api_op_GetDomain.go b/service/connectcases/api_op_GetDomain.go new file mode 100644 index 00000000000..ba67551d3a7 --- /dev/null +++ b/service/connectcases/api_op_GetDomain.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns information about a specific domain if it exists. +func (c *Client) GetDomain(ctx context.Context, params *GetDomainInput, optFns ...func(*Options)) (*GetDomainOutput, error) { + if params == nil { + params = &GetDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDomain", params, optFns, c.addOperationGetDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDomainInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + noSmithyDocumentSerde +} + +type GetDomainOutput struct { + + // The timestamp when the Cases domain was created. + // + // This member is required. + CreatedTime *time.Time + + // The Amazon Resource Name (ARN) for the Cases domain. + // + // This member is required. + DomainArn *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The status of the Cases domain. + // + // This member is required. + DomainStatus types.DomainStatus + + // The name of the Cases domain. + // + // This member is required. + Name *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "GetDomain", + } +} diff --git a/service/connectcases/api_op_GetLayout.go b/service/connectcases/api_op_GetLayout.go new file mode 100644 index 00000000000..fe1ca46f10a --- /dev/null +++ b/service/connectcases/api_op_GetLayout.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details for the requested layout. +func (c *Client) GetLayout(ctx context.Context, params *GetLayoutInput, optFns ...func(*Options)) (*GetLayoutOutput, error) { + if params == nil { + params = &GetLayoutInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLayout", params, optFns, c.addOperationGetLayoutMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLayoutOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLayoutInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The unique identifier of the layout. + // + // This member is required. + LayoutId *string + + noSmithyDocumentSerde +} + +type GetLayoutOutput struct { + + // Information about which fields will be present in the layout, the order of the + // fields, and read-only attribute of the field. + // + // This member is required. + Content types.LayoutContent + + // The Amazon Resource Name (ARN) of the newly created layout. + // + // This member is required. + LayoutArn *string + + // The unique identifier of the layout. + // + // This member is required. + LayoutId *string + + // The name of the layout. It must be unique. + // + // This member is required. + Name *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetLayoutMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLayout{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLayout{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetLayoutValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLayout(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetLayout(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "GetLayout", + } +} diff --git a/service/connectcases/api_op_GetTemplate.go b/service/connectcases/api_op_GetTemplate.go new file mode 100644 index 00000000000..5c7c8172530 --- /dev/null +++ b/service/connectcases/api_op_GetTemplate.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the details for the requested template. +func (c *Client) GetTemplate(ctx context.Context, params *GetTemplateInput, optFns ...func(*Options)) (*GetTemplateOutput, error) { + if params == nil { + params = &GetTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTemplate", params, optFns, c.addOperationGetTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTemplateInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + noSmithyDocumentSerde +} + +type GetTemplateOutput struct { + + // The name of the template. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the template. + // + // This member is required. + TemplateArn *string + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + // A brief description of the template. + Description *string + + // Configuration of layouts associated to the template. + LayoutConfiguration *types.LayoutConfiguration + + // A list of fields that must contain a value for a case to be successfully created + // with this template. + RequiredFields []types.RequiredField + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "GetTemplate", + } +} diff --git a/service/connectcases/api_op_ListCasesForContact.go b/service/connectcases/api_op_ListCasesForContact.go new file mode 100644 index 00000000000..5856a46927f --- /dev/null +++ b/service/connectcases/api_op_ListCasesForContact.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists cases for a given contact. +func (c *Client) ListCasesForContact(ctx context.Context, params *ListCasesForContactInput, optFns ...func(*Options)) (*ListCasesForContactOutput, error) { + if params == nil { + params = &ListCasesForContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCasesForContact", params, optFns, c.addOperationListCasesForContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCasesForContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCasesForContactInput struct { + + // A unique identifier of a contact in Amazon Connect. + // + // This member is required. + ContactArn *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListCasesForContactOutput struct { + + // A list of Case summary information. + // + // This member is required. + Cases []types.CaseSummary + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCasesForContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCasesForContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCasesForContact{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListCasesForContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCasesForContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListCasesForContactAPIClient is a client that implements the ListCasesForContact +// operation. +type ListCasesForContactAPIClient interface { + ListCasesForContact(context.Context, *ListCasesForContactInput, ...func(*Options)) (*ListCasesForContactOutput, error) +} + +var _ ListCasesForContactAPIClient = (*Client)(nil) + +// ListCasesForContactPaginatorOptions is the paginator options for +// ListCasesForContact +type ListCasesForContactPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListCasesForContactPaginator is a paginator for ListCasesForContact +type ListCasesForContactPaginator struct { + options ListCasesForContactPaginatorOptions + client ListCasesForContactAPIClient + params *ListCasesForContactInput + nextToken *string + firstPage bool +} + +// NewListCasesForContactPaginator returns a new ListCasesForContactPaginator +func NewListCasesForContactPaginator(client ListCasesForContactAPIClient, params *ListCasesForContactInput, optFns ...func(*ListCasesForContactPaginatorOptions)) *ListCasesForContactPaginator { + if params == nil { + params = &ListCasesForContactInput{} + } + + options := ListCasesForContactPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCasesForContactPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCasesForContactPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCasesForContact page. +func (p *ListCasesForContactPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCasesForContactOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListCasesForContact(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListCasesForContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListCasesForContact", + } +} diff --git a/service/connectcases/api_op_ListDomains.go b/service/connectcases/api_op_ListDomains.go new file mode 100644 index 00000000000..9aac0003e5f --- /dev/null +++ b/service/connectcases/api_op_ListDomains.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all cases domains in the Amazon Web Services account. Each list item is a +// condensed summary object of the domain. +func (c *Client) ListDomains(ctx context.Context, params *ListDomainsInput, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if params == nil { + params = &ListDomainsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDomains", params, optFns, c.addOperationListDomainsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDomainsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDomainsInput struct { + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDomainsOutput struct { + + // The Cases domain. + // + // This member is required. + Domains []types.DomainSummary + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDomains(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListDomainsPaginator is a paginator for ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + if params == nil { + params = &ListDomainsInput{} + } + + options := ListDomainsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListDomains", + } +} diff --git a/service/connectcases/api_op_ListFieldOptions.go b/service/connectcases/api_op_ListFieldOptions.go new file mode 100644 index 00000000000..70fb86f4c19 --- /dev/null +++ b/service/connectcases/api_op_ListFieldOptions.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the field options for a field identifier in the domain. +func (c *Client) ListFieldOptions(ctx context.Context, params *ListFieldOptionsInput, optFns ...func(*Options)) (*ListFieldOptionsOutput, error) { + if params == nil { + params = &ListFieldOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFieldOptions", params, optFns, c.addOperationListFieldOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFieldOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFieldOptionsInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The unique identifier of a field. + // + // This member is required. + FieldId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // A list of FieldOption values to filter on for ListFieldOptions. + Values []string + + noSmithyDocumentSerde +} + +type ListFieldOptionsOutput struct { + + // A list of FieldOption objects. + // + // This member is required. + Options []types.FieldOption + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFieldOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFieldOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFieldOptions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListFieldOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFieldOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListFieldOptionsAPIClient is a client that implements the ListFieldOptions +// operation. +type ListFieldOptionsAPIClient interface { + ListFieldOptions(context.Context, *ListFieldOptionsInput, ...func(*Options)) (*ListFieldOptionsOutput, error) +} + +var _ ListFieldOptionsAPIClient = (*Client)(nil) + +// ListFieldOptionsPaginatorOptions is the paginator options for ListFieldOptions +type ListFieldOptionsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListFieldOptionsPaginator is a paginator for ListFieldOptions +type ListFieldOptionsPaginator struct { + options ListFieldOptionsPaginatorOptions + client ListFieldOptionsAPIClient + params *ListFieldOptionsInput + nextToken *string + firstPage bool +} + +// NewListFieldOptionsPaginator returns a new ListFieldOptionsPaginator +func NewListFieldOptionsPaginator(client ListFieldOptionsAPIClient, params *ListFieldOptionsInput, optFns ...func(*ListFieldOptionsPaginatorOptions)) *ListFieldOptionsPaginator { + if params == nil { + params = &ListFieldOptionsInput{} + } + + options := ListFieldOptionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFieldOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFieldOptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFieldOptions page. +func (p *ListFieldOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFieldOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListFieldOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListFieldOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListFieldOptions", + } +} diff --git a/service/connectcases/api_op_ListFields.go b/service/connectcases/api_op_ListFields.go new file mode 100644 index 00000000000..35c550cc05e --- /dev/null +++ b/service/connectcases/api_op_ListFields.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all fields in a Cases domain. +func (c *Client) ListFields(ctx context.Context, params *ListFieldsInput, optFns ...func(*Options)) (*ListFieldsOutput, error) { + if params == nil { + params = &ListFieldsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFields", params, optFns, c.addOperationListFieldsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFieldsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFieldsInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListFieldsOutput struct { + + // List of detailed field information. + // + // This member is required. + Fields []types.FieldSummary + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFieldsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFields{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFields{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListFieldsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFields(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListFieldsAPIClient is a client that implements the ListFields operation. +type ListFieldsAPIClient interface { + ListFields(context.Context, *ListFieldsInput, ...func(*Options)) (*ListFieldsOutput, error) +} + +var _ ListFieldsAPIClient = (*Client)(nil) + +// ListFieldsPaginatorOptions is the paginator options for ListFields +type ListFieldsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListFieldsPaginator is a paginator for ListFields +type ListFieldsPaginator struct { + options ListFieldsPaginatorOptions + client ListFieldsAPIClient + params *ListFieldsInput + nextToken *string + firstPage bool +} + +// NewListFieldsPaginator returns a new ListFieldsPaginator +func NewListFieldsPaginator(client ListFieldsAPIClient, params *ListFieldsInput, optFns ...func(*ListFieldsPaginatorOptions)) *ListFieldsPaginator { + if params == nil { + params = &ListFieldsInput{} + } + + options := ListFieldsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListFieldsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFieldsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListFields page. +func (p *ListFieldsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFieldsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListFields(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListFields(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListFields", + } +} diff --git a/service/connectcases/api_op_ListLayouts.go b/service/connectcases/api_op_ListLayouts.go new file mode 100644 index 00000000000..a95d9c2d33f --- /dev/null +++ b/service/connectcases/api_op_ListLayouts.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all layouts in the given cases domain. Each list item is a condensed +// summary object of the layout. +func (c *Client) ListLayouts(ctx context.Context, params *ListLayoutsInput, optFns ...func(*Options)) (*ListLayoutsOutput, error) { + if params == nil { + params = &ListLayoutsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLayouts", params, optFns, c.addOperationListLayoutsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLayoutsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLayoutsInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLayoutsOutput struct { + + // The layouts for the domain. + // + // This member is required. + Layouts []types.LayoutSummary + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLayoutsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLayouts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLayouts{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListLayoutsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLayouts(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListLayoutsAPIClient is a client that implements the ListLayouts operation. +type ListLayoutsAPIClient interface { + ListLayouts(context.Context, *ListLayoutsInput, ...func(*Options)) (*ListLayoutsOutput, error) +} + +var _ ListLayoutsAPIClient = (*Client)(nil) + +// ListLayoutsPaginatorOptions is the paginator options for ListLayouts +type ListLayoutsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListLayoutsPaginator is a paginator for ListLayouts +type ListLayoutsPaginator struct { + options ListLayoutsPaginatorOptions + client ListLayoutsAPIClient + params *ListLayoutsInput + nextToken *string + firstPage bool +} + +// NewListLayoutsPaginator returns a new ListLayoutsPaginator +func NewListLayoutsPaginator(client ListLayoutsAPIClient, params *ListLayoutsInput, optFns ...func(*ListLayoutsPaginatorOptions)) *ListLayoutsPaginator { + if params == nil { + params = &ListLayoutsInput{} + } + + options := ListLayoutsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLayoutsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLayoutsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLayouts page. +func (p *ListLayoutsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayoutsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListLayouts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListLayouts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListLayouts", + } +} diff --git a/service/connectcases/api_op_ListTagsForResource.go b/service/connectcases/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..60699eabc1b --- /dev/null +++ b/service/connectcases/api_op_ListTagsForResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists tags for a resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListTagsForResource", + } +} diff --git a/service/connectcases/api_op_ListTemplates.go b/service/connectcases/api_op_ListTemplates.go new file mode 100644 index 00000000000..e2d033ab6ae --- /dev/null +++ b/service/connectcases/api_op_ListTemplates.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the templates in a Cases domain. Each list item is a condensed +// summary object of the template. +func (c *Client) ListTemplates(ctx context.Context, params *ListTemplatesInput, optFns ...func(*Options)) (*ListTemplatesOutput, error) { + if params == nil { + params = &ListTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTemplates", params, optFns, c.addOperationListTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTemplatesInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListTemplatesOutput struct { + + // List of template summary objects. + // + // This member is required. + Templates []types.TemplateSummary + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTemplates{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTemplatesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListTemplatesAPIClient is a client that implements the ListTemplates operation. +type ListTemplatesAPIClient interface { + ListTemplates(context.Context, *ListTemplatesInput, ...func(*Options)) (*ListTemplatesOutput, error) +} + +var _ ListTemplatesAPIClient = (*Client)(nil) + +// ListTemplatesPaginatorOptions is the paginator options for ListTemplates +type ListTemplatesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListTemplatesPaginator is a paginator for ListTemplates +type ListTemplatesPaginator struct { + options ListTemplatesPaginatorOptions + client ListTemplatesAPIClient + params *ListTemplatesInput + nextToken *string + firstPage bool +} + +// NewListTemplatesPaginator returns a new ListTemplatesPaginator +func NewListTemplatesPaginator(client ListTemplatesAPIClient, params *ListTemplatesInput, optFns ...func(*ListTemplatesPaginatorOptions)) *ListTemplatesPaginator { + if params == nil { + params = &ListTemplatesInput{} + } + + options := ListTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListTemplates page. +func (p *ListTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "ListTemplates", + } +} diff --git a/service/connectcases/api_op_PutCaseEventConfiguration.go b/service/connectcases/api_op_PutCaseEventConfiguration.go new file mode 100644 index 00000000000..ce10f6e0fb0 --- /dev/null +++ b/service/connectcases/api_op_PutCaseEventConfiguration.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// API for adding case event publishing configuration +func (c *Client) PutCaseEventConfiguration(ctx context.Context, params *PutCaseEventConfigurationInput, optFns ...func(*Options)) (*PutCaseEventConfigurationOutput, error) { + if params == nil { + params = &PutCaseEventConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutCaseEventConfiguration", params, optFns, c.addOperationPutCaseEventConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutCaseEventConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutCaseEventConfigurationInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // Configuration to enable EventBridge case event delivery and determine what data + // is delivered. + // + // This member is required. + EventBridge *types.EventBridgeConfiguration + + noSmithyDocumentSerde +} + +type PutCaseEventConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutCaseEventConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutCaseEventConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutCaseEventConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutCaseEventConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutCaseEventConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutCaseEventConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "PutCaseEventConfiguration", + } +} diff --git a/service/connectcases/api_op_SearchCases.go b/service/connectcases/api_op_SearchCases.go new file mode 100644 index 00000000000..9b958e1f719 --- /dev/null +++ b/service/connectcases/api_op_SearchCases.go @@ -0,0 +1,241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for cases within their associated Cases domain. Search results are +// returned as a paginated list of abridged case documents. +func (c *Client) SearchCases(ctx context.Context, params *SearchCasesInput, optFns ...func(*Options)) (*SearchCasesOutput, error) { + if params == nil { + params = &SearchCasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchCases", params, optFns, c.addOperationSearchCasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchCasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchCasesInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The list of field identifiers to be returned as part of the response. + Fields []types.FieldIdentifier + + // A list of filter objects. + Filter types.CaseFilter + + // The maximum number of cases to return. The current maximum supported value is + // 25. This is also the default value when no other value is provided. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // A word or phrase used to perform a quick search. + SearchTerm *string + + // A list of sorts where each sort specifies a field and their sort order to be + // applied to the results. + Sorts []types.Sort + + noSmithyDocumentSerde +} + +type SearchCasesOutput struct { + + // A list of case documents where each case contains the properties CaseId and + // Fields where each field is a complex union structure. + // + // This member is required. + Cases []*types.SearchCasesResponseItem + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchCasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchCases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchCases{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchCasesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchCases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchCasesAPIClient is a client that implements the SearchCases operation. +type SearchCasesAPIClient interface { + SearchCases(context.Context, *SearchCasesInput, ...func(*Options)) (*SearchCasesOutput, error) +} + +var _ SearchCasesAPIClient = (*Client)(nil) + +// SearchCasesPaginatorOptions is the paginator options for SearchCases +type SearchCasesPaginatorOptions struct { + // The maximum number of cases to return. The current maximum supported value is + // 25. This is also the default value when no other value is provided. + 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 +} + +// SearchCasesPaginator is a paginator for SearchCases +type SearchCasesPaginator struct { + options SearchCasesPaginatorOptions + client SearchCasesAPIClient + params *SearchCasesInput + nextToken *string + firstPage bool +} + +// NewSearchCasesPaginator returns a new SearchCasesPaginator +func NewSearchCasesPaginator(client SearchCasesAPIClient, params *SearchCasesInput, optFns ...func(*SearchCasesPaginatorOptions)) *SearchCasesPaginator { + if params == nil { + params = &SearchCasesInput{} + } + + options := SearchCasesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchCasesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchCases page. +func (p *SearchCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchCases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "SearchCases", + } +} diff --git a/service/connectcases/api_op_SearchRelatedItems.go b/service/connectcases/api_op_SearchRelatedItems.go new file mode 100644 index 00000000000..1e64d47da27 --- /dev/null +++ b/service/connectcases/api_op_SearchRelatedItems.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for related items that are associated with a case. If no filters are +// provided, this returns all related items associated with a case. +func (c *Client) SearchRelatedItems(ctx context.Context, params *SearchRelatedItemsInput, optFns ...func(*Options)) (*SearchRelatedItemsOutput, error) { + if params == nil { + params = &SearchRelatedItemsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchRelatedItems", params, optFns, c.addOperationSearchRelatedItemsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchRelatedItemsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchRelatedItemsInput struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The list of types of related items and their parameters to use for filtering. + Filters []types.RelatedItemTypeFilter + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type SearchRelatedItemsOutput struct { + + // A list of items related to a case. + // + // This member is required. + RelatedItems []*types.SearchRelatedItemsResponseItem + + // The token for the next set of results. This is null if there are no more results + // to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchRelatedItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchRelatedItems{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchRelatedItems{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchRelatedItemsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchRelatedItems(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchRelatedItemsAPIClient is a client that implements the SearchRelatedItems +// operation. +type SearchRelatedItemsAPIClient interface { + SearchRelatedItems(context.Context, *SearchRelatedItemsInput, ...func(*Options)) (*SearchRelatedItemsOutput, error) +} + +var _ SearchRelatedItemsAPIClient = (*Client)(nil) + +// SearchRelatedItemsPaginatorOptions is the paginator options for +// SearchRelatedItems +type SearchRelatedItemsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// SearchRelatedItemsPaginator is a paginator for SearchRelatedItems +type SearchRelatedItemsPaginator struct { + options SearchRelatedItemsPaginatorOptions + client SearchRelatedItemsAPIClient + params *SearchRelatedItemsInput + nextToken *string + firstPage bool +} + +// NewSearchRelatedItemsPaginator returns a new SearchRelatedItemsPaginator +func NewSearchRelatedItemsPaginator(client SearchRelatedItemsAPIClient, params *SearchRelatedItemsInput, optFns ...func(*SearchRelatedItemsPaginatorOptions)) *SearchRelatedItemsPaginator { + if params == nil { + params = &SearchRelatedItemsInput{} + } + + options := SearchRelatedItemsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchRelatedItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchRelatedItemsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchRelatedItems page. +func (p *SearchRelatedItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchRelatedItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchRelatedItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchRelatedItems(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "SearchRelatedItems", + } +} diff --git a/service/connectcases/api_op_TagResource.go b/service/connectcases/api_op_TagResource.go new file mode 100644 index 00000000000..48e65dbd953 --- /dev/null +++ b/service/connectcases/api_op_TagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds tags to a resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) + // + // This member is required. + Arn *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + // + // This member is required. + Tags map[string]*string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "TagResource", + } +} diff --git a/service/connectcases/api_op_UntagResource.go b/service/connectcases/api_op_UntagResource.go new file mode 100644 index 00000000000..5fccf5665bf --- /dev/null +++ b/service/connectcases/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Untags a resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) + // + // This member is required. + Arn *string + + // List of tag keys. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "UntagResource", + } +} diff --git a/service/connectcases/api_op_UpdateCase.go b/service/connectcases/api_op_UpdateCase.go new file mode 100644 index 00000000000..1ed49d8e4fe --- /dev/null +++ b/service/connectcases/api_op_UpdateCase.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the values of fields on a case. Fields to be updated are received as an +// array of id/value pairs identical to the CreateCase input . If the action is +// successful, the service sends back an HTTP 200 response with an empty HTTP body. +func (c *Client) UpdateCase(ctx context.Context, params *UpdateCaseInput, optFns ...func(*Options)) (*UpdateCaseOutput, error) { + if params == nil { + params = &UpdateCaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCase", params, optFns, c.addOperationUpdateCaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateCaseInput struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // An array of objects with fieldId (matching ListFields/DescribeField) and value + // union data, structured identical to CreateCase. + // + // This member is required. + Fields []types.FieldValue + + noSmithyDocumentSerde +} + +type UpdateCaseOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCase{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateCaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "UpdateCase", + } +} diff --git a/service/connectcases/api_op_UpdateField.go b/service/connectcases/api_op_UpdateField.go new file mode 100644 index 00000000000..aa8071a6f28 --- /dev/null +++ b/service/connectcases/api_op_UpdateField.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the properties of an existing field. +func (c *Client) UpdateField(ctx context.Context, params *UpdateFieldInput, optFns ...func(*Options)) (*UpdateFieldOutput, error) { + if params == nil { + params = &UpdateFieldInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateField", params, optFns, c.addOperationUpdateFieldMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFieldOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFieldInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The unique identifier of a field. + // + // This member is required. + FieldId *string + + // The description of a field. + Description *string + + // The name of the field. + Name *string + + noSmithyDocumentSerde +} + +type UpdateFieldOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFieldMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateField{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateField{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateFieldValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateField(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateField(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "UpdateField", + } +} diff --git a/service/connectcases/api_op_UpdateLayout.go b/service/connectcases/api_op_UpdateLayout.go new file mode 100644 index 00000000000..ee8bbc3d832 --- /dev/null +++ b/service/connectcases/api_op_UpdateLayout.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the attributes of an existing layout. If the action is successful, the +// service sends back an HTTP 200 response with an empty HTTP body. A +// ValidationException is returned when you add non-existent fieldIds to a layout. +// Title and Status fields cannot be part of layouts because they are not +// configurable. +func (c *Client) UpdateLayout(ctx context.Context, params *UpdateLayoutInput, optFns ...func(*Options)) (*UpdateLayoutOutput, error) { + if params == nil { + params = &UpdateLayoutInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLayout", params, optFns, c.addOperationUpdateLayoutMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLayoutOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateLayoutInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // The unique identifier of the layout. + // + // This member is required. + LayoutId *string + + // Information about which fields will be present in the layout, the order of the + // fields, and a read-only attribute of the field. + Content types.LayoutContent + + // The name of the layout. It must be unique per domain. + Name *string + + noSmithyDocumentSerde +} + +type UpdateLayoutOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateLayoutMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLayout{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLayout{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateLayoutValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLayout(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateLayout(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "UpdateLayout", + } +} diff --git a/service/connectcases/api_op_UpdateTemplate.go b/service/connectcases/api_op_UpdateTemplate.go new file mode 100644 index 00000000000..ad34f2ee873 --- /dev/null +++ b/service/connectcases/api_op_UpdateTemplate.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the attributes of an existing template. The template attributes that can +// be modified include name, description, layouts, and requiredFields. At least one +// of these attributes must not be null. If a null value is provided for a given +// attribute, that attribute is ignored and its current value is preserved. +func (c *Client) UpdateTemplate(ctx context.Context, params *UpdateTemplateInput, optFns ...func(*Options)) (*UpdateTemplateOutput, error) { + if params == nil { + params = &UpdateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTemplate", params, optFns, c.addOperationUpdateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTemplateInput struct { + + // The unique identifier of the Cases domain. + // + // This member is required. + DomainId *string + + // A unique identifier for the template. + // + // This member is required. + TemplateId *string + + // A brief description of the template. + Description *string + + // Configuration of layouts associated to the template. + LayoutConfiguration *types.LayoutConfiguration + + // The name of the template. It must be unique per domain. + Name *string + + // A list of fields that must contain a value for a case to be successfully created + // with this template. + RequiredFields []types.RequiredField + + noSmithyDocumentSerde +} + +type UpdateTemplateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cases", + OperationName: "UpdateTemplate", + } +} diff --git a/service/connectcases/deserializers.go b/service/connectcases/deserializers.go new file mode 100644 index 00000000000..cb8b893c156 --- /dev/null +++ b/service/connectcases/deserializers.go @@ -0,0 +1,7220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "math" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpBatchGetField struct { +} + +func (*awsRestjson1_deserializeOpBatchGetField) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchGetField) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchGetField(response, &metadata) + } + output := &BatchGetFieldOutput{} + 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_deserializeOpDocumentBatchGetFieldOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchGetField(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchGetFieldOutput(v **BatchGetFieldOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetFieldOutput + if *v == nil { + sv = &BatchGetFieldOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentBatchGetFieldErrorList(&sv.Errors, value); err != nil { + return err + } + + case "fields": + if err := awsRestjson1_deserializeDocumentBatchGetFieldList(&sv.Fields, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpBatchPutFieldOptions struct { +} + +func (*awsRestjson1_deserializeOpBatchPutFieldOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchPutFieldOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchPutFieldOptions(response, &metadata) + } + output := &BatchPutFieldOptionsOutput{} + 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_deserializeOpDocumentBatchPutFieldOptionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchPutFieldOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchPutFieldOptionsOutput(v **BatchPutFieldOptionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchPutFieldOptionsOutput + if *v == nil { + sv = &BatchPutFieldOptionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errors": + if err := awsRestjson1_deserializeDocumentFieldOptionErrorList(&sv.Errors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateCase struct { +} + +func (*awsRestjson1_deserializeOpCreateCase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateCase(response, &metadata) + } + output := &CreateCaseOutput{} + 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_deserializeOpDocumentCreateCaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateCase(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateCaseOutput(v **CreateCaseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateCaseOutput + if *v == nil { + sv = &CreateCaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CaseArn to be of type string, got %T instead", value) + } + sv.CaseArn = ptr.String(jtv) + } + + case "caseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CaseId to be of type string, got %T instead", value) + } + sv.CaseId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateDomain struct { +} + +func (*awsRestjson1_deserializeOpCreateDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateDomain(response, &metadata) + } + output := &CreateDomainOutput{} + 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_deserializeOpDocumentCreateDomainOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDomainOutput(v **CreateDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDomainOutput + if *v == nil { + sv = &CreateDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "domainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "domainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainStatus to be of type string, got %T instead", value) + } + sv.DomainStatus = types.DomainStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateField struct { +} + +func (*awsRestjson1_deserializeOpCreateField) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateField) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateField(response, &metadata) + } + output := &CreateFieldOutput{} + 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_deserializeOpDocumentCreateFieldOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateField(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateFieldOutput(v **CreateFieldOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateFieldOutput + if *v == nil { + sv = &CreateFieldOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldArn to be of type string, got %T instead", value) + } + sv.FieldArn = ptr.String(jtv) + } + + case "fieldId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.FieldId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateLayout struct { +} + +func (*awsRestjson1_deserializeOpCreateLayout) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateLayout) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateLayout(response, &metadata) + } + output := &CreateLayoutOutput{} + 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_deserializeOpDocumentCreateLayoutOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateLayout(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateLayoutOutput(v **CreateLayoutOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateLayoutOutput + if *v == nil { + sv = &CreateLayoutOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "layoutArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutArn to be of type string, got %T instead", value) + } + sv.LayoutArn = ptr.String(jtv) + } + + case "layoutId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutId to be of type string, got %T instead", value) + } + sv.LayoutId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateRelatedItem struct { +} + +func (*awsRestjson1_deserializeOpCreateRelatedItem) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateRelatedItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateRelatedItem(response, &metadata) + } + output := &CreateRelatedItemOutput{} + 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_deserializeOpDocumentCreateRelatedItemOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateRelatedItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateRelatedItemOutput(v **CreateRelatedItemOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateRelatedItemOutput + if *v == nil { + sv = &CreateRelatedItemOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "relatedItemArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelatedItemArn to be of type string, got %T instead", value) + } + sv.RelatedItemArn = ptr.String(jtv) + } + + case "relatedItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelatedItemId to be of type string, got %T instead", value) + } + sv.RelatedItemId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateTemplate struct { +} + +func (*awsRestjson1_deserializeOpCreateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateTemplate(response, &metadata) + } + output := &CreateTemplateOutput{} + 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_deserializeOpDocumentCreateTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateTemplateOutput(v **CreateTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTemplateOutput + if *v == nil { + sv = &CreateTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "templateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetCase struct { +} + +func (*awsRestjson1_deserializeOpGetCase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetCase(response, &metadata) + } + output := &GetCaseOutput{} + 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_deserializeOpDocumentGetCaseOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetCase(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCaseOutput(v **GetCaseOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCaseOutput + if *v == nil { + sv = &GetCaseOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsRestjson1_deserializeDocumentFieldValueList(&sv.Fields, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetCaseEventConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetCaseEventConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCaseEventConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetCaseEventConfiguration(response, &metadata) + } + output := &GetCaseEventConfigurationOutput{} + 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_deserializeOpDocumentGetCaseEventConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetCaseEventConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCaseEventConfigurationOutput(v **GetCaseEventConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCaseEventConfigurationOutput + if *v == nil { + sv = &GetCaseEventConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventBridge": + if err := awsRestjson1_deserializeDocumentEventBridgeConfiguration(&sv.EventBridge, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDomain struct { +} + +func (*awsRestjson1_deserializeOpGetDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetDomain(response, &metadata) + } + output := &GetDomainOutput{} + 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_deserializeOpDocumentGetDomainOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDomainOutput(v **GetDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDomainOutput + if *v == nil { + sv = &GetDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreatedTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(t) + } + + case "domainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "domainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "domainStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainStatus to be of type string, got %T instead", value) + } + sv.DomainStatus = types.DomainStatus(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLayout struct { +} + +func (*awsRestjson1_deserializeOpGetLayout) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLayout) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetLayout(response, &metadata) + } + output := &GetLayoutOutput{} + 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_deserializeOpDocumentGetLayoutOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetLayout(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetLayoutOutput(v **GetLayoutOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLayoutOutput + if *v == nil { + sv = &GetLayoutOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "content": + if err := awsRestjson1_deserializeDocumentLayoutContent(&sv.Content, value); err != nil { + return err + } + + case "layoutArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutArn to be of type string, got %T instead", value) + } + sv.LayoutArn = ptr.String(jtv) + } + + case "layoutId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutId to be of type string, got %T instead", value) + } + sv.LayoutId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetTemplate struct { +} + +func (*awsRestjson1_deserializeOpGetTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetTemplate(response, &metadata) + } + output := &GetTemplateOutput{} + 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_deserializeOpDocumentGetTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetTemplateOutput(v **GetTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTemplateOutput + if *v == nil { + sv = &GetTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "layoutConfiguration": + if err := awsRestjson1_deserializeDocumentLayoutConfiguration(&sv.LayoutConfiguration, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "requiredFields": + if err := awsRestjson1_deserializeDocumentRequiredFieldList(&sv.RequiredFields, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "templateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListCasesForContact struct { +} + +func (*awsRestjson1_deserializeOpListCasesForContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCasesForContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListCasesForContact(response, &metadata) + } + output := &ListCasesForContactOutput{} + 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_deserializeOpDocumentListCasesForContactOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListCasesForContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCasesForContactOutput(v **ListCasesForContactOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCasesForContactOutput + if *v == nil { + sv = &ListCasesForContactOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cases": + if err := awsRestjson1_deserializeDocumentCaseSummaryList(&sv.Cases, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomains struct { +} + +func (*awsRestjson1_deserializeOpListDomains) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListDomains(response, &metadata) + } + output := &ListDomainsOutput{} + 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_deserializeOpDocumentListDomainsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDomainsOutput(v **ListDomainsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDomainsOutput + if *v == nil { + sv = &ListDomainsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domains": + if err := awsRestjson1_deserializeDocumentDomainSummaryList(&sv.Domains, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFieldOptions struct { +} + +func (*awsRestjson1_deserializeOpListFieldOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFieldOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListFieldOptions(response, &metadata) + } + output := &ListFieldOptionsOutput{} + 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_deserializeOpDocumentListFieldOptionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListFieldOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFieldOptionsOutput(v **ListFieldOptionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFieldOptionsOutput + if *v == nil { + sv = &ListFieldOptionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "options": + if err := awsRestjson1_deserializeDocumentFieldOptionsList(&sv.Options, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFields struct { +} + +func (*awsRestjson1_deserializeOpListFields) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFields) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListFields(response, &metadata) + } + output := &ListFieldsOutput{} + 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_deserializeOpDocumentListFieldsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListFields(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFieldsOutput(v **ListFieldsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListFieldsOutput + if *v == nil { + sv = &ListFieldsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsRestjson1_deserializeDocumentFieldSummaryList(&sv.Fields, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLayouts struct { +} + +func (*awsRestjson1_deserializeOpListLayouts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLayouts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListLayouts(response, &metadata) + } + output := &ListLayoutsOutput{} + 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_deserializeOpDocumentListLayoutsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListLayouts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLayoutsOutput(v **ListLayoutsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLayoutsOutput + if *v == nil { + sv = &ListLayoutsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "layouts": + if err := awsRestjson1_deserializeDocumentLayoutSummaryList(&sv.Layouts, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTemplates struct { +} + +func (*awsRestjson1_deserializeOpListTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTemplates(response, &metadata) + } + output := &ListTemplatesOutput{} + 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_deserializeOpDocumentListTemplatesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTemplatesOutput(v **ListTemplatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTemplatesOutput + if *v == nil { + sv = &ListTemplatesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "templates": + if err := awsRestjson1_deserializeDocumentTemplateSummaryList(&sv.Templates, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutCaseEventConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutCaseEventConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutCaseEventConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutCaseEventConfiguration(response, &metadata) + } + output := &PutCaseEventConfigurationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutCaseEventConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpSearchCases struct { +} + +func (*awsRestjson1_deserializeOpSearchCases) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchCases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchCases(response, &metadata) + } + output := &SearchCasesOutput{} + 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_deserializeOpDocumentSearchCasesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchCases(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchCasesOutput(v **SearchCasesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchCasesOutput + if *v == nil { + sv = &SearchCasesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cases": + if err := awsRestjson1_deserializeDocumentSearchCasesResponseItemList(&sv.Cases, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchRelatedItems struct { +} + +func (*awsRestjson1_deserializeOpSearchRelatedItems) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchRelatedItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchRelatedItems(response, &metadata) + } + output := &SearchRelatedItemsOutput{} + 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_deserializeOpDocumentSearchRelatedItemsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchRelatedItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchRelatedItemsOutput(v **SearchRelatedItemsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchRelatedItemsOutput + if *v == nil { + sv = &SearchRelatedItemsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "relatedItems": + if err := awsRestjson1_deserializeDocumentSearchRelatedItemsResponseItemList(&sv.RelatedItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateCase struct { +} + +func (*awsRestjson1_deserializeOpUpdateCase) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCase(response, &metadata) + } + output := &UpdateCaseOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCase(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateField struct { +} + +func (*awsRestjson1_deserializeOpUpdateField) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateField) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateField(response, &metadata) + } + output := &UpdateFieldOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateField(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateLayout struct { +} + +func (*awsRestjson1_deserializeOpUpdateLayout) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLayout) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateLayout(response, &metadata) + } + output := &UpdateLayoutOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateLayout(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateTemplate struct { +} + +func (*awsRestjson1_deserializeOpUpdateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateTemplate(response, &metadata) + } + output := &UpdateTemplateOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBasicLayout(v **types.BasicLayout, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BasicLayout + if *v == nil { + sv = &types.BasicLayout{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "moreInfo": + if err := awsRestjson1_deserializeDocumentLayoutSections(&sv.MoreInfo, value); err != nil { + return err + } + + case "topPanel": + if err := awsRestjson1_deserializeDocumentLayoutSections(&sv.TopPanel, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetFieldErrorList(v *[]types.FieldError, 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.FieldError + if *v == nil { + cv = []types.FieldError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldError + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBatchGetFieldList(v *[]types.GetFieldResponse, 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.GetFieldResponse + if *v == nil { + cv = []types.GetFieldResponse{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GetFieldResponse + destAddr := &col + if err := awsRestjson1_deserializeDocumentGetFieldResponse(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCaseEventIncludedData(v **types.CaseEventIncludedData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CaseEventIncludedData + if *v == nil { + sv = &types.CaseEventIncludedData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsRestjson1_deserializeDocumentFieldIdentifierList(&sv.Fields, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCaseSummary(v **types.CaseSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CaseSummary + if *v == nil { + sv = &types.CaseSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CaseId to be of type string, got %T instead", value) + } + sv.CaseId = ptr.String(jtv) + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCaseSummaryList(v *[]types.CaseSummary, 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.CaseSummary + if *v == nil { + cv = []types.CaseSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CaseSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCaseSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCommentContent(v **types.CommentContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CommentContent + if *v == nil { + sv = &types.CommentContent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "body": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommentBody to be of type string, got %T instead", value) + } + sv.Body = ptr.String(jtv) + } + + case "contentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommentBodyTextType to be of type string, got %T instead", value) + } + sv.ContentType = types.CommentBodyTextType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContactContent(v **types.ContactContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ContactContent + if *v == nil { + sv = &types.ContactContent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "channel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Channel to be of type string, got %T instead", value) + } + sv.Channel = ptr.String(jtv) + } + + case "connectedToSystemTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ConnectedToSystemTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.ConnectedToSystemTime = ptr.Time(t) + } + + case "contactArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactArn to be of type string, got %T instead", value) + } + sv.ContactArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDomainSummary(v **types.DomainSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DomainSummary + if *v == nil { + sv = &types.DomainSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domainArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainArn to be of type string, got %T instead", value) + } + sv.DomainArn = ptr.String(jtv) + } + + case "domainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) + } + sv.DomainId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDomainSummaryList(v *[]types.DomainSummary, 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.DomainSummary + if *v == nil { + cv = []types.DomainSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DomainSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDomainSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEventBridgeConfiguration(v **types.EventBridgeConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventBridgeConfiguration + if *v == nil { + sv = &types.EventBridgeConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + case "includedData": + if err := awsRestjson1_deserializeDocumentEventIncludedData(&sv.IncludedData, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventIncludedData(v **types.EventIncludedData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventIncludedData + if *v == nil { + sv = &types.EventIncludedData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseData": + if err := awsRestjson1_deserializeDocumentCaseEventIncludedData(&sv.CaseData, value); err != nil { + return err + } + + case "relatedItemData": + if err := awsRestjson1_deserializeDocumentRelatedItemEventIncludedData(&sv.RelatedItemData, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldError(v **types.FieldError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldError + if *v == nil { + sv = &types.FieldError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldGroup(v **types.FieldGroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldGroup + if *v == nil { + sv = &types.FieldGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fields": + if err := awsRestjson1_deserializeDocumentFieldList(&sv.Fields, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldIdentifier(v **types.FieldIdentifier, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldIdentifier + if *v == nil { + sv = &types.FieldIdentifier{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldIdentifierList(v *[]types.FieldIdentifier, 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.FieldIdentifier + if *v == nil { + cv = []types.FieldIdentifier{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldIdentifier + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldIdentifier(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldItem(v **types.FieldItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldItem + if *v == nil { + sv = &types.FieldItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldList(v *[]types.FieldItem, 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.FieldItem + if *v == nil { + cv = []types.FieldItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldOption(v **types.FieldOption, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldOption + if *v == nil { + sv = &types.FieldOption{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "active": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Active = ptr.Bool(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldOptionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldOptionValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldOptionError(v **types.FieldOptionError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldOptionError + if *v == nil { + sv = &types.FieldOptionError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldOptionValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldOptionErrorList(v *[]types.FieldOptionError, 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.FieldOptionError + if *v == nil { + cv = []types.FieldOptionError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldOptionError + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldOptionError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldOptionsList(v *[]types.FieldOption, 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.FieldOption + if *v == nil { + cv = []types.FieldOption{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldOption + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldOption(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldSummary(v **types.FieldSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldSummary + if *v == nil { + sv = &types.FieldSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldArn to be of type string, got %T instead", value) + } + sv.FieldArn = ptr.String(jtv) + } + + case "fieldId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.FieldId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldNamespace to be of type string, got %T instead", value) + } + sv.Namespace = types.FieldNamespace(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldType to be of type string, got %T instead", value) + } + sv.Type = types.FieldType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldSummaryList(v *[]types.FieldSummary, 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.FieldSummary + if *v == nil { + cv = []types.FieldSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldValue(v **types.FieldValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FieldValue + if *v == nil { + sv = &types.FieldValue{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "value": + if err := awsRestjson1_deserializeDocumentFieldValueUnion(&sv.Value, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldValueList(v *[]types.FieldValue, 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.FieldValue + if *v == nil { + cv = []types.FieldValue{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldValue + destAddr := &col + if err := awsRestjson1_deserializeDocumentFieldValue(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFieldValueUnion(v *types.FieldValueUnion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.FieldValueUnion +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "booleanValue": + var mv bool + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + mv = jtv + } + uv = &types.FieldValueUnionMemberBooleanValue{Value: mv} + break loop + + case "doubleValue": + var mv float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + mv = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + mv = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + uv = &types.FieldValueUnionMemberDoubleValue{Value: mv} + break loop + + case "stringValue": + var mv string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + mv = jtv + } + uv = &types.FieldValueUnionMemberStringValue{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentGetFieldResponse(v **types.GetFieldResponse, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GetFieldResponse + if *v == nil { + sv = &types.GetFieldResponse{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "fieldArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldArn to be of type string, got %T instead", value) + } + sv.FieldArn = ptr.String(jtv) + } + + case "fieldId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.FieldId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldNamespace to be of type string, got %T instead", value) + } + sv.Namespace = types.FieldNamespace(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldType to be of type string, got %T instead", value) + } + sv.Type = types.FieldType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "retryAfterSeconds": + 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.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLayoutConfiguration(v **types.LayoutConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LayoutConfiguration + if *v == nil { + sv = &types.LayoutConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "defaultLayout": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutId to be of type string, got %T instead", value) + } + sv.DefaultLayout = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLayoutContent(v *types.LayoutContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.LayoutContent +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "basic": + var mv types.BasicLayout + destAddr := &mv + if err := awsRestjson1_deserializeDocumentBasicLayout(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.LayoutContentMemberBasic{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentLayoutSections(v **types.LayoutSections, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LayoutSections + if *v == nil { + sv = &types.LayoutSections{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "sections": + if err := awsRestjson1_deserializeDocumentSectionsList(&sv.Sections, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLayoutSummary(v **types.LayoutSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LayoutSummary + if *v == nil { + sv = &types.LayoutSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "layoutArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutArn to be of type string, got %T instead", value) + } + sv.LayoutArn = ptr.String(jtv) + } + + case "layoutId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutId to be of type string, got %T instead", value) + } + sv.LayoutId = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LayoutName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLayoutSummaryList(v *[]types.LayoutSummary, 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.LayoutSummary + if *v == nil { + cv = []types.LayoutSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LayoutSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentLayoutSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRelatedItemContent(v *types.RelatedItemContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.RelatedItemContent +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "comment": + var mv types.CommentContent + destAddr := &mv + if err := awsRestjson1_deserializeDocumentCommentContent(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RelatedItemContentMemberComment{Value: mv} + break loop + + case "contact": + var mv types.ContactContent + destAddr := &mv + if err := awsRestjson1_deserializeDocumentContactContent(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.RelatedItemContentMemberContact{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentRelatedItemEventIncludedData(v **types.RelatedItemEventIncludedData, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RelatedItemEventIncludedData + if *v == nil { + sv = &types.RelatedItemEventIncludedData{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "includeContent": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IncludeContent = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRequiredField(v **types.RequiredField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RequiredField + if *v == nil { + sv = &types.RequiredField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) + } + sv.FieldId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRequiredFieldList(v *[]types.RequiredField, 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.RequiredField + if *v == nil { + cv = []types.RequiredField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RequiredField + destAddr := &col + if err := awsRestjson1_deserializeDocumentRequiredField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSearchCasesResponseItem(v **types.SearchCasesResponseItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SearchCasesResponseItem + if *v == nil { + sv = &types.SearchCasesResponseItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caseId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CaseId to be of type string, got %T instead", value) + } + sv.CaseId = ptr.String(jtv) + } + + case "fields": + if err := awsRestjson1_deserializeDocumentFieldValueList(&sv.Fields, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSearchCasesResponseItemList(v *[]*types.SearchCasesResponseItem, 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.SearchCasesResponseItem + if *v == nil { + cv = []*types.SearchCasesResponseItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col *types.SearchCasesResponseItem + if err := awsRestjson1_deserializeDocumentSearchCasesResponseItem(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSearchRelatedItemsResponseItem(v **types.SearchRelatedItemsResponseItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SearchRelatedItemsResponseItem + if *v == nil { + sv = &types.SearchRelatedItemsResponseItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "associationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AssociationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.AssociationTime = ptr.Time(t) + } + + case "content": + if err := awsRestjson1_deserializeDocumentRelatedItemContent(&sv.Content, value); err != nil { + return err + } + + case "relatedItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelatedItemId to be of type string, got %T instead", value) + } + sv.RelatedItemId = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelatedItemType to be of type string, got %T instead", value) + } + sv.Type = types.RelatedItemType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSearchRelatedItemsResponseItemList(v *[]*types.SearchRelatedItemsResponseItem, 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.SearchRelatedItemsResponseItem + if *v == nil { + cv = []*types.SearchRelatedItemsResponseItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col *types.SearchRelatedItemsResponseItem + if err := awsRestjson1_deserializeDocumentSearchRelatedItemsResponseItem(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSection(v *types.Section, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.Section +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "fieldGroup": + var mv types.FieldGroup + destAddr := &mv + if err := awsRestjson1_deserializeDocumentFieldGroup(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SectionMemberFieldGroup{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentSectionsList(v *[]types.Section, 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.Section + if *v == nil { + cv = []types.Section{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Section + if err := awsRestjson1_deserializeDocumentSection(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTags(v *map[string]*string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]*string + if *v == nil { + mv = map[string]*string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal *string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = ptr.String(jtv) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTemplateSummary(v **types.TemplateSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TemplateSummary + if *v == nil { + sv = &types.TemplateSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "templateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateArn to be of type string, got %T instead", value) + } + sv.TemplateArn = ptr.String(jtv) + } + + case "templateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TemplateId to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTemplateSummaryList(v *[]types.TemplateSummary, 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.TemplateSummary + if *v == nil { + cv = []types.TemplateSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TemplateSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentTemplateSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/connectcases/doc.go b/service/connectcases/doc.go new file mode 100644 index 00000000000..312fd29cbe9 --- /dev/null +++ b/service/connectcases/doc.go @@ -0,0 +1,13 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package connectcases provides the API client, operations, and parameter types +// for Amazon Connect Cases. +// +// Welcome to the Amazon Connect Cases API Reference. This guide provides +// information about the Amazon Connect Cases API, which you can use to create, +// update, get, and list Cases domains, fields, field options, layouts, templates, +// cases, related items, and tags. For more information about Amazon Connect Cases, +// see Amazon Connect Cases +// (https://docs.aws.amazon.com/connect/latest/adminguide/cases.html) in the Amazon +// Connect Administrator Guide. +package connectcases diff --git a/service/connectcases/endpoints.go b/service/connectcases/endpoints.go new file mode 100644 index 00000000000..936c67bed74 --- /dev/null +++ b/service/connectcases/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/connectcases/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "cases" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/connectcases/generated.json b/service/connectcases/generated.json new file mode 100644 index 00000000000..625cd088de4 --- /dev/null +++ b/service/connectcases/generated.json @@ -0,0 +1,57 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_BatchGetField.go", + "api_op_BatchPutFieldOptions.go", + "api_op_CreateCase.go", + "api_op_CreateDomain.go", + "api_op_CreateField.go", + "api_op_CreateLayout.go", + "api_op_CreateRelatedItem.go", + "api_op_CreateTemplate.go", + "api_op_GetCase.go", + "api_op_GetCaseEventConfiguration.go", + "api_op_GetDomain.go", + "api_op_GetLayout.go", + "api_op_GetTemplate.go", + "api_op_ListCasesForContact.go", + "api_op_ListDomains.go", + "api_op_ListFieldOptions.go", + "api_op_ListFields.go", + "api_op_ListLayouts.go", + "api_op_ListTagsForResource.go", + "api_op_ListTemplates.go", + "api_op_PutCaseEventConfiguration.go", + "api_op_SearchCases.go", + "api_op_SearchRelatedItems.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateCase.go", + "api_op_UpdateField.go", + "api_op_UpdateLayout.go", + "api_op_UpdateTemplate.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/connectcases", + "unstable": false +} diff --git a/service/connectcases/go.mod b/service/connectcases/go.mod new file mode 100644 index 00000000000..7f30b780598 --- /dev/null +++ b/service/connectcases/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/connectcases + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.16.16 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17 + github.com/aws/smithy-go v1.13.3 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/connectcases/go.sum b/service/connectcases/go.sum new file mode 100644 index 00000000000..01757bce834 --- /dev/null +++ b/service/connectcases/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA= +github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/connectcases/go_module_metadata.go b/service/connectcases/go_module_metadata.go new file mode 100644 index 00000000000..22ccc977d0b --- /dev/null +++ b/service/connectcases/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package connectcases + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/connectcases/internal/endpoints/endpoints.go b/service/connectcases/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..059297ff0ca --- /dev/null +++ b/service/connectcases/internal/endpoints/endpoints.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver ConnectCases endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cases.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cases-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cases-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cases.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cases.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cases-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cases-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cases.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cases-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cases.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cases-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cases.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "cases.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "cases-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "cases-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "cases.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/connectcases/internal/endpoints/endpoints_test.go b/service/connectcases/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/connectcases/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/connectcases/protocol_test.go b/service/connectcases/protocol_test.go new file mode 100644 index 00000000000..40d8416d379 --- /dev/null +++ b/service/connectcases/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases diff --git a/service/connectcases/serializers.go b/service/connectcases/serializers.go new file mode 100644 index 00000000000..164bccef505 --- /dev/null +++ b/service/connectcases/serializers.go @@ -0,0 +1,3042 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" +) + +type awsRestjson1_serializeOpBatchGetField struct { +} + +func (*awsRestjson1_serializeOpBatchGetField) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchGetField) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetFieldInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields-batch") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchGetFieldInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchGetFieldInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchGetFieldInput(v *BatchGetFieldInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchGetFieldInput(v *BatchGetFieldInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentBatchGetFieldIdentifierList(v.Fields, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchPutFieldOptions struct { +} + +func (*awsRestjson1_serializeOpBatchPutFieldOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchPutFieldOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchPutFieldOptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields/{fieldId}/options") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsBatchPutFieldOptionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchPutFieldOptionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchPutFieldOptionsInput(v *BatchPutFieldOptionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.FieldId == nil || len(*v.FieldId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member fieldId must not be empty")} + } + if v.FieldId != nil { + if err := encoder.SetURI("fieldId").String(*v.FieldId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchPutFieldOptionsInput(v *BatchPutFieldOptionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Options != nil { + ok := object.Key("options") + if err := awsRestjson1_serializeDocumentFieldOptionsList(v.Options, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateCase struct { +} + +func (*awsRestjson1_serializeOpCreateCase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateCaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateCaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateCaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateCaseInput(v *CreateCaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateCaseInput(v *CreateCaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldValueList(v.Fields, ok); err != nil { + return err + } + } + + if v.TemplateId != nil { + ok := object.Key("templateId") + ok.String(*v.TemplateId) + } + + return nil +} + +type awsRestjson1_serializeOpCreateDomain struct { +} + +func (*awsRestjson1_serializeOpCreateDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateDomainInput(v *CreateDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpCreateField struct { +} + +func (*awsRestjson1_serializeOpCreateField) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateField) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateFieldInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateFieldInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateFieldInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateFieldInput(v *CreateFieldInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateFieldInput(v *CreateFieldInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateLayout struct { +} + +func (*awsRestjson1_serializeOpCreateLayout) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateLayout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateLayoutInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/layouts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateLayoutInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateLayoutInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateLayoutInput(v *CreateLayoutInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateLayoutInput(v *CreateLayoutInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentLayoutContent(v.Content, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpCreateRelatedItem struct { +} + +func (*awsRestjson1_serializeOpCreateRelatedItem) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateRelatedItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateRelatedItemInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases/{caseId}/related-items/") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateRelatedItemInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateRelatedItemInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateRelatedItemInput(v *CreateRelatedItemInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CaseId == nil || len(*v.CaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member caseId must not be empty")} + } + if v.CaseId != nil { + if err := encoder.SetURI("caseId").String(*v.CaseId); err != nil { + return err + } + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateRelatedItemInput(v *CreateRelatedItemInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentRelatedItemInputContent(v.Content, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateTemplate struct { +} + +func (*awsRestjson1_serializeOpCreateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/templates") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateTemplateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateTemplateInput(v *CreateTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTemplateInput(v *CreateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.LayoutConfiguration != nil { + ok := object.Key("layoutConfiguration") + if err := awsRestjson1_serializeDocumentLayoutConfiguration(v.LayoutConfiguration, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RequiredFields != nil { + ok := object.Key("requiredFields") + if err := awsRestjson1_serializeDocumentRequiredFieldList(v.RequiredFields, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetCase struct { +} + +func (*awsRestjson1_serializeOpGetCase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases/{caseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetCaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetCaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCaseInput(v *GetCaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CaseId == nil || len(*v.CaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member caseId must not be empty")} + } + if v.CaseId != nil { + if err := encoder.SetURI("caseId").String(*v.CaseId); err != nil { + return err + } + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetCaseInput(v *GetCaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldIdentifierList(v.Fields, ok); err != nil { + return err + } + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpGetCaseEventConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetCaseEventConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCaseEventConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCaseEventConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/case-event-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetCaseEventConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCaseEventConfigurationInput(v *GetCaseEventConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDomain struct { +} + +func (*awsRestjson1_serializeOpGetDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDomainInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetDomainInput(v *GetDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetLayout struct { +} + +func (*awsRestjson1_serializeOpGetLayout) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLayout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLayoutInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/layouts/{layoutId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetLayoutInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetLayoutInput(v *GetLayoutInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.LayoutId == nil || len(*v.LayoutId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member layoutId must not be empty")} + } + if v.LayoutId != nil { + if err := encoder.SetURI("layoutId").String(*v.LayoutId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetTemplate struct { +} + +func (*awsRestjson1_serializeOpGetTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/templates/{templateId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetTemplateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetTemplateInput(v *GetTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.TemplateId == nil || len(*v.TemplateId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member templateId must not be empty")} + } + if v.TemplateId != nil { + if err := encoder.SetURI("templateId").String(*v.TemplateId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListCasesForContact struct { +} + +func (*awsRestjson1_serializeOpListCasesForContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCasesForContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCasesForContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/list-cases-for-contact") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListCasesForContactInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListCasesForContactInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListCasesForContactInput(v *ListCasesForContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListCasesForContactInput(v *ListCasesForContactInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContactArn != nil { + ok := object.Key("contactArn") + ok.String(*v.ContactArn) + } + + 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_serializeOpListDomains struct { +} + +func (*awsRestjson1_serializeOpListDomains) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDomainsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDomainsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListDomainsInput(v *ListDomainsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListFieldOptions struct { +} + +func (*awsRestjson1_serializeOpListFieldOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFieldOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFieldOptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields/{fieldId}/options-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListFieldOptionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListFieldOptionsInput(v *ListFieldOptionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.FieldId == nil || len(*v.FieldId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member fieldId must not be empty")} + } + if v.FieldId != nil { + if err := encoder.SetURI("fieldId").String(*v.FieldId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Values != nil { + for i := range v.Values { + encoder.AddQuery("values").String(v.Values[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpListFields struct { +} + +func (*awsRestjson1_serializeOpListFields) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFields) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListFieldsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListFieldsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListFieldsInput(v *ListFieldsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListLayouts struct { +} + +func (*awsRestjson1_serializeOpListLayouts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLayouts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLayoutsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/layouts-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListLayoutsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListLayoutsInput(v *ListLayoutsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListTemplates struct { +} + +func (*awsRestjson1_serializeOpListTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTemplatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/templates-list") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTemplatesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTemplatesInput(v *ListTemplatesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpPutCaseEventConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutCaseEventConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutCaseEventConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutCaseEventConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/case-event-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutCaseEventConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutCaseEventConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutCaseEventConfigurationInput(v *PutCaseEventConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutCaseEventConfigurationInput(v *PutCaseEventConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventBridge != nil { + ok := object.Key("eventBridge") + if err := awsRestjson1_serializeDocumentEventBridgeConfiguration(v.EventBridge, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSearchCases struct { +} + +func (*awsRestjson1_serializeOpSearchCases) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchCases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchCasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases-search") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchCasesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchCasesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchCasesInput(v *SearchCasesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchCasesInput(v *SearchCasesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldIdentifierList(v.Fields, ok); err != nil { + return err + } + } + + if v.Filter != nil { + ok := object.Key("filter") + if err := awsRestjson1_serializeDocumentCaseFilter(v.Filter, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.SearchTerm != nil { + ok := object.Key("searchTerm") + ok.String(*v.SearchTerm) + } + + if v.Sorts != nil { + ok := object.Key("sorts") + if err := awsRestjson1_serializeDocumentSortList(v.Sorts, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSearchRelatedItems struct { +} + +func (*awsRestjson1_serializeOpSearchRelatedItems) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchRelatedItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchRelatedItemsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases/{caseId}/related-items-search") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchRelatedItemsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchRelatedItemsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchRelatedItemsInput(v *SearchRelatedItemsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CaseId == nil || len(*v.CaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member caseId must not be empty")} + } + if v.CaseId != nil { + if err := encoder.SetURI("caseId").String(*v.CaseId); err != nil { + return err + } + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchRelatedItemsInput(v *SearchRelatedItemsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentRelatedItemFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateCase struct { +} + +func (*awsRestjson1_serializeOpUpdateCase) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateCaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/cases/{caseId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCaseInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCaseInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCaseInput(v *UpdateCaseInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CaseId == nil || len(*v.CaseId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member caseId must not be empty")} + } + if v.CaseId != nil { + if err := encoder.SetURI("caseId").String(*v.CaseId); err != nil { + return err + } + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCaseInput(v *UpdateCaseInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldValueList(v.Fields, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateField struct { +} + +func (*awsRestjson1_serializeOpUpdateField) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateField) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateFieldInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/fields/{fieldId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateFieldInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateFieldInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateFieldInput(v *UpdateFieldInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.FieldId == nil || len(*v.FieldId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member fieldId must not be empty")} + } + if v.FieldId != nil { + if err := encoder.SetURI("fieldId").String(*v.FieldId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateFieldInput(v *UpdateFieldInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateLayout struct { +} + +func (*awsRestjson1_serializeOpUpdateLayout) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLayout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLayoutInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/layouts/{layoutId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateLayoutInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateLayoutInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateLayoutInput(v *UpdateLayoutInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.LayoutId == nil || len(*v.LayoutId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member layoutId must not be empty")} + } + if v.LayoutId != nil { + if err := encoder.SetURI("layoutId").String(*v.LayoutId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateLayoutInput(v *UpdateLayoutInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + if err := awsRestjson1_serializeDocumentLayoutContent(v.Content, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateTemplate struct { +} + +func (*awsRestjson1_serializeOpUpdateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{domainId}/templates/{templateId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateTemplateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateTemplateInput(v *UpdateTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainId == nil || len(*v.DomainId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainId must not be empty")} + } + if v.DomainId != nil { + if err := encoder.SetURI("domainId").String(*v.DomainId); err != nil { + return err + } + } + + if v.TemplateId == nil || len(*v.TemplateId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member templateId must not be empty")} + } + if v.TemplateId != nil { + if err := encoder.SetURI("templateId").String(*v.TemplateId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateTemplateInput(v *UpdateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.LayoutConfiguration != nil { + ok := object.Key("layoutConfiguration") + if err := awsRestjson1_serializeDocumentLayoutConfiguration(v.LayoutConfiguration, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.RequiredFields != nil { + ok := object.Key("requiredFields") + if err := awsRestjson1_serializeDocumentRequiredFieldList(v.RequiredFields, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentBasicLayout(v *types.BasicLayout, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MoreInfo != nil { + ok := object.Key("moreInfo") + if err := awsRestjson1_serializeDocumentLayoutSections(v.MoreInfo, ok); err != nil { + return err + } + } + + if v.TopPanel != nil { + ok := object.Key("topPanel") + if err := awsRestjson1_serializeDocumentLayoutSections(v.TopPanel, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentBatchGetFieldIdentifierList(v []types.FieldIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFieldIdentifier(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCaseEventIncludedData(v *types.CaseEventIncludedData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldIdentifierList(v.Fields, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCaseFilter(v types.CaseFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.CaseFilterMemberAndAll: + av := object.Key("andAll") + if err := awsRestjson1_serializeDocumentCaseFilterList(uv.Value, av); err != nil { + return err + } + + case *types.CaseFilterMemberField: + av := object.Key("field") + if err := awsRestjson1_serializeDocumentFieldFilter(uv.Value, av); err != nil { + return err + } + + case *types.CaseFilterMemberNot: + av := object.Key("not") + if err := awsRestjson1_serializeDocumentCaseFilter(uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentCaseFilterList(v []types.CaseFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentCaseFilter(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentChannelList(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_serializeDocumentCommentContent(v *types.CommentContent, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Body != nil { + ok := object.Key("body") + ok.String(*v.Body) + } + + if len(v.ContentType) > 0 { + ok := object.Key("contentType") + ok.String(string(v.ContentType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentCommentFilter(v *types.CommentFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsRestjson1_serializeDocumentContact(v *types.Contact, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContactArn != nil { + ok := object.Key("contactArn") + ok.String(*v.ContactArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentContactFilter(v *types.ContactFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Channel != nil { + ok := object.Key("channel") + if err := awsRestjson1_serializeDocumentChannelList(v.Channel, ok); err != nil { + return err + } + } + + if v.ContactArn != nil { + ok := object.Key("contactArn") + ok.String(*v.ContactArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentEventBridgeConfiguration(v *types.EventBridgeConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + if v.IncludedData != nil { + ok := object.Key("includedData") + if err := awsRestjson1_serializeDocumentEventIncludedData(v.IncludedData, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEventIncludedData(v *types.EventIncludedData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CaseData != nil { + ok := object.Key("caseData") + if err := awsRestjson1_serializeDocumentCaseEventIncludedData(v.CaseData, ok); err != nil { + return err + } + } + + if v.RelatedItemData != nil { + ok := object.Key("relatedItemData") + if err := awsRestjson1_serializeDocumentRelatedItemEventIncludedData(v.RelatedItemData, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldFilter(v types.FieldFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FieldFilterMemberContains: + av := object.Key("contains") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + case *types.FieldFilterMemberEqualTo: + av := object.Key("equalTo") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + case *types.FieldFilterMemberGreaterThan: + av := object.Key("greaterThan") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + case *types.FieldFilterMemberGreaterThanOrEqualTo: + av := object.Key("greaterThanOrEqualTo") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + case *types.FieldFilterMemberLessThan: + av := object.Key("lessThan") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + case *types.FieldFilterMemberLessThanOrEqualTo: + av := object.Key("lessThanOrEqualTo") + if err := awsRestjson1_serializeDocumentFieldValue(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentFieldGroup(v *types.FieldGroup, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldList(v.Fields, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldIdentifier(v *types.FieldIdentifier, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldIdentifierList(v []types.FieldIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFieldIdentifier(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFieldItem(v *types.FieldItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldList(v []types.FieldItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFieldItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFieldOption(v *types.FieldOption, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Active != nil { + ok := object.Key("active") + ok.Boolean(*v.Active) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldOptionsList(v []types.FieldOption, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFieldOption(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFieldValue(v *types.FieldValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Value != nil { + ok := object.Key("value") + if err := awsRestjson1_serializeDocumentFieldValueUnion(v.Value, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldValueList(v []types.FieldValue, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFieldValue(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFieldValueUnion(v types.FieldValueUnion, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.FieldValueUnionMemberBooleanValue: + av := object.Key("booleanValue") + av.Boolean(uv.Value) + + case *types.FieldValueUnionMemberDoubleValue: + av := object.Key("doubleValue") + switch { + case math.IsNaN(uv.Value): + av.String("NaN") + + case math.IsInf(uv.Value, 1): + av.String("Infinity") + + case math.IsInf(uv.Value, -1): + av.String("-Infinity") + + default: + av.Double(uv.Value) + + } + + case *types.FieldValueUnionMemberStringValue: + av := object.Key("stringValue") + av.String(uv.Value) + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentLayoutConfiguration(v *types.LayoutConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultLayout != nil { + ok := object.Key("defaultLayout") + ok.String(*v.DefaultLayout) + } + + return nil +} + +func awsRestjson1_serializeDocumentLayoutContent(v types.LayoutContent, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.LayoutContentMemberBasic: + av := object.Key("basic") + if err := awsRestjson1_serializeDocumentBasicLayout(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentLayoutSections(v *types.LayoutSections, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Sections != nil { + ok := object.Key("sections") + if err := awsRestjson1_serializeDocumentSectionsList(v.Sections, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentRelatedItemEventIncludedData(v *types.RelatedItemEventIncludedData, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IncludeContent != nil { + ok := object.Key("includeContent") + ok.Boolean(*v.IncludeContent) + } + + return nil +} + +func awsRestjson1_serializeDocumentRelatedItemFilterList(v []types.RelatedItemTypeFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentRelatedItemTypeFilter(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRelatedItemInputContent(v types.RelatedItemInputContent, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RelatedItemInputContentMemberComment: + av := object.Key("comment") + if err := awsRestjson1_serializeDocumentCommentContent(&uv.Value, av); err != nil { + return err + } + + case *types.RelatedItemInputContentMemberContact: + av := object.Key("contact") + if err := awsRestjson1_serializeDocumentContact(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentRelatedItemTypeFilter(v types.RelatedItemTypeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.RelatedItemTypeFilterMemberComment: + av := object.Key("comment") + if err := awsRestjson1_serializeDocumentCommentFilter(&uv.Value, av); err != nil { + return err + } + + case *types.RelatedItemTypeFilterMemberContact: + av := object.Key("contact") + if err := awsRestjson1_serializeDocumentContactFilter(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentRequiredField(v *types.RequiredField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FieldId != nil { + ok := object.Key("fieldId") + ok.String(*v.FieldId) + } + + return nil +} + +func awsRestjson1_serializeDocumentRequiredFieldList(v []types.RequiredField, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRequiredField(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSection(v types.Section, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SectionMemberFieldGroup: + av := object.Key("fieldGroup") + if err := awsRestjson1_serializeDocumentFieldGroup(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentSectionsList(v []types.Section, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if vv := v[i]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentSection(v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSort(v *types.Sort, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FieldId != nil { + ok := object.Key("fieldId") + ok.String(*v.FieldId) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSortList(v []types.Sort, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSort(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentTags(v map[string]*string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + om.Null() + continue + } + om.String(*v[key]) + } + return nil +} diff --git a/service/connectcases/types/enums.go b/service/connectcases/types/enums.go new file mode 100644 index 00000000000..4f8974b9d0d --- /dev/null +++ b/service/connectcases/types/enums.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type CommentBodyTextType string + +// Enum values for CommentBodyTextType +const ( + CommentBodyTextTypePlaintext CommentBodyTextType = "Text/Plain" +) + +// Values returns all known values for CommentBodyTextType. 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 (CommentBodyTextType) Values() []CommentBodyTextType { + return []CommentBodyTextType{ + "Text/Plain", + } +} + +type DomainStatus string + +// Enum values for DomainStatus +const ( + DomainStatusActive DomainStatus = "Active" + DomainStatusCreationInProgress DomainStatus = "CreationInProgress" + DomainStatusCreationFailed DomainStatus = "CreationFailed" +) + +// Values returns all known values for DomainStatus. 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 (DomainStatus) Values() []DomainStatus { + return []DomainStatus{ + "Active", + "CreationInProgress", + "CreationFailed", + } +} + +type FieldNamespace string + +// Enum values for FieldNamespace +const ( + FieldNamespaceSystem FieldNamespace = "System" + FieldNamespaceCustom FieldNamespace = "Custom" +) + +// Values returns all known values for FieldNamespace. 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 (FieldNamespace) Values() []FieldNamespace { + return []FieldNamespace{ + "System", + "Custom", + } +} + +type FieldType string + +// Enum values for FieldType +const ( + FieldTypeText FieldType = "Text" + FieldTypeNumber FieldType = "Number" + FieldTypeBoolean FieldType = "Boolean" + FieldTypeDateTime FieldType = "DateTime" + FieldTypeSingleSelect FieldType = "SingleSelect" +) + +// Values returns all known values for FieldType. 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 (FieldType) Values() []FieldType { + return []FieldType{ + "Text", + "Number", + "Boolean", + "DateTime", + "SingleSelect", + } +} + +type Order string + +// Enum values for Order +const ( + OrderAscending Order = "Asc" + OrderDescending Order = "Desc" +) + +// Values returns all known values for Order. 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 (Order) Values() []Order { + return []Order{ + "Asc", + "Desc", + } +} + +type RelatedItemType string + +// Enum values for RelatedItemType +const ( + RelatedItemTypeContact RelatedItemType = "Contact" + RelatedItemTypeComment RelatedItemType = "Comment" +) + +// Values returns all known values for RelatedItemType. 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 (RelatedItemType) Values() []RelatedItemType { + return []RelatedItemType{ + "Contact", + "Comment", + } +} diff --git a/service/connectcases/types/errors.go b/service/connectcases/types/errors.go new file mode 100644 index 00000000000..60dd4568fd0 --- /dev/null +++ b/service/connectcases/types/errors.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested operation would cause a conflict with the current state of a +// service resource associated with the request. Resolve the conflict before +// retrying this request. See the accompanying error message for details. +type ConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// We couldn't process your request because of an issue with the server. Try again +// later. +type InternalServerException struct { + Message *string + + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// We couldn't find the requested resource. Check that your resources exists and +// were created in the same Amazon Web Services Region as your request, and try +// your request again. +type ResourceNotFoundException struct { + Message *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The service quota has been exceeded. For a list of service quotas, see Amazon +// Connect Service Quotas +// (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) +// in the Amazon Connect Administrator Guide. +type ServiceQuotaExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The rate has been exceeded for this API. Please try again after a few minutes. +type ThrottlingException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request isn't valid. Check the syntax and try again. +type ValidationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/connectcases/types/types.go b/service/connectcases/types/types.go new file mode 100644 index 00000000000..4826a26d461 --- /dev/null +++ b/service/connectcases/types/types.go @@ -0,0 +1,788 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Content specific to BasicLayout type. It configures fields in the top panel and +// More Info tab of agent application. +type BasicLayout struct { + + // This represents sections in a tab of the page layout. + MoreInfo *LayoutSections + + // This represents sections in a panel of the page layout. + TopPanel *LayoutSections + + noSmithyDocumentSerde +} + +// Details of what case data is published through the case event stream. +type CaseEventIncludedData struct { + + // List of field identifiers. + // + // This member is required. + Fields []FieldIdentifier + + noSmithyDocumentSerde +} + +// A filter for cases. Only one value can be provided. +// +// The following types satisfy this interface: +// +// CaseFilterMemberAndAll +// CaseFilterMemberField +// CaseFilterMemberNot +type CaseFilter interface { + isCaseFilter() +} + +// Provides "and all" filtering. +type CaseFilterMemberAndAll struct { + Value []CaseFilter + + noSmithyDocumentSerde +} + +func (*CaseFilterMemberAndAll) isCaseFilter() {} + +// A list of fields to filter on. +type CaseFilterMemberField struct { + Value FieldFilter + + noSmithyDocumentSerde +} + +func (*CaseFilterMemberField) isCaseFilter() {} + +// A filter for cases. Only one value can be provided. +type CaseFilterMemberNot struct { + Value CaseFilter + + noSmithyDocumentSerde +} + +func (*CaseFilterMemberNot) isCaseFilter() {} + +// Case summary information. +type CaseSummary struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + noSmithyDocumentSerde +} + +// Represents the content of a Comment to be returned to agents. +type CommentContent struct { + + // Text in the body of a Comment on a case. + // + // This member is required. + Body *string + + // Type of the text in the box of a Comment on a case. + // + // This member is required. + ContentType CommentBodyTextType + + noSmithyDocumentSerde +} + +// A filter for related items of type Comment. +type CommentFilter struct { + noSmithyDocumentSerde +} + +// An object that represents an Amazon Connect contact object. +type Contact struct { + + // A unique identifier of a contact in Amazon Connect. + // + // This member is required. + ContactArn *string + + noSmithyDocumentSerde +} + +// An object that represents a content of an Amazon Connect contact object. +type ContactContent struct { + + // A list of channels to filter on for related items of type Contact. + // + // This member is required. + Channel *string + + // The difference between the InitiationTimestamp and the DisconnectTimestamp of + // the contact. + // + // This member is required. + ConnectedToSystemTime *time.Time + + // A unique identifier of a contact in Amazon Connect. + // + // This member is required. + ContactArn *string + + noSmithyDocumentSerde +} + +// A filter for related items of type Contact. +type ContactFilter struct { + + // A list of channels to filter on for related items of type Contact. + Channel []string + + // A unique identifier of a contact in Amazon Connect. + ContactArn *string + + noSmithyDocumentSerde +} + +// Object for the summarized details of the domain. +type DomainSummary struct { + + // The Amazon Resource Name (ARN) of the domain. + // + // This member is required. + DomainArn *string + + // The unique identifier of the domain. + // + // This member is required. + DomainId *string + + // The name of the domain. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Configuration to enable EventBridge case event delivery and determine what data +// is delivered. +type EventBridgeConfiguration struct { + + // Indicates whether the to broadcast case event data to the customer. + // + // This member is required. + Enabled *bool + + // Details of what case and related item data is published through the case event + // stream. + IncludedData *EventIncludedData + + noSmithyDocumentSerde +} + +// Details of what case and related item data is published through the case event +// stream. +type EventIncludedData struct { + + // Details of what case data is published through the case event stream. + CaseData *CaseEventIncludedData + + // Details of what related item data is published through the case event stream. + RelatedItemData *RelatedItemEventIncludedData + + noSmithyDocumentSerde +} + +// Object for errors on fields. +type FieldError struct { + + // The error code from getting a field. + // + // This member is required. + ErrorCode *string + + // The field identifier that caused the error. + // + // This member is required. + Id *string + + // The error message from getting a field. + Message *string + + noSmithyDocumentSerde +} + +// A filter for fields. Only one value can be provided. +// +// The following types satisfy this interface: +// +// FieldFilterMemberContains +// FieldFilterMemberEqualTo +// FieldFilterMemberGreaterThan +// FieldFilterMemberGreaterThanOrEqualTo +// FieldFilterMemberLessThan +// FieldFilterMemberLessThanOrEqualTo +type FieldFilter interface { + isFieldFilter() +} + +// Object containing field identifier and value information. +type FieldFilterMemberContains struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberContains) isFieldFilter() {} + +// Object containing field identifier and value information. +type FieldFilterMemberEqualTo struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberEqualTo) isFieldFilter() {} + +// Object containing field identifier and value information. +type FieldFilterMemberGreaterThan struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberGreaterThan) isFieldFilter() {} + +// Object containing field identifier and value information. +type FieldFilterMemberGreaterThanOrEqualTo struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberGreaterThanOrEqualTo) isFieldFilter() {} + +// Object containing field identifier and value information. +type FieldFilterMemberLessThan struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberLessThan) isFieldFilter() {} + +// Object containing field identifier and value information. +type FieldFilterMemberLessThanOrEqualTo struct { + Value FieldValue + + noSmithyDocumentSerde +} + +func (*FieldFilterMemberLessThanOrEqualTo) isFieldFilter() {} + +// Object for a group of fields and associated properties. +type FieldGroup struct { + + // Represents an ordered list containing field related information. + // + // This member is required. + Fields []FieldItem + + // Name of the field group. + Name *string + + noSmithyDocumentSerde +} + +// Object for unique identifier of a field. +type FieldIdentifier struct { + + // Unique identifier of a field. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +// Object for field related information. +type FieldItem struct { + + // Unique identifier of a field. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +// Object for field Options information. +type FieldOption struct { + + // Describes whether the FieldOption is active (displayed) or inactive. + // + // This member is required. + Active *bool + + // FieldOptionName has max length 100 and disallows trailing spaces. + // + // This member is required. + Name *string + + // FieldOptionValue has max length 100 and must be alphanumeric with hyphens and + // underscores. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Object for field Options errors. +type FieldOptionError struct { + + // Error code from creating or updating field option. + // + // This member is required. + ErrorCode *string + + // Error message from creating or updating field option. + // + // This member is required. + Message *string + + // The field option value that caused the error. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Object for the summarized details of the field. +type FieldSummary struct { + + // The Amazon Resource Name (ARN) of the field. + // + // This member is required. + FieldArn *string + + // The unique identifier of a field. + // + // This member is required. + FieldId *string + + // Name of the field. + // + // This member is required. + Name *string + + // The namespace of a field. + // + // This member is required. + Namespace FieldNamespace + + // The type of a field. + // + // This member is required. + Type FieldType + + noSmithyDocumentSerde +} + +// Object for case field values. +type FieldValue struct { + + // Unique identifier of a field. + // + // This member is required. + Id *string + + // Union of potential field value types. + // + // This member is required. + Value FieldValueUnion + + noSmithyDocumentSerde +} + +// Object to store union of Field values. +// +// The following types satisfy this interface: +// +// FieldValueUnionMemberBooleanValue +// FieldValueUnionMemberDoubleValue +// FieldValueUnionMemberStringValue +type FieldValueUnion interface { + isFieldValueUnion() +} + +// Can be either null, or have a Boolean value type. Only one value can be +// provided. +type FieldValueUnionMemberBooleanValue struct { + Value bool + + noSmithyDocumentSerde +} + +func (*FieldValueUnionMemberBooleanValue) isFieldValueUnion() {} + +// Can be either null, or have a Double number value type. Only one value can be +// provided. +type FieldValueUnionMemberDoubleValue struct { + Value float64 + + noSmithyDocumentSerde +} + +func (*FieldValueUnionMemberDoubleValue) isFieldValueUnion() {} + +// String value type. +type FieldValueUnionMemberStringValue struct { + Value string + + noSmithyDocumentSerde +} + +func (*FieldValueUnionMemberStringValue) isFieldValueUnion() {} + +// Object to store detailed field information. +type GetFieldResponse struct { + + // The Amazon Resource Name (ARN) of the field. + // + // This member is required. + FieldArn *string + + // Unique identifier of the field. + // + // This member is required. + FieldId *string + + // Name of the field. + // + // This member is required. + Name *string + + // Namespace of the field. + // + // This member is required. + Namespace FieldNamespace + + // Type of the field. + // + // This member is required. + Type FieldType + + // Description of the field. + Description *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + noSmithyDocumentSerde +} + +// Object to store configuration of layouts associated to the template. +type LayoutConfiguration struct { + + // Unique identifier of a layout. + DefaultLayout *string + + noSmithyDocumentSerde +} + +// Object to store union of different versions of layout content. +// +// The following types satisfy this interface: +// +// LayoutContentMemberBasic +type LayoutContent interface { + isLayoutContent() +} + +// Content specific to BasicLayout type. It configures fields in the top panel and +// More Info tab of Cases user interface. +type LayoutContentMemberBasic struct { + Value BasicLayout + + noSmithyDocumentSerde +} + +func (*LayoutContentMemberBasic) isLayoutContent() {} + +// Ordered list containing different kinds of sections that can be added. A +// LayoutSections object can only contain one section. +type LayoutSections struct { + + // Ordered list containing different kinds of sections that can be added. + Sections []Section + + noSmithyDocumentSerde +} + +// Object for the summarized details of the layout. +type LayoutSummary struct { + + // The Amazon Resource Name (ARN) of the layout. + // + // This member is required. + LayoutArn *string + + // The unique identifier for of the layout. + // + // This member is required. + LayoutId *string + + // The name of the layout. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Represents the content of a particular type of related item. +// +// The following types satisfy this interface: +// +// RelatedItemContentMemberComment +// RelatedItemContentMemberContact +type RelatedItemContent interface { + isRelatedItemContent() +} + +// Represents the content of a comment to be returned to agents. +type RelatedItemContentMemberComment struct { + Value CommentContent + + noSmithyDocumentSerde +} + +func (*RelatedItemContentMemberComment) isRelatedItemContent() {} + +// Represents the content of a contact to be returned to agents. +type RelatedItemContentMemberContact struct { + Value ContactContent + + noSmithyDocumentSerde +} + +func (*RelatedItemContentMemberContact) isRelatedItemContent() {} + +// Details of what related item data is published through the case event stream. +type RelatedItemEventIncludedData struct { + + // Details of what related item data is published through the case event stream. + // + // This member is required. + IncludeContent *bool + + noSmithyDocumentSerde +} + +// Represents the content of a related item to be created. +// +// The following types satisfy this interface: +// +// RelatedItemInputContentMemberComment +// RelatedItemInputContentMemberContact +type RelatedItemInputContent interface { + isRelatedItemInputContent() +} + +// Represents the content of a comment to be returned to agents. +type RelatedItemInputContentMemberComment struct { + Value CommentContent + + noSmithyDocumentSerde +} + +func (*RelatedItemInputContentMemberComment) isRelatedItemInputContent() {} + +// Object representing a contact in Amazon Connect as an API request field. +type RelatedItemInputContentMemberContact struct { + Value Contact + + noSmithyDocumentSerde +} + +func (*RelatedItemInputContentMemberContact) isRelatedItemInputContent() {} + +// The list of types of related items and their parameters to use for filtering. +// +// The following types satisfy this interface: +// +// RelatedItemTypeFilterMemberComment +// RelatedItemTypeFilterMemberContact +type RelatedItemTypeFilter interface { + isRelatedItemTypeFilter() +} + +// A filter for related items of type Comment. +type RelatedItemTypeFilterMemberComment struct { + Value CommentFilter + + noSmithyDocumentSerde +} + +func (*RelatedItemTypeFilterMemberComment) isRelatedItemTypeFilter() {} + +// A filter for related items of type Contact. +type RelatedItemTypeFilterMemberContact struct { + Value ContactFilter + + noSmithyDocumentSerde +} + +func (*RelatedItemTypeFilterMemberContact) isRelatedItemTypeFilter() {} + +// List of fields that must have a value provided to create a case. +type RequiredField struct { + + // Unique identifier of a field. + // + // This member is required. + FieldId *string + + noSmithyDocumentSerde +} + +// A list of items that represent cases. +type SearchCasesResponseItem struct { + + // A unique identifier of the case. + // + // This member is required. + CaseId *string + + // List of case field values. + // + // This member is required. + Fields []FieldValue + + // A unique identifier of a template. + // + // This member is required. + TemplateId *string + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + noSmithyDocumentSerde +} + +// A list of items that represent RelatedItems. +type SearchRelatedItemsResponseItem struct { + + // Time at which a related item was associated with a case. + // + // This member is required. + AssociationTime *time.Time + + // Represents the content of a particular type of related item. + // + // This member is required. + Content RelatedItemContent + + // Unique identifier of a related item. + // + // This member is required. + RelatedItemId *string + + // Type of a related item. + // + // This member is required. + Type RelatedItemType + + // A map of of key-value pairs that represent tags on a resource. Tags are used to + // organize, track, or control access for this resource. + Tags map[string]*string + + noSmithyDocumentSerde +} + +// This represents a sections within a panel or tab of the page layout. +// +// The following types satisfy this interface: +// +// SectionMemberFieldGroup +type Section interface { + isSection() +} + +// Consists of a group of fields and associated properties. +type SectionMemberFieldGroup struct { + Value FieldGroup + + noSmithyDocumentSerde +} + +func (*SectionMemberFieldGroup) isSection() {} + +// A structured set of sort terms. +type Sort struct { + + // Unique identifier of a field. + // + // This member is required. + FieldId *string + + // A structured set of sort terms + // + // This member is required. + SortOrder Order + + noSmithyDocumentSerde +} + +// Template summary information. +type TemplateSummary struct { + + // The template name. + // + // This member is required. + Name *string + + // The Amazon Resource Name (ARN) of the template. + // + // This member is required. + TemplateArn *string + + // The unique identifier for the template. + // + // This member is required. + TemplateId *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isCaseFilter() {} +func (*UnknownUnionMember) isFieldFilter() {} +func (*UnknownUnionMember) isFieldValueUnion() {} +func (*UnknownUnionMember) isLayoutContent() {} +func (*UnknownUnionMember) isRelatedItemContent() {} +func (*UnknownUnionMember) isRelatedItemInputContent() {} +func (*UnknownUnionMember) isRelatedItemTypeFilter() {} +func (*UnknownUnionMember) isSection() {} diff --git a/service/connectcases/types/types_exported_test.go b/service/connectcases/types/types_exported_test.go new file mode 100644 index 00000000000..352d597913a --- /dev/null +++ b/service/connectcases/types/types_exported_test.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" +) + +func ExampleCaseFilter_outputUsage() { + var union types.CaseFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.CaseFilterMemberAndAll: + _ = v.Value // Value is []types.CaseFilter + + case *types.CaseFilterMemberField: + _ = v.Value // Value is types.FieldFilter + + case *types.CaseFilterMemberNot: + _ = v.Value // Value is types.CaseFilter + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ []types.CaseFilter +var _ types.CaseFilter +var _ types.FieldFilter + +func ExampleFieldFilter_outputUsage() { + var union types.FieldFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FieldFilterMemberContains: + _ = v.Value // Value is types.FieldValue + + case *types.FieldFilterMemberEqualTo: + _ = v.Value // Value is types.FieldValue + + case *types.FieldFilterMemberGreaterThan: + _ = v.Value // Value is types.FieldValue + + case *types.FieldFilterMemberGreaterThanOrEqualTo: + _ = v.Value // Value is types.FieldValue + + case *types.FieldFilterMemberLessThan: + _ = v.Value // Value is types.FieldValue + + case *types.FieldFilterMemberLessThanOrEqualTo: + _ = v.Value // Value is types.FieldValue + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FieldValue + +func ExampleFieldValueUnion_outputUsage() { + var union types.FieldValueUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FieldValueUnionMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.FieldValueUnionMemberDoubleValue: + _ = v.Value // Value is float64 + + case *types.FieldValueUnionMemberStringValue: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *string +var _ *bool +var _ *float64 + +func ExampleLayoutContent_outputUsage() { + var union types.LayoutContent + // type switches can be used to check the union value + switch v := union.(type) { + case *types.LayoutContentMemberBasic: + _ = v.Value // Value is types.BasicLayout + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.BasicLayout + +func ExampleRelatedItemContent_outputUsage() { + var union types.RelatedItemContent + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RelatedItemContentMemberComment: + _ = v.Value // Value is types.CommentContent + + case *types.RelatedItemContentMemberContact: + _ = v.Value // Value is types.ContactContent + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ContactContent +var _ *types.CommentContent + +func ExampleRelatedItemInputContent_outputUsage() { + var union types.RelatedItemInputContent + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RelatedItemInputContentMemberComment: + _ = v.Value // Value is types.CommentContent + + case *types.RelatedItemInputContentMemberContact: + _ = v.Value // Value is types.Contact + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CommentContent +var _ *types.Contact + +func ExampleRelatedItemTypeFilter_outputUsage() { + var union types.RelatedItemTypeFilter + // type switches can be used to check the union value + switch v := union.(type) { + case *types.RelatedItemTypeFilterMemberComment: + _ = v.Value // Value is types.CommentFilter + + case *types.RelatedItemTypeFilterMemberContact: + _ = v.Value // Value is types.ContactFilter + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ContactFilter +var _ *types.CommentFilter + +func ExampleSection_outputUsage() { + var union types.Section + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SectionMemberFieldGroup: + _ = v.Value // Value is types.FieldGroup + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.FieldGroup diff --git a/service/connectcases/validators.go b/service/connectcases/validators.go new file mode 100644 index 00000000000..4901db9c657 --- /dev/null +++ b/service/connectcases/validators.go @@ -0,0 +1,1806 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/connectcases/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpBatchGetField struct { +} + +func (*validateOpBatchGetField) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchGetField) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchGetFieldInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchGetFieldInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchPutFieldOptions struct { +} + +func (*validateOpBatchPutFieldOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchPutFieldOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchPutFieldOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchPutFieldOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateCase struct { +} + +func (*validateOpCreateCase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDomain struct { +} + +func (*validateOpCreateDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateField struct { +} + +func (*validateOpCreateField) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateField) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFieldInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFieldInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateLayout struct { +} + +func (*validateOpCreateLayout) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateLayout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateLayoutInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateLayoutInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateRelatedItem struct { +} + +func (*validateOpCreateRelatedItem) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRelatedItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRelatedItemInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRelatedItemInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTemplate struct { +} + +func (*validateOpCreateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCaseEventConfiguration struct { +} + +func (*validateOpGetCaseEventConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCaseEventConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCaseEventConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCaseEventConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCase struct { +} + +func (*validateOpGetCase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDomain struct { +} + +func (*validateOpGetDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetLayout struct { +} + +func (*validateOpGetLayout) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLayout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLayoutInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLayoutInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetTemplate struct { +} + +func (*validateOpGetTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListCasesForContact struct { +} + +func (*validateOpListCasesForContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListCasesForContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListCasesForContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListCasesForContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListFieldOptions struct { +} + +func (*validateOpListFieldOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFieldOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFieldOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFieldOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListFields struct { +} + +func (*validateOpListFields) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListFields) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListFieldsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListFieldsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListLayouts struct { +} + +func (*validateOpListLayouts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListLayouts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListLayoutsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListLayoutsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTemplates struct { +} + +func (*validateOpListTemplates) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTemplatesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTemplatesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutCaseEventConfiguration struct { +} + +func (*validateOpPutCaseEventConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutCaseEventConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutCaseEventConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutCaseEventConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchCases struct { +} + +func (*validateOpSearchCases) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchCases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchCasesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchCasesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchRelatedItems struct { +} + +func (*validateOpSearchRelatedItems) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchRelatedItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchRelatedItemsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchRelatedItemsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateCase struct { +} + +func (*validateOpUpdateCase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateField struct { +} + +func (*validateOpUpdateField) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateField) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateFieldInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateFieldInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateLayout struct { +} + +func (*validateOpUpdateLayout) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLayout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLayoutInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLayoutInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateTemplate struct { +} + +func (*validateOpUpdateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpBatchGetFieldValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchGetField{}, middleware.After) +} + +func addOpBatchPutFieldOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchPutFieldOptions{}, middleware.After) +} + +func addOpCreateCaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCase{}, middleware.After) +} + +func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After) +} + +func addOpCreateFieldValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateField{}, middleware.After) +} + +func addOpCreateLayoutValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateLayout{}, middleware.After) +} + +func addOpCreateRelatedItemValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRelatedItem{}, middleware.After) +} + +func addOpCreateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTemplate{}, middleware.After) +} + +func addOpGetCaseEventConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCaseEventConfiguration{}, middleware.After) +} + +func addOpGetCaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCase{}, middleware.After) +} + +func addOpGetDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDomain{}, middleware.After) +} + +func addOpGetLayoutValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLayout{}, middleware.After) +} + +func addOpGetTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTemplate{}, middleware.After) +} + +func addOpListCasesForContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListCasesForContact{}, middleware.After) +} + +func addOpListFieldOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFieldOptions{}, middleware.After) +} + +func addOpListFieldsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListFields{}, middleware.After) +} + +func addOpListLayoutsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListLayouts{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpListTemplatesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTemplates{}, middleware.After) +} + +func addOpPutCaseEventConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutCaseEventConfiguration{}, middleware.After) +} + +func addOpSearchCasesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchCases{}, middleware.After) +} + +func addOpSearchRelatedItemsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchRelatedItems{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateCaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCase{}, middleware.After) +} + +func addOpUpdateFieldValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateField{}, middleware.After) +} + +func addOpUpdateLayoutValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLayout{}, middleware.After) +} + +func addOpUpdateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateTemplate{}, middleware.After) +} + +func validateBasicLayout(v *types.BasicLayout) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BasicLayout"} + if v.TopPanel != nil { + if err := validateLayoutSections(v.TopPanel); err != nil { + invalidParams.AddNested("TopPanel", err.(smithy.InvalidParamsError)) + } + } + if v.MoreInfo != nil { + if err := validateLayoutSections(v.MoreInfo); err != nil { + invalidParams.AddNested("MoreInfo", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateBatchGetFieldIdentifierList(v []types.FieldIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetFieldIdentifierList"} + for i := range v { + if err := validateFieldIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCaseEventIncludedData(v *types.CaseEventIncludedData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CaseEventIncludedData"} + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateFieldIdentifierList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCaseFilter(v types.CaseFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CaseFilter"} + switch uv := v.(type) { + case *types.CaseFilterMemberAndAll: + if err := validateCaseFilterList(uv.Value); err != nil { + invalidParams.AddNested("[andAll]", err.(smithy.InvalidParamsError)) + } + + case *types.CaseFilterMemberField: + if err := validateFieldFilter(uv.Value); err != nil { + invalidParams.AddNested("[field]", err.(smithy.InvalidParamsError)) + } + + case *types.CaseFilterMemberNot: + if err := validateCaseFilter(uv.Value); err != nil { + invalidParams.AddNested("[not]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCaseFilterList(v []types.CaseFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CaseFilterList"} + for i := range v { + if err := validateCaseFilter(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommentContent(v *types.CommentContent) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommentContent"} + if v.Body == nil { + invalidParams.Add(smithy.NewErrParamRequired("Body")) + } + if len(v.ContentType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ContentType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContact(v *types.Contact) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Contact"} + if v.ContactArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventBridgeConfiguration(v *types.EventBridgeConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventBridgeConfiguration"} + if v.Enabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("Enabled")) + } + if v.IncludedData != nil { + if err := validateEventIncludedData(v.IncludedData); err != nil { + invalidParams.AddNested("IncludedData", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventIncludedData(v *types.EventIncludedData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventIncludedData"} + if v.CaseData != nil { + if err := validateCaseEventIncludedData(v.CaseData); err != nil { + invalidParams.AddNested("CaseData", err.(smithy.InvalidParamsError)) + } + } + if v.RelatedItemData != nil { + if err := validateRelatedItemEventIncludedData(v.RelatedItemData); err != nil { + invalidParams.AddNested("RelatedItemData", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldFilter(v types.FieldFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldFilter"} + switch uv := v.(type) { + case *types.FieldFilterMemberContains: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[contains]", err.(smithy.InvalidParamsError)) + } + + case *types.FieldFilterMemberEqualTo: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[equalTo]", err.(smithy.InvalidParamsError)) + } + + case *types.FieldFilterMemberGreaterThan: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[greaterThan]", err.(smithy.InvalidParamsError)) + } + + case *types.FieldFilterMemberGreaterThanOrEqualTo: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[greaterThanOrEqualTo]", err.(smithy.InvalidParamsError)) + } + + case *types.FieldFilterMemberLessThan: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[lessThan]", err.(smithy.InvalidParamsError)) + } + + case *types.FieldFilterMemberLessThanOrEqualTo: + if err := validateFieldValue(&uv.Value); err != nil { + invalidParams.AddNested("[lessThanOrEqualTo]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldGroup(v *types.FieldGroup) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldGroup"} + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateFieldList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldIdentifier(v *types.FieldIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldIdentifier"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldIdentifierList(v []types.FieldIdentifier) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldIdentifierList"} + for i := range v { + if err := validateFieldIdentifier(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldItem(v *types.FieldItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldItem"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldList(v []types.FieldItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldList"} + for i := range v { + if err := validateFieldItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldOption(v *types.FieldOption) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldOption"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if v.Active == nil { + invalidParams.Add(smithy.NewErrParamRequired("Active")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldOptionsList(v []types.FieldOption) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldOptionsList"} + for i := range v { + if err := validateFieldOption(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldValue(v *types.FieldValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldValue"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldValueList(v []types.FieldValue) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldValueList"} + for i := range v { + if err := validateFieldValue(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLayoutContent(v types.LayoutContent) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LayoutContent"} + switch uv := v.(type) { + case *types.LayoutContentMemberBasic: + if err := validateBasicLayout(&uv.Value); err != nil { + invalidParams.AddNested("[basic]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLayoutSections(v *types.LayoutSections) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LayoutSections"} + if v.Sections != nil { + if err := validateSectionsList(v.Sections); err != nil { + invalidParams.AddNested("Sections", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRelatedItemEventIncludedData(v *types.RelatedItemEventIncludedData) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RelatedItemEventIncludedData"} + if v.IncludeContent == nil { + invalidParams.Add(smithy.NewErrParamRequired("IncludeContent")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRelatedItemInputContent(v types.RelatedItemInputContent) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RelatedItemInputContent"} + switch uv := v.(type) { + case *types.RelatedItemInputContentMemberComment: + if err := validateCommentContent(&uv.Value); err != nil { + invalidParams.AddNested("[comment]", err.(smithy.InvalidParamsError)) + } + + case *types.RelatedItemInputContentMemberContact: + if err := validateContact(&uv.Value); err != nil { + invalidParams.AddNested("[contact]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRequiredField(v *types.RequiredField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequiredField"} + if v.FieldId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRequiredFieldList(v []types.RequiredField) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequiredFieldList"} + for i := range v { + if err := validateRequiredField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSection(v types.Section) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Section"} + switch uv := v.(type) { + case *types.SectionMemberFieldGroup: + if err := validateFieldGroup(&uv.Value); err != nil { + invalidParams.AddNested("[fieldGroup]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSectionsList(v []types.Section) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SectionsList"} + for i := range v { + if err := validateSection(v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSort(v *types.Sort) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Sort"} + if v.FieldId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldId")) + } + if len(v.SortOrder) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("SortOrder")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSortList(v []types.Sort) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SortList"} + for i := range v { + if err := validateSort(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchGetFieldInput(v *BatchGetFieldInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchGetFieldInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateBatchGetFieldIdentifierList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchPutFieldOptionsInput(v *BatchPutFieldOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchPutFieldOptionsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.FieldId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldId")) + } + if v.Options == nil { + invalidParams.Add(smithy.NewErrParamRequired("Options")) + } else if v.Options != nil { + if err := validateFieldOptionsList(v.Options); err != nil { + invalidParams.AddNested("Options", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateCaseInput(v *CreateCaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCaseInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.TemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateId")) + } + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateFieldValueList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDomainInput(v *CreateDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDomainInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateFieldInput(v *CreateFieldInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFieldInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLayoutInput(v *CreateLayoutInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLayoutInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } else if v.Content != nil { + if err := validateLayoutContent(v.Content); err != nil { + invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateRelatedItemInput(v *CreateRelatedItemInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRelatedItemInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.CaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaseId")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Content == nil { + invalidParams.Add(smithy.NewErrParamRequired("Content")) + } else if v.Content != nil { + if err := validateRelatedItemInputContent(v.Content); err != nil { + invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTemplateInput(v *CreateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTemplateInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.RequiredFields != nil { + if err := validateRequiredFieldList(v.RequiredFields); err != nil { + invalidParams.AddNested("RequiredFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCaseEventConfigurationInput(v *GetCaseEventConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCaseEventConfigurationInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCaseInput(v *GetCaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCaseInput"} + if v.CaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaseId")) + } + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateFieldIdentifierList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDomainInput(v *GetDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDomainInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetLayoutInput(v *GetLayoutInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLayoutInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.LayoutId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LayoutId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetTemplateInput(v *GetTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTemplateInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.TemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListCasesForContactInput(v *ListCasesForContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListCasesForContactInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.ContactArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListFieldOptionsInput(v *ListFieldOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFieldOptionsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.FieldId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListFieldsInput(v *ListFieldsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListFieldsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListLayoutsInput(v *ListLayoutsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListLayoutsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTemplatesInput(v *ListTemplatesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTemplatesInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutCaseEventConfigurationInput(v *PutCaseEventConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutCaseEventConfigurationInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.EventBridge == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventBridge")) + } else if v.EventBridge != nil { + if err := validateEventBridgeConfiguration(v.EventBridge); err != nil { + invalidParams.AddNested("EventBridge", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchCasesInput(v *SearchCasesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchCasesInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.Filter != nil { + if err := validateCaseFilter(v.Filter); err != nil { + invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) + } + } + if v.Sorts != nil { + if err := validateSortList(v.Sorts); err != nil { + invalidParams.AddNested("Sorts", err.(smithy.InvalidParamsError)) + } + } + if v.Fields != nil { + if err := validateFieldIdentifierList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchRelatedItemsInput(v *SearchRelatedItemsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchRelatedItemsInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.CaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaseId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateCaseInput(v *UpdateCaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCaseInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.CaseId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CaseId")) + } + if v.Fields == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fields")) + } else if v.Fields != nil { + if err := validateFieldValueList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateFieldInput(v *UpdateFieldInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFieldInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.FieldId == nil { + invalidParams.Add(smithy.NewErrParamRequired("FieldId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateLayoutInput(v *UpdateLayoutInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLayoutInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.LayoutId == nil { + invalidParams.Add(smithy.NewErrParamRequired("LayoutId")) + } + if v.Content != nil { + if err := validateLayoutContent(v.Content); err != nil { + invalidParams.AddNested("Content", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateTemplateInput(v *UpdateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateTemplateInput"} + if v.DomainId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainId")) + } + if v.TemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateId")) + } + if v.RequiredFields != nil { + if err := validateRequiredFieldList(v.RequiredFields); err != nil { + invalidParams.AddNested("RequiredFields", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/ec2/api_op_DescribeVpcAttribute.go b/service/ec2/api_op_DescribeVpcAttribute.go index 5366700db6d..84c33effa65 100644 --- a/service/ec2/api_op_DescribeVpcAttribute.go +++ b/service/ec2/api_op_DescribeVpcAttribute.go @@ -61,6 +61,9 @@ type DescribeVpcAttributeOutput struct { // corresponding IP addresses; otherwise, it does not. EnableDnsSupport *types.AttributeBooleanValue + // Indicates whether Network Address Usage metrics are enabled for your VPC. + EnableNetworkAddressUsageMetrics *types.AttributeBooleanValue + // The ID of the VPC. VpcId *string diff --git a/service/ec2/api_op_ModifyVpcAttribute.go b/service/ec2/api_op_ModifyVpcAttribute.go index 7213abe9129..e76cc83ce95 100644 --- a/service/ec2/api_op_ModifyVpcAttribute.go +++ b/service/ec2/api_op_ModifyVpcAttribute.go @@ -50,6 +50,9 @@ type ModifyVpcAttributeInput struct { // attribute. EnableDnsSupport *types.AttributeBooleanValue + // Indicates whether Network Address Usage metrics are enabled for your VPC. + EnableNetworkAddressUsageMetrics *types.AttributeBooleanValue + noSmithyDocumentSerde } diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 98a39ca810f..2ed46827606 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -137776,6 +137776,12 @@ func awsEc2query_deserializeOpDocumentDescribeVpcAttributeOutput(v **DescribeVpc return err } + case strings.EqualFold("enableNetworkAddressUsageMetrics", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAttributeBooleanValue(&sv.EnableNetworkAddressUsageMetrics, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("vpcId", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index b2cb7e8456f..220445d6c3f 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -58253,6 +58253,13 @@ func awsEc2query_serializeOpDocumentModifyVpcAttributeInput(v *ModifyVpcAttribut } } + if v.EnableNetworkAddressUsageMetrics != nil { + objectKey := object.Key("EnableNetworkAddressUsageMetrics") + if err := awsEc2query_serializeDocumentAttributeBooleanValue(v.EnableNetworkAddressUsageMetrics, objectKey); err != nil { + return err + } + } + if v.VpcId != nil { objectKey := object.Key("VpcId") objectKey.String(*v.VpcId) diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 87b46a019d9..fb56f62db30 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -7050,8 +7050,9 @@ type VpcAttributeName string // Enum values for VpcAttributeName const ( - VpcAttributeNameEnableDnsSupport VpcAttributeName = "enableDnsSupport" - VpcAttributeNameEnableDnsHostnames VpcAttributeName = "enableDnsHostnames" + VpcAttributeNameEnableDnsSupport VpcAttributeName = "enableDnsSupport" + VpcAttributeNameEnableDnsHostnames VpcAttributeName = "enableDnsHostnames" + VpcAttributeNameEnableNetworkAddressUsageMetrics VpcAttributeName = "enableNetworkAddressUsageMetrics" ) // Values returns all known values for VpcAttributeName. Note that this can be @@ -7061,6 +7062,7 @@ func (VpcAttributeName) Values() []VpcAttributeName { return []VpcAttributeName{ "enableDnsSupport", "enableDnsHostnames", + "enableNetworkAddressUsageMetrics", } } diff --git a/service/ecs/api_op_PutAccountSettingDefault.go b/service/ecs/api_op_PutAccountSettingDefault.go index 6037b210ee2..7a5bb41bb8b 100644 --- a/service/ecs/api_op_PutAccountSettingDefault.go +++ b/service/ecs/api_op_PutAccountSettingDefault.go @@ -38,7 +38,12 @@ type PutAccountSettingDefaultInput struct { // the ARN and resource ID for your Amazon ECS container instances is affected. If // awsvpcTrunking is specified, the ENI limit for your Amazon ECS container // instances is affected. If containerInsights is specified, the default setting - // for CloudWatch Container Insights for your clusters is affected. + // for CloudWatch Container Insights for your clusters is affected. Fargate is + // transitioning from task count-based quotas to vCPU-based quotas. You can set the + // name to fargateVCPULimit to opt in or opt out of the vCPU-based quotas. For + // information about the opt in timeline, see Fargate vCPU-based quotas timeline + // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#fargate-quota-timeline) + // in the Amazon ECS Developer Guide. // // This member is required. Name types.SettingName diff --git a/service/ecs/api_op_RegisterTaskDefinition.go b/service/ecs/api_op_RegisterTaskDefinition.go index 6d27854b050..e1a84ab019f 100644 --- a/service/ecs/api_op_RegisterTaskDefinition.go +++ b/service/ecs/api_op_RegisterTaskDefinition.go @@ -113,8 +113,6 @@ type RegisterTaskDefinitionInput struct { // // * Linux platform // version 1.4.0 or later. - // - // * Windows platform version 1.0.0 or later. EphemeralStorage *types.EphemeralStorage // The Amazon Resource Name (ARN) of the task execution role that grants the Amazon diff --git a/service/ecs/types/types.go b/service/ecs/types/types.go index 979035a25f9..fecfecb0cab 100644 --- a/service/ecs/types/types.go +++ b/service/ecs/types/types.go @@ -2608,16 +2608,14 @@ type PortMapping struct { // the default ephemeral port range from 49153 through 65535 is used. Do not // attempt to specify a host port in the ephemeral port range as these are reserved // for automatic assignment. In general, ports below 32768 are outside of the - // ephemeral port range. The default ephemeral port range from 49153 through 65535 - // is always used for Docker versions before 1.6.0. The default reserved ports are - // 22 for SSH, the Docker ports 2375 and 2376, and the Amazon ECS container agent - // ports 51678-51680. Any host port that was previously specified in a running task - // is also reserved while the task is running. That is, after a task stops, the - // host port is released. The current reserved ports are displayed in the - // remainingResources of DescribeContainerInstances output. A container instance - // can have up to 100 reserved ports at a time. This number includes the default - // reserved ports. Automatically assigned ports aren't included in the 100 reserved - // ports quota. + // ephemeral port range. The default reserved ports are 22 for SSH, the Docker + // ports 2375 and 2376, and the Amazon ECS container agent ports 51678-51680. Any + // host port that was previously specified in a running task is also reserved while + // the task is running. That is, after a task stops, the host port is released. The + // current reserved ports are displayed in the remainingResources of + // DescribeContainerInstances output. A container instance can have up to 100 + // reserved ports at a time. This number includes the default reserved ports. + // Automatically assigned ports aren't included in the 100 reserved ports quota. HostPort *int32 // The protocol used for the port mapping. Valid values are tcp and udp. The diff --git a/service/s3control/types/enums.go b/service/s3control/types/enums.go index 20348020a55..c466886c2a7 100644 --- a/service/s3control/types/enums.go +++ b/service/s3control/types/enums.go @@ -348,8 +348,10 @@ type ObjectLambdaAllowedFeature string // Enum values for ObjectLambdaAllowedFeature const ( - ObjectLambdaAllowedFeatureGetObjectRange ObjectLambdaAllowedFeature = "GetObject-Range" - ObjectLambdaAllowedFeatureGetObjectPartNumber ObjectLambdaAllowedFeature = "GetObject-PartNumber" + ObjectLambdaAllowedFeatureGetObjectRange ObjectLambdaAllowedFeature = "GetObject-Range" + ObjectLambdaAllowedFeatureGetObjectPartNumber ObjectLambdaAllowedFeature = "GetObject-PartNumber" + ObjectLambdaAllowedFeatureHeadObjectRange ObjectLambdaAllowedFeature = "HeadObject-Range" + ObjectLambdaAllowedFeatureHeadObjectPartNumber ObjectLambdaAllowedFeature = "HeadObject-PartNumber" ) // Values returns all known values for ObjectLambdaAllowedFeature. Note that this @@ -359,6 +361,8 @@ func (ObjectLambdaAllowedFeature) Values() []ObjectLambdaAllowedFeature { return []ObjectLambdaAllowedFeature{ "GetObject-Range", "GetObject-PartNumber", + "HeadObject-Range", + "HeadObject-PartNumber", } } @@ -366,7 +370,10 @@ type ObjectLambdaTransformationConfigurationAction string // Enum values for ObjectLambdaTransformationConfigurationAction const ( - ObjectLambdaTransformationConfigurationActionGetObject ObjectLambdaTransformationConfigurationAction = "GetObject" + ObjectLambdaTransformationConfigurationActionGetObject ObjectLambdaTransformationConfigurationAction = "GetObject" + ObjectLambdaTransformationConfigurationActionHeadObject ObjectLambdaTransformationConfigurationAction = "HeadObject" + ObjectLambdaTransformationConfigurationActionListObjects ObjectLambdaTransformationConfigurationAction = "ListObjects" + ObjectLambdaTransformationConfigurationActionListObjectsV2 ObjectLambdaTransformationConfigurationAction = "ListObjectsV2" ) // Values returns all known values for @@ -376,6 +383,9 @@ const ( func (ObjectLambdaTransformationConfigurationAction) Values() []ObjectLambdaTransformationConfigurationAction { return []ObjectLambdaTransformationConfigurationAction{ "GetObject", + "HeadObject", + "ListObjects", + "ListObjectsV2", } } diff --git a/service/workmail/api_op_AssumeImpersonationRole.go b/service/workmail/api_op_AssumeImpersonationRole.go new file mode 100644 index 00000000000..71006f2a132 --- /dev/null +++ b/service/workmail/api_op_AssumeImpersonationRole.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assumes an impersonation role for the given WorkMail organization. This method +// returns an authentication token you can use to make impersonated calls. +func (c *Client) AssumeImpersonationRole(ctx context.Context, params *AssumeImpersonationRoleInput, optFns ...func(*Options)) (*AssumeImpersonationRoleOutput, error) { + if params == nil { + params = &AssumeImpersonationRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeImpersonationRole", params, optFns, c.addOperationAssumeImpersonationRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeImpersonationRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeImpersonationRoleInput struct { + + // The impersonation role ID to assume. + // + // This member is required. + ImpersonationRoleId *string + + // The WorkMail organization under which the impersonation role will be assumed. + // + // This member is required. + OrganizationId *string + + noSmithyDocumentSerde +} + +type AssumeImpersonationRoleOutput struct { + + // The authentication token's validity, in seconds. + ExpiresIn *int64 + + // The authentication token for the impersonation role. + Token *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeImpersonationRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssumeImpersonationRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssumeImpersonationRole{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssumeImpersonationRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeImpersonationRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssumeImpersonationRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "AssumeImpersonationRole", + } +} diff --git a/service/workmail/api_op_CreateAlias.go b/service/workmail/api_op_CreateAlias.go index 178a2df6cc1..3f06bc99d0a 100644 --- a/service/workmail/api_op_CreateAlias.go +++ b/service/workmail/api_op_CreateAlias.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds an alias to the set of a given member (user or group) of Amazon WorkMail. +// Adds an alias to the set of a given member (user or group) of WorkMail. func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optFns ...func(*Options)) (*CreateAliasOutput, error) { if params == nil { params = &CreateAliasInput{} diff --git a/service/workmail/api_op_CreateAvailabilityConfiguration.go b/service/workmail/api_op_CreateAvailabilityConfiguration.go index 786ab9999c7..675236be5b2 100644 --- a/service/workmail/api_op_CreateAvailabilityConfiguration.go +++ b/service/workmail/api_op_CreateAvailabilityConfiguration.go @@ -36,7 +36,7 @@ type CreateAvailabilityConfigurationInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which the AvailabilityConfiguration will be + // The WorkMail organization for which the AvailabilityConfiguration will be // created. // // This member is required. diff --git a/service/workmail/api_op_CreateGroup.go b/service/workmail/api_op_CreateGroup.go index 3c18013851c..c6257f8e885 100644 --- a/service/workmail/api_op_CreateGroup.go +++ b/service/workmail/api_op_CreateGroup.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a group that can be used in Amazon WorkMail by calling the -// RegisterToWorkMail operation. +// Creates a group that can be used in WorkMail by calling the RegisterToWorkMail +// operation. func (c *Client) CreateGroup(ctx context.Context, params *CreateGroupInput, optFns ...func(*Options)) (*CreateGroupOutput, error) { if params == nil { params = &CreateGroupInput{} diff --git a/service/workmail/api_op_CreateImpersonationRole.go b/service/workmail/api_op_CreateImpersonationRole.go new file mode 100644 index 00000000000..b302a3edc0d --- /dev/null +++ b/service/workmail/api_op_CreateImpersonationRole.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an impersonation role for the given WorkMail organization. Idempotency +// ensures that an API request completes no more than one time. With an idempotent +// request, if the original request completes successfully, any subsequent retries +// also complete successfully without performing any further actions. +func (c *Client) CreateImpersonationRole(ctx context.Context, params *CreateImpersonationRoleInput, optFns ...func(*Options)) (*CreateImpersonationRoleOutput, error) { + if params == nil { + params = &CreateImpersonationRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateImpersonationRole", params, optFns, c.addOperationCreateImpersonationRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateImpersonationRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateImpersonationRoleInput struct { + + // The name of the new impersonation role. + // + // This member is required. + Name *string + + // The WorkMail organization to create the new impersonation role within. + // + // This member is required. + OrganizationId *string + + // The list of rules for the impersonation role. + // + // This member is required. + Rules []types.ImpersonationRule + + // The impersonation role's type. The available impersonation role types are + // READ_ONLY or FULL_ACCESS. + // + // This member is required. + Type types.ImpersonationRoleType + + // The idempotency token for the client request. + ClientToken *string + + // The description of the new impersonation role. + Description *string + + noSmithyDocumentSerde +} + +type CreateImpersonationRoleOutput struct { + + // The new impersonation role ID. + ImpersonationRoleId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateImpersonationRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateImpersonationRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateImpersonationRole{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateImpersonationRoleMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateImpersonationRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateImpersonationRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateImpersonationRole struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateImpersonationRole) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateImpersonationRoleInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateImpersonationRoleMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateImpersonationRole{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateImpersonationRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "CreateImpersonationRole", + } +} diff --git a/service/workmail/api_op_CreateMobileDeviceAccessRule.go b/service/workmail/api_op_CreateMobileDeviceAccessRule.go index 0041493688c..84fff3cd36e 100644 --- a/service/workmail/api_op_CreateMobileDeviceAccessRule.go +++ b/service/workmail/api_op_CreateMobileDeviceAccessRule.go @@ -12,8 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new mobile device access rule for the specified Amazon WorkMail -// organization. +// Creates a new mobile device access rule for the specified WorkMail organization. func (c *Client) CreateMobileDeviceAccessRule(ctx context.Context, params *CreateMobileDeviceAccessRuleInput, optFns ...func(*Options)) (*CreateMobileDeviceAccessRuleOutput, error) { if params == nil { params = &CreateMobileDeviceAccessRuleInput{} @@ -41,7 +40,7 @@ type CreateMobileDeviceAccessRuleInput struct { // This member is required. Name *string - // The Amazon WorkMail organization under which the rule will be created. + // The WorkMail organization under which the rule will be created. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_CreateOrganization.go b/service/workmail/api_op_CreateOrganization.go index 3879a81705c..6df359e5c7c 100644 --- a/service/workmail/api_op_CreateOrganization.go +++ b/service/workmail/api_op_CreateOrganization.go @@ -12,24 +12,24 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new Amazon WorkMail organization. Optionally, you can choose to -// associate an existing AWS Directory Service directory with your organization. If -// an AWS Directory Service directory ID is specified, the organization alias must -// match the directory alias. If you choose not to associate an existing directory -// with your organization, then we create a new Amazon WorkMail directory for you. -// For more information, see Adding an organization +// Creates a new WorkMail organization. Optionally, you can choose to associate an +// existing AWS Directory Service directory with your organization. If an AWS +// Directory Service directory ID is specified, the organization alias must match +// the directory alias. If you choose not to associate an existing directory with +// your organization, then we create a new WorkMail directory for you. For more +// information, see Adding an organization // (https://docs.aws.amazon.com/workmail/latest/adminguide/add_new_organization.html) -// in the Amazon WorkMail Administrator Guide. You can associate multiple email -// domains with an organization, then set your default email domain from the Amazon -// WorkMail console. You can also associate a domain that is managed in an Amazon -// Route 53 public hosted zone. For more information, see Adding a domain +// in the WorkMail Administrator Guide. You can associate multiple email domains +// with an organization, then choose your default email domain from the WorkMail +// console. You can also associate a domain that is managed in an Amazon Route 53 +// public hosted zone. For more information, see Adding a domain // (https://docs.aws.amazon.com/workmail/latest/adminguide/add_domain.html) and // Choosing the default domain // (https://docs.aws.amazon.com/workmail/latest/adminguide/default_domain.html) in -// the Amazon WorkMail Administrator Guide. Optionally, you can use a customer -// managed master key from AWS Key Management Service (AWS KMS) to encrypt email -// for your organization. If you don't associate an AWS KMS key, Amazon WorkMail -// creates a default AWS managed master key for you. +// the WorkMail Administrator Guide. Optionally, you can use a customer managed key +// from AWS Key Management Service (AWS KMS) to encrypt email for your +// organization. If you don't associate an AWS KMS key, WorkMail creates a default, +// AWS managed key for you. func (c *Client) CreateOrganization(ctx context.Context, params *CreateOrganizationInput, optFns ...func(*Options)) (*CreateOrganizationOutput, error) { if params == nil { params = &CreateOrganizationInput{} @@ -61,12 +61,11 @@ type CreateOrganizationInput struct { // The email domains to associate with the organization. Domains []types.Domain - // When true, allows organization interoperability between Amazon WorkMail and - // Microsoft Exchange. Can only be set to true if an AD Connector directory ID is - // included in the request. + // When true, allows organization interoperability between WorkMail and Microsoft + // Exchange. If true, you must include a AD Connector directory ID in the request. EnableInteroperability bool - // The Amazon Resource Name (ARN) of a customer managed master key from AWS KMS. + // The Amazon Resource Name (ARN) of a customer managed key from AWS KMS. KmsKeyArn *string noSmithyDocumentSerde diff --git a/service/workmail/api_op_CreateResource.go b/service/workmail/api_op_CreateResource.go index 88ce133cdcf..d06d675eba4 100644 --- a/service/workmail/api_op_CreateResource.go +++ b/service/workmail/api_op_CreateResource.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new Amazon WorkMail resource. +// Creates a new WorkMail resource. func (c *Client) CreateResource(ctx context.Context, params *CreateResourceInput, optFns ...func(*Options)) (*CreateResourceOutput, error) { if params == nil { params = &CreateResourceInput{} diff --git a/service/workmail/api_op_CreateUser.go b/service/workmail/api_op_CreateUser.go index bd97a48f550..635555ddf17 100644 --- a/service/workmail/api_op_CreateUser.go +++ b/service/workmail/api_op_CreateUser.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a user who can be used in Amazon WorkMail by calling the -// RegisterToWorkMail operation. +// Creates a user who can be used in WorkMail by calling the RegisterToWorkMail +// operation. func (c *Client) CreateUser(ctx context.Context, params *CreateUserInput, optFns ...func(*Options)) (*CreateUserOutput, error) { if params == nil { params = &CreateUserInput{} diff --git a/service/workmail/api_op_DeleteAvailabilityConfiguration.go b/service/workmail/api_op_DeleteAvailabilityConfiguration.go index 0fef467b8f3..0668e4ad3c3 100644 --- a/service/workmail/api_op_DeleteAvailabilityConfiguration.go +++ b/service/workmail/api_op_DeleteAvailabilityConfiguration.go @@ -34,7 +34,7 @@ type DeleteAvailabilityConfigurationInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which the AvailabilityConfiguration will be + // The WorkMail organization for which the AvailabilityConfiguration will be // deleted. // // This member is required. diff --git a/service/workmail/api_op_DeleteGroup.go b/service/workmail/api_op_DeleteGroup.go index 82c86f1d46f..62e684f754d 100644 --- a/service/workmail/api_op_DeleteGroup.go +++ b/service/workmail/api_op_DeleteGroup.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a group from Amazon WorkMail. +// Deletes a group from WorkMail. func (c *Client) DeleteGroup(ctx context.Context, params *DeleteGroupInput, optFns ...func(*Options)) (*DeleteGroupOutput, error) { if params == nil { params = &DeleteGroupInput{} diff --git a/service/workmail/api_op_DeleteImpersonationRole.go b/service/workmail/api_op_DeleteImpersonationRole.go new file mode 100644 index 00000000000..3dfde49fa22 --- /dev/null +++ b/service/workmail/api_op_DeleteImpersonationRole.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an impersonation role for the given WorkMail organization. +func (c *Client) DeleteImpersonationRole(ctx context.Context, params *DeleteImpersonationRoleInput, optFns ...func(*Options)) (*DeleteImpersonationRoleOutput, error) { + if params == nil { + params = &DeleteImpersonationRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteImpersonationRole", params, optFns, c.addOperationDeleteImpersonationRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteImpersonationRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteImpersonationRoleInput struct { + + // The ID of the impersonation role to delete. + // + // This member is required. + ImpersonationRoleId *string + + // The WorkMail organization from which to delete the impersonation role. + // + // This member is required. + OrganizationId *string + + noSmithyDocumentSerde +} + +type DeleteImpersonationRoleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteImpersonationRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteImpersonationRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteImpersonationRole{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteImpersonationRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteImpersonationRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteImpersonationRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DeleteImpersonationRole", + } +} diff --git a/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go b/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go index 71f6aa60f91..1a455087398 100644 --- a/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go +++ b/service/workmail/api_op_DeleteMobileDeviceAccessOverride.go @@ -37,7 +37,7 @@ type DeleteMobileDeviceAccessOverrideInput struct { // This member is required. DeviceId *string - // The Amazon WorkMail organization for which the access override will be deleted. + // The WorkMail organization for which the access override will be deleted. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_DeleteMobileDeviceAccessRule.go b/service/workmail/api_op_DeleteMobileDeviceAccessRule.go index 0b9b44b337c..b246249b5eb 100644 --- a/service/workmail/api_op_DeleteMobileDeviceAccessRule.go +++ b/service/workmail/api_op_DeleteMobileDeviceAccessRule.go @@ -10,10 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a mobile device access rule for the specified Amazon WorkMail -// organization. Deleting already deleted and non-existing rules does not produce -// an error. In those cases, the service sends back an HTTP 200 response with an -// empty HTTP body. +// Deletes a mobile device access rule for the specified WorkMail organization. +// Deleting already deleted and non-existing rules does not produce an error. In +// those cases, the service sends back an HTTP 200 response with an empty HTTP +// body. func (c *Client) DeleteMobileDeviceAccessRule(ctx context.Context, params *DeleteMobileDeviceAccessRuleInput, optFns ...func(*Options)) (*DeleteMobileDeviceAccessRuleOutput, error) { if params == nil { params = &DeleteMobileDeviceAccessRuleInput{} @@ -36,7 +36,7 @@ type DeleteMobileDeviceAccessRuleInput struct { // This member is required. MobileDeviceAccessRuleId *string - // The Amazon WorkMail organization under which the rule will be deleted. + // The WorkMail organization under which the rule will be deleted. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_DeleteOrganization.go b/service/workmail/api_op_DeleteOrganization.go index 83d0737d413..b0161535723 100644 --- a/service/workmail/api_op_DeleteOrganization.go +++ b/service/workmail/api_op_DeleteOrganization.go @@ -11,11 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an Amazon WorkMail organization and all underlying AWS resources managed -// by Amazon WorkMail as part of the organization. You can choose whether to delete -// the associated directory. For more information, see Removing an organization +// Deletes an WorkMail organization and all underlying AWS resources managed by +// WorkMail as part of the organization. You can choose whether to delete the +// associated directory. For more information, see Removing an organization // (https://docs.aws.amazon.com/workmail/latest/adminguide/remove_organization.html) -// in the Amazon WorkMail Administrator Guide. +// in the WorkMail Administrator Guide. func (c *Client) DeleteOrganization(ctx context.Context, params *DeleteOrganizationInput, optFns ...func(*Options)) (*DeleteOrganizationOutput, error) { if params == nil { params = &DeleteOrganizationInput{} diff --git a/service/workmail/api_op_DeleteUser.go b/service/workmail/api_op_DeleteUser.go index 027c147b0a6..b8deefb614f 100644 --- a/service/workmail/api_op_DeleteUser.go +++ b/service/workmail/api_op_DeleteUser.go @@ -10,11 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a user from Amazon WorkMail and all subsequent systems. Before you can -// delete a user, the user state must be DISABLED. Use the DescribeUser action to -// confirm the user state. Deleting a user is permanent and cannot be undone. -// WorkMail archives user mailboxes for 30 days before they are permanently -// removed. +// Deletes a user from WorkMail and all subsequent systems. Before you can delete a +// user, the user state must be DISABLED. Use the DescribeUser action to confirm +// the user state. Deleting a user is permanent and cannot be undone. WorkMail +// archives user mailboxes for 30 days before they are permanently removed. func (c *Client) DeleteUser(ctx context.Context, params *DeleteUserInput, optFns ...func(*Options)) (*DeleteUserOutput, error) { if params == nil { params = &DeleteUserInput{} diff --git a/service/workmail/api_op_DeregisterFromWorkMail.go b/service/workmail/api_op_DeregisterFromWorkMail.go index 87a2144790b..2c2f190dc29 100644 --- a/service/workmail/api_op_DeregisterFromWorkMail.go +++ b/service/workmail/api_op_DeregisterFromWorkMail.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Mark a user, group, or resource as no longer used in Amazon WorkMail. This -// action disassociates the mailbox and schedules it for clean-up. WorkMail keeps +// Mark a user, group, or resource as no longer used in WorkMail. This action +// disassociates the mailbox and schedules it for clean-up. WorkMail keeps // mailboxes for 30 days before they are permanently removed. The functionality in // the console is Disable. func (c *Client) DeregisterFromWorkMail(ctx context.Context, params *DeregisterFromWorkMailInput, optFns ...func(*Options)) (*DeregisterFromWorkMailOutput, error) { @@ -36,8 +36,7 @@ type DeregisterFromWorkMailInput struct { // This member is required. EntityId *string - // The identifier for the organization under which the Amazon WorkMail entity - // exists. + // The identifier for the organization under which the WorkMail entity exists. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_DeregisterMailDomain.go b/service/workmail/api_op_DeregisterMailDomain.go index 3193eecdab6..3d56fb29b54 100644 --- a/service/workmail/api_op_DeregisterMailDomain.go +++ b/service/workmail/api_op_DeregisterMailDomain.go @@ -10,9 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes a domain from Amazon WorkMail, stops email routing to WorkMail, and -// removes the authorization allowing WorkMail use. SES keeps the domain because -// other applications may use it. You must first remove any email address used by +// Removes a domain from WorkMail, stops email routing to WorkMail, and removes the +// authorization allowing WorkMail use. SES keeps the domain because other +// applications may use it. You must first remove any email address used by // WorkMail entities before you remove the domain. func (c *Client) DeregisterMailDomain(ctx context.Context, params *DeregisterMailDomainInput, optFns ...func(*Options)) (*DeregisterMailDomainOutput, error) { if params == nil { @@ -36,7 +36,7 @@ type DeregisterMailDomainInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which the domain will be deregistered. + // The WorkMail organization for which the domain will be deregistered. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_DescribeGroup.go b/service/workmail/api_op_DescribeGroup.go index a2c4a787a37..239a27669c2 100644 --- a/service/workmail/api_op_DescribeGroup.go +++ b/service/workmail/api_op_DescribeGroup.go @@ -62,7 +62,7 @@ type DescribeGroupOutput struct { // The name of the described group. Name *string - // The state of the user: enabled (registered to Amazon WorkMail) or disabled + // The state of the user: enabled (registered to WorkMail) or disabled // (deregistered or never registered to WorkMail). State types.EntityState diff --git a/service/workmail/api_op_DescribeOrganization.go b/service/workmail/api_op_DescribeOrganization.go index 1b721209d37..1566f5c3342 100644 --- a/service/workmail/api_op_DescribeOrganization.go +++ b/service/workmail/api_op_DescribeOrganization.go @@ -53,8 +53,7 @@ type DescribeOrganizationOutput struct { // The default mail domain associated with the organization. DefaultMailDomain *string - // The identifier for the directory associated with an Amazon WorkMail - // organization. + // The identifier for the directory associated with an WorkMail organization. DirectoryId *string // The type of directory associated with the WorkMail organization. diff --git a/service/workmail/api_op_DescribeResource.go b/service/workmail/api_op_DescribeResource.go index e057e992391..b93c66278e6 100644 --- a/service/workmail/api_op_DescribeResource.go +++ b/service/workmail/api_op_DescribeResource.go @@ -66,7 +66,7 @@ type DescribeResourceOutput struct { // The identifier of the described resource. ResourceId *string - // The state of the resource: enabled (registered to Amazon WorkMail), disabled + // The state of the resource: enabled (registered to WorkMail), disabled // (deregistered or never registered to WorkMail), or deleted. State types.EntityState diff --git a/service/workmail/api_op_DescribeUser.go b/service/workmail/api_op_DescribeUser.go index 13b381079e6..125b6900ea1 100644 --- a/service/workmail/api_op_DescribeUser.go +++ b/service/workmail/api_op_DescribeUser.go @@ -45,8 +45,8 @@ type DescribeUserInput struct { type DescribeUserOutput struct { - // The date and time at which the user was disabled for Amazon WorkMail usage, in - // UNIX epoch time format. + // The date and time at which the user was disabled for WorkMail usage, in UNIX + // epoch time format. DisabledDate *time.Time // The display name of the user. @@ -55,22 +55,22 @@ type DescribeUserOutput struct { // The email of the user. Email *string - // The date and time at which the user was enabled for Amazon WorkMail usage, in - // UNIX epoch time format. + // The date and time at which the user was enabled for WorkMailusage, in UNIX epoch + // time format. EnabledDate *time.Time // The name for the user. Name *string - // The state of a user: enabled (registered to Amazon WorkMail) or disabled - // (deregistered or never registered to WorkMail). + // The state of a user: enabled (registered to WorkMail) or disabled (deregistered + // or never registered to WorkMail). State types.EntityState // The identifier for the described user. UserId *string // In certain cases, other entities are modeled as users. If interoperability is - // enabled, resources are imported into Amazon WorkMail as users. Because different + // enabled, resources are imported into WorkMail as users. Because different // WorkMail organizations rely on different directory types, administrators can // distinguish between an unregistered user (account is disabled and has a user // role) and the directory administrators. The values are USER, RESOURCE, and diff --git a/service/workmail/api_op_GetAccessControlEffect.go b/service/workmail/api_op_GetAccessControlEffect.go index a12a5eb24bc..098d2ba13e5 100644 --- a/service/workmail/api_op_GetAccessControlEffect.go +++ b/service/workmail/api_op_GetAccessControlEffect.go @@ -12,7 +12,9 @@ import ( ) // Gets the effects of an organization's access control rules as they apply to a -// specified IPv4 address, access protocol action, or user ID. +// specified IPv4 address, access protocol action, and user ID or impersonation +// role ID. You must provide either the user ID or impersonation role ID. +// Impersonation role ID can only be used with Action EWS. func (c *Client) GetAccessControlEffect(ctx context.Context, params *GetAccessControlEffectInput, optFns ...func(*Options)) (*GetAccessControlEffectOutput, error) { if params == nil { params = &GetAccessControlEffectInput{} @@ -46,9 +48,10 @@ type GetAccessControlEffectInput struct { // This member is required. OrganizationId *string + // The impersonation role ID. + ImpersonationRoleId *string + // The user ID. - // - // This member is required. UserId *string noSmithyDocumentSerde diff --git a/service/workmail/api_op_GetImpersonationRole.go b/service/workmail/api_op_GetImpersonationRole.go new file mode 100644 index 00000000000..138997fdec2 --- /dev/null +++ b/service/workmail/api_op_GetImpersonationRole.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets the impersonation role details for the given WorkMail organization. +func (c *Client) GetImpersonationRole(ctx context.Context, params *GetImpersonationRoleInput, optFns ...func(*Options)) (*GetImpersonationRoleOutput, error) { + if params == nil { + params = &GetImpersonationRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetImpersonationRole", params, optFns, c.addOperationGetImpersonationRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetImpersonationRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetImpersonationRoleInput struct { + + // The impersonation role ID to retrieve. + // + // This member is required. + ImpersonationRoleId *string + + // The WorkMail organization from which to retrieve the impersonation role. + // + // This member is required. + OrganizationId *string + + noSmithyDocumentSerde +} + +type GetImpersonationRoleOutput struct { + + // The date when the impersonation role was created. + DateCreated *time.Time + + // The date when the impersonation role was last modified. + DateModified *time.Time + + // The impersonation role description. + Description *string + + // The impersonation role ID. + ImpersonationRoleId *string + + // The impersonation role name. + Name *string + + // The list of rules for the given impersonation role. + Rules []types.ImpersonationRule + + // The impersonation role type. + Type types.ImpersonationRoleType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetImpersonationRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetImpersonationRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetImpersonationRole{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetImpersonationRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImpersonationRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetImpersonationRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "GetImpersonationRole", + } +} diff --git a/service/workmail/api_op_GetImpersonationRoleEffect.go b/service/workmail/api_op_GetImpersonationRoleEffect.go new file mode 100644 index 00000000000..c69c8c2e928 --- /dev/null +++ b/service/workmail/api_op_GetImpersonationRoleEffect.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Tests whether the given impersonation role can impersonate a target user. +func (c *Client) GetImpersonationRoleEffect(ctx context.Context, params *GetImpersonationRoleEffectInput, optFns ...func(*Options)) (*GetImpersonationRoleEffectOutput, error) { + if params == nil { + params = &GetImpersonationRoleEffectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetImpersonationRoleEffect", params, optFns, c.addOperationGetImpersonationRoleEffectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetImpersonationRoleEffectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetImpersonationRoleEffectInput struct { + + // The impersonation role ID to test. + // + // This member is required. + ImpersonationRoleId *string + + // The WorkMail organization where the impersonation role is defined. + // + // This member is required. + OrganizationId *string + + // The WorkMail organization user chosen to test the impersonation role. The + // following identity formats are available: + // + // * User ID: + // 12345678-1234-1234-1234-123456789012 or + // S-1-1-12-1234567890-123456789-123456789-1234 + // + // * Email address: + // user@domain.tld + // + // * User name: user + // + // This member is required. + TargetUser *string + + noSmithyDocumentSerde +} + +type GetImpersonationRoleEffectOutput struct { + + // Effect of the impersonation role on the target user based on its rules. + // Available effects are ALLOW or DENY. + Effect types.AccessEffect + + // A list of the rules that match the input and produce the configured effect. + MatchedRules []types.ImpersonationMatchedRule + + // The impersonation role type. + Type types.ImpersonationRoleType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetImpersonationRoleEffectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetImpersonationRoleEffect{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetImpersonationRoleEffect{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetImpersonationRoleEffectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImpersonationRoleEffect(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetImpersonationRoleEffect(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "GetImpersonationRoleEffect", + } +} diff --git a/service/workmail/api_op_GetMailDomain.go b/service/workmail/api_op_GetMailDomain.go index bbbb70253ea..b0e7e0ac0e2 100644 --- a/service/workmail/api_op_GetMailDomain.go +++ b/service/workmail/api_op_GetMailDomain.go @@ -35,7 +35,7 @@ type GetMailDomainInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which the domain is retrieved. + // The WorkMail organization for which the domain is retrieved. // // This member is required. OrganizationId *string @@ -58,10 +58,10 @@ type GetMailDomainOutput struct { // Indicates the status of the domain ownership verification. OwnershipVerificationStatus types.DnsRecordVerificationStatus - // A list of the DNS records that Amazon WorkMail recommends adding in your DNS - // provider for the best user experience. The records configure your domain with - // DMARC, SPF, DKIM, and direct incoming email traffic to SES. See admin guide for - // more details. + // A list of the DNS records that WorkMail recommends adding in your DNS provider + // for the best user experience. The records configure your domain with DMARC, SPF, + // DKIM, and direct incoming email traffic to SES. See admin guide for more + // details. Records []types.DnsRecord // Metadata pertaining to the operation's result. diff --git a/service/workmail/api_op_GetMobileDeviceAccessEffect.go b/service/workmail/api_op_GetMobileDeviceAccessEffect.go index 634d7bf243e..3f7ba2f6ab7 100644 --- a/service/workmail/api_op_GetMobileDeviceAccessEffect.go +++ b/service/workmail/api_op_GetMobileDeviceAccessEffect.go @@ -13,8 +13,8 @@ import ( // Simulates the effect of the mobile device access rules for the given attributes // of a sample access event. Use this method to test the effects of the current set -// of mobile device access rules for the Amazon WorkMail organization for a -// particular user's attributes. +// of mobile device access rules for the WorkMail organization for a particular +// user's attributes. func (c *Client) GetMobileDeviceAccessEffect(ctx context.Context, params *GetMobileDeviceAccessEffectInput, optFns ...func(*Options)) (*GetMobileDeviceAccessEffectOutput, error) { if params == nil { params = &GetMobileDeviceAccessEffectInput{} @@ -32,7 +32,7 @@ func (c *Client) GetMobileDeviceAccessEffect(ctx context.Context, params *GetMob type GetMobileDeviceAccessEffectInput struct { - // The Amazon WorkMail organization to simulate the access effect for. + // The WorkMail organization to simulate the access effect for. // // This member is required. OrganizationId *string @@ -55,7 +55,7 @@ type GetMobileDeviceAccessEffectInput struct { type GetMobileDeviceAccessEffectOutput struct { // The effect of the simulated access, ALLOW or DENY, after evaluating mobile - // device access rules in the Amazon WorkMail organization for the simulated user + // device access rules in the WorkMail organization for the simulated user // parameters. Effect types.MobileDeviceAccessRuleEffect diff --git a/service/workmail/api_op_GetMobileDeviceAccessOverride.go b/service/workmail/api_op_GetMobileDeviceAccessOverride.go index 7c7b01385e3..211f18c7fa0 100644 --- a/service/workmail/api_op_GetMobileDeviceAccessOverride.go +++ b/service/workmail/api_op_GetMobileDeviceAccessOverride.go @@ -36,7 +36,7 @@ type GetMobileDeviceAccessOverrideInput struct { // This member is required. DeviceId *string - // The Amazon WorkMail organization to which you want to apply the override. + // The WorkMail organization to which you want to apply the override. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_ListAvailabilityConfigurations.go b/service/workmail/api_op_ListAvailabilityConfigurations.go index 676145de355..8e98b44e134 100644 --- a/service/workmail/api_op_ListAvailabilityConfigurations.go +++ b/service/workmail/api_op_ListAvailabilityConfigurations.go @@ -30,8 +30,8 @@ func (c *Client) ListAvailabilityConfigurations(ctx context.Context, params *Lis type ListAvailabilityConfigurationsInput struct { - // The Amazon WorkMail organization for which the AvailabilityConfiguration's will - // be listed. + // The WorkMail organization for which the AvailabilityConfiguration's will be + // listed. // // This member is required. OrganizationId *string @@ -48,8 +48,8 @@ type ListAvailabilityConfigurationsInput struct { type ListAvailabilityConfigurationsOutput struct { - // The list of AvailabilityConfiguration's that exist for the specified Amazon - // WorkMail organization. + // The list of AvailabilityConfiguration's that exist for the specified WorkMail + // organization. AvailabilityConfigurations []types.AvailabilityConfiguration // The token to use to retrieve the next page of results. The value is null when diff --git a/service/workmail/api_op_ListImpersonationRoles.go b/service/workmail/api_op_ListImpersonationRoles.go new file mode 100644 index 00000000000..b6f73634f37 --- /dev/null +++ b/service/workmail/api_op_ListImpersonationRoles.go @@ -0,0 +1,224 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the impersonation roles for the given WorkMail organization. +func (c *Client) ListImpersonationRoles(ctx context.Context, params *ListImpersonationRolesInput, optFns ...func(*Options)) (*ListImpersonationRolesOutput, error) { + if params == nil { + params = &ListImpersonationRolesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListImpersonationRoles", params, optFns, c.addOperationListImpersonationRolesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListImpersonationRolesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListImpersonationRolesInput struct { + + // The WorkMail organization to which the listed impersonation roles belong. + // + // This member is required. + OrganizationId *string + + // The maximum number of results returned in a single call. + MaxResults *int32 + + // The token used to retrieve the next page of results. The first call doesn't + // require a token. + NextToken *string + + noSmithyDocumentSerde +} + +type ListImpersonationRolesOutput struct { + + // The token to retrieve the next page of results. The value is null when there are + // no results to return. + NextToken *string + + // The list of impersonation roles under the given WorkMail organization. + Roles []types.ImpersonationRole + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListImpersonationRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListImpersonationRoles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListImpersonationRoles{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListImpersonationRolesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListImpersonationRoles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListImpersonationRolesAPIClient is a client that implements the +// ListImpersonationRoles operation. +type ListImpersonationRolesAPIClient interface { + ListImpersonationRoles(context.Context, *ListImpersonationRolesInput, ...func(*Options)) (*ListImpersonationRolesOutput, error) +} + +var _ ListImpersonationRolesAPIClient = (*Client)(nil) + +// ListImpersonationRolesPaginatorOptions is the paginator options for +// ListImpersonationRoles +type ListImpersonationRolesPaginatorOptions struct { + // The maximum number of results returned in a single call. + 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 +} + +// ListImpersonationRolesPaginator is a paginator for ListImpersonationRoles +type ListImpersonationRolesPaginator struct { + options ListImpersonationRolesPaginatorOptions + client ListImpersonationRolesAPIClient + params *ListImpersonationRolesInput + nextToken *string + firstPage bool +} + +// NewListImpersonationRolesPaginator returns a new ListImpersonationRolesPaginator +func NewListImpersonationRolesPaginator(client ListImpersonationRolesAPIClient, params *ListImpersonationRolesInput, optFns ...func(*ListImpersonationRolesPaginatorOptions)) *ListImpersonationRolesPaginator { + if params == nil { + params = &ListImpersonationRolesInput{} + } + + options := ListImpersonationRolesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListImpersonationRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImpersonationRolesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListImpersonationRoles page. +func (p *ListImpersonationRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImpersonationRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListImpersonationRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListImpersonationRoles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "ListImpersonationRoles", + } +} diff --git a/service/workmail/api_op_ListMailDomains.go b/service/workmail/api_op_ListMailDomains.go index 6e82eebfa81..de8660386b4 100644 --- a/service/workmail/api_op_ListMailDomains.go +++ b/service/workmail/api_op_ListMailDomains.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the mail domains in a given Amazon WorkMail organization. +// Lists the mail domains in a given WorkMail organization. func (c *Client) ListMailDomains(ctx context.Context, params *ListMailDomainsInput, optFns ...func(*Options)) (*ListMailDomainsOutput, error) { if params == nil { params = &ListMailDomainsInput{} @@ -30,7 +30,7 @@ func (c *Client) ListMailDomains(ctx context.Context, params *ListMailDomainsInp type ListMailDomainsInput struct { - // The Amazon WorkMail organization for which to list domains. + // The WorkMail organization for which to list domains. // // This member is required. OrganizationId *string @@ -48,8 +48,8 @@ type ListMailDomainsInput struct { type ListMailDomainsOutput struct { // The list of mail domain summaries, specifying domains that exist in the - // specified Amazon WorkMail organization, along with the information about whether - // the domain is or isn't the default. + // specified WorkMail organization, along with the information about whether the + // domain is or isn't the default. MailDomains []types.MailDomainSummary // The token to use to retrieve the next page of results. The value becomes null diff --git a/service/workmail/api_op_ListMobileDeviceAccessOverrides.go b/service/workmail/api_op_ListMobileDeviceAccessOverrides.go index f2c27ad04c7..14c23258d41 100644 --- a/service/workmail/api_op_ListMobileDeviceAccessOverrides.go +++ b/service/workmail/api_op_ListMobileDeviceAccessOverrides.go @@ -31,8 +31,7 @@ func (c *Client) ListMobileDeviceAccessOverrides(ctx context.Context, params *Li type ListMobileDeviceAccessOverridesInput struct { - // The Amazon WorkMail organization under which to list mobile device access - // overrides. + // The WorkMail organization under which to list mobile device access overrides. // // This member is required. OrganizationId *string @@ -69,8 +68,8 @@ type ListMobileDeviceAccessOverridesOutput struct { // there are no more results to return. NextToken *string - // The list of mobile device access overrides that exist for the specified Amazon - // WorkMail organization and user. + // The list of mobile device access overrides that exist for the specified WorkMail + // organization and user. Overrides []types.MobileDeviceAccessOverride // Metadata pertaining to the operation's result. diff --git a/service/workmail/api_op_ListMobileDeviceAccessRules.go b/service/workmail/api_op_ListMobileDeviceAccessRules.go index e0295ed502f..19a68ffc515 100644 --- a/service/workmail/api_op_ListMobileDeviceAccessRules.go +++ b/service/workmail/api_op_ListMobileDeviceAccessRules.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the mobile device access rules for the specified Amazon WorkMail -// organization. +// Lists the mobile device access rules for the specified WorkMail organization. func (c *Client) ListMobileDeviceAccessRules(ctx context.Context, params *ListMobileDeviceAccessRulesInput, optFns ...func(*Options)) (*ListMobileDeviceAccessRulesOutput, error) { if params == nil { params = &ListMobileDeviceAccessRulesInput{} @@ -30,7 +29,7 @@ func (c *Client) ListMobileDeviceAccessRules(ctx context.Context, params *ListMo type ListMobileDeviceAccessRulesInput struct { - // The Amazon WorkMail organization for which to list the rules. + // The WorkMail organization for which to list the rules. // // This member is required. OrganizationId *string @@ -40,8 +39,8 @@ type ListMobileDeviceAccessRulesInput struct { type ListMobileDeviceAccessRulesOutput struct { - // The list of mobile device access rules that exist under the specified Amazon - // WorkMail organization. + // The list of mobile device access rules that exist under the specified WorkMail + // organization. Rules []types.MobileDeviceAccessRule // Metadata pertaining to the operation's result. diff --git a/service/workmail/api_op_ListTagsForResource.go b/service/workmail/api_op_ListTagsForResource.go index 6fe6ec6633e..5d0d566041e 100644 --- a/service/workmail/api_op_ListTagsForResource.go +++ b/service/workmail/api_op_ListTagsForResource.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tags applied to an Amazon WorkMail organization resource. +// Lists the tags applied to an WorkMail organization resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/workmail/api_op_PutAccessControlRule.go b/service/workmail/api_op_PutAccessControlRule.go index 8acdd5a83b0..8f73e9970bc 100644 --- a/service/workmail/api_op_PutAccessControlRule.go +++ b/service/workmail/api_op_PutAccessControlRule.go @@ -13,8 +13,8 @@ import ( // Adds a new access control rule for the specified organization. The rule allows // or denies access to the organization for the specified IPv4 addresses, access -// protocol actions, and user IDs. Adding a new rule with the same name as an -// existing rule replaces the older rule. +// protocol actions, user IDs and impersonation IDs. Adding a new rule with the +// same name as an existing rule replaces the older rule. func (c *Client) PutAccessControlRule(ctx context.Context, params *PutAccessControlRuleInput, optFns ...func(*Options)) (*PutAccessControlRuleOutput, error) { if params == nil { params = &PutAccessControlRuleInput{} @@ -56,6 +56,9 @@ type PutAccessControlRuleInput struct { // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. Actions []string + // Impersonation role IDs to include in the rule. + ImpersonationRoleIds []string + // IPv4 CIDR ranges to include in the rule. IpRanges []string @@ -63,6 +66,9 @@ type PutAccessControlRuleInput struct { // ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. NotActions []string + // Impersonation role IDs to exclude from the rule. + NotImpersonationRoleIds []string + // IPv4 CIDR ranges to exclude from the rule. NotIpRanges []string diff --git a/service/workmail/api_op_PutMobileDeviceAccessOverride.go b/service/workmail/api_op_PutMobileDeviceAccessOverride.go index f5440b6882e..562b0eb82c9 100644 --- a/service/workmail/api_op_PutMobileDeviceAccessOverride.go +++ b/service/workmail/api_op_PutMobileDeviceAccessOverride.go @@ -41,7 +41,7 @@ type PutMobileDeviceAccessOverrideInput struct { // This member is required. Effect types.MobileDeviceAccessRuleEffect - // Identifies the Amazon WorkMail organization for which you create the override. + // Identifies the WorkMail organization for which you create the override. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_RegisterMailDomain.go b/service/workmail/api_op_RegisterMailDomain.go index 3d0b353a816..3c0bafc6f4a 100644 --- a/service/workmail/api_op_RegisterMailDomain.go +++ b/service/workmail/api_op_RegisterMailDomain.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Registers a new domain in Amazon WorkMail and SES, and configures it for use by +// Registers a new domain in WorkMail and SES, and configures it for use by // WorkMail. Emails received by SES for this domain are routed to the specified // WorkMail organization, and WorkMail has permanent permission to use the // specified domain for sending your users' emails. @@ -32,12 +32,12 @@ func (c *Client) RegisterMailDomain(ctx context.Context, params *RegisterMailDom type RegisterMailDomainInput struct { - // The name of the mail domain to create in Amazon WorkMail and SES. + // The name of the mail domain to create in WorkMail and SES. // // This member is required. DomainName *string - // The Amazon WorkMail organization under which you're creating the domain. + // The WorkMail organization under which you're creating the domain. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_RegisterToWorkMail.go b/service/workmail/api_op_RegisterToWorkMail.go index 60a1378b208..25bde2cb4ed 100644 --- a/service/workmail/api_op_RegisterToWorkMail.go +++ b/service/workmail/api_op_RegisterToWorkMail.go @@ -10,11 +10,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Registers an existing and disabled user, group, or resource for Amazon WorkMail -// use by associating a mailbox and calendaring capabilities. It performs no change -// if the user, group, or resource is enabled and fails if the user, group, or -// resource is deleted. This operation results in the accumulation of costs. For -// more information, see Pricing (https://aws.amazon.com/workmail/pricing). The +// Registers an existing and disabled user, group, or resource for WorkMail use by +// associating a mailbox and calendaring capabilities. It performs no change if the +// user, group, or resource is enabled and fails if the user, group, or resource is +// deleted. This operation results in the accumulation of costs. For more +// information, see Pricing (https://aws.amazon.com/workmail/pricing). The // equivalent console functionality for this operation is Enable. Users can either // be created by calling the CreateUser API operation or they can be synchronized // from your directory. For more information, see DeregisterFromWorkMail. diff --git a/service/workmail/api_op_StartMailboxExportJob.go b/service/workmail/api_op_StartMailboxExportJob.go index 127afe5d9ca..f13c5a3b43a 100644 --- a/service/workmail/api_op_StartMailboxExportJob.go +++ b/service/workmail/api_op_StartMailboxExportJob.go @@ -15,7 +15,7 @@ import ( // items from the specified mailbox to the specified Amazon Simple Storage Service // (Amazon S3) bucket. For more information, see Exporting mailbox content // (https://docs.aws.amazon.com/workmail/latest/adminguide/mail-export.html) in the -// Amazon WorkMail Administrator Guide. +// WorkMail Administrator Guide. func (c *Client) StartMailboxExportJob(ctx context.Context, params *StartMailboxExportJobInput, optFns ...func(*Options)) (*StartMailboxExportJobOutput, error) { if params == nil { params = &StartMailboxExportJobInput{} diff --git a/service/workmail/api_op_TagResource.go b/service/workmail/api_op_TagResource.go index 9287fd857b7..0d816bb0a0d 100644 --- a/service/workmail/api_op_TagResource.go +++ b/service/workmail/api_op_TagResource.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Applies the specified tags to the specified Amazon WorkMail organization -// resource. +// Applies the specified tags to the specified WorkMailorganization resource. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} diff --git a/service/workmail/api_op_TestAvailabilityConfiguration.go b/service/workmail/api_op_TestAvailabilityConfiguration.go index cdc489a2a5c..2c21a7d74da 100644 --- a/service/workmail/api_op_TestAvailabilityConfiguration.go +++ b/service/workmail/api_op_TestAvailabilityConfiguration.go @@ -36,7 +36,7 @@ func (c *Client) TestAvailabilityConfiguration(ctx context.Context, params *Test type TestAvailabilityConfigurationInput struct { - // The Amazon WorkMail organization where the availability provider will be tested. + // The WorkMail organization where the availability provider will be tested. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_UntagResource.go b/service/workmail/api_op_UntagResource.go index 1ec0bcc7b58..f31cce3bb17 100644 --- a/service/workmail/api_op_UntagResource.go +++ b/service/workmail/api_op_UntagResource.go @@ -10,8 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Untags the specified tags from the specified Amazon WorkMail organization -// resource. +// Untags the specified tags from the specified WorkMail organization resource. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} diff --git a/service/workmail/api_op_UpdateAvailabilityConfiguration.go b/service/workmail/api_op_UpdateAvailabilityConfiguration.go index 3441de44d6b..cef923acbdf 100644 --- a/service/workmail/api_op_UpdateAvailabilityConfiguration.go +++ b/service/workmail/api_op_UpdateAvailabilityConfiguration.go @@ -35,7 +35,7 @@ type UpdateAvailabilityConfigurationInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which the AvailabilityConfiguration will be + // The WorkMail organization for which the AvailabilityConfiguration will be // updated. // // This member is required. diff --git a/service/workmail/api_op_UpdateDefaultMailDomain.go b/service/workmail/api_op_UpdateDefaultMailDomain.go index 7778e4c9907..37fd6b511b1 100644 --- a/service/workmail/api_op_UpdateDefaultMailDomain.go +++ b/service/workmail/api_op_UpdateDefaultMailDomain.go @@ -35,7 +35,7 @@ type UpdateDefaultMailDomainInput struct { // This member is required. DomainName *string - // The Amazon WorkMail organization for which to list domains. + // The WorkMail organization for which to list domains. // // This member is required. OrganizationId *string diff --git a/service/workmail/api_op_UpdateImpersonationRole.go b/service/workmail/api_op_UpdateImpersonationRole.go new file mode 100644 index 00000000000..3a679c45030 --- /dev/null +++ b/service/workmail/api_op_UpdateImpersonationRole.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an impersonation role for the given WorkMail organization. +func (c *Client) UpdateImpersonationRole(ctx context.Context, params *UpdateImpersonationRoleInput, optFns ...func(*Options)) (*UpdateImpersonationRoleOutput, error) { + if params == nil { + params = &UpdateImpersonationRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateImpersonationRole", params, optFns, c.addOperationUpdateImpersonationRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateImpersonationRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateImpersonationRoleInput struct { + + // The ID of the impersonation role to update. + // + // This member is required. + ImpersonationRoleId *string + + // The updated impersonation role name. + // + // This member is required. + Name *string + + // The WorkMail organization that contains the impersonation role to update. + // + // This member is required. + OrganizationId *string + + // The updated list of rules. + // + // This member is required. + Rules []types.ImpersonationRule + + // The updated impersonation role type. + // + // This member is required. + Type types.ImpersonationRoleType + + // The updated impersonation role description. + Description *string + + noSmithyDocumentSerde +} + +type UpdateImpersonationRoleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateImpersonationRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateImpersonationRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateImpersonationRole{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateImpersonationRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateImpersonationRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateImpersonationRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "UpdateImpersonationRole", + } +} diff --git a/service/workmail/api_op_UpdateMobileDeviceAccessRule.go b/service/workmail/api_op_UpdateMobileDeviceAccessRule.go index 986f63e48bb..87b863b8264 100644 --- a/service/workmail/api_op_UpdateMobileDeviceAccessRule.go +++ b/service/workmail/api_op_UpdateMobileDeviceAccessRule.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates a mobile device access rule for the specified Amazon WorkMail -// organization. +// Updates a mobile device access rule for the specified WorkMail organization. func (c *Client) UpdateMobileDeviceAccessRule(ctx context.Context, params *UpdateMobileDeviceAccessRuleInput, optFns ...func(*Options)) (*UpdateMobileDeviceAccessRuleOutput, error) { if params == nil { params = &UpdateMobileDeviceAccessRuleInput{} @@ -45,7 +44,7 @@ type UpdateMobileDeviceAccessRuleInput struct { // This member is required. Name *string - // The Amazon WorkMail organization under which the rule will be updated. + // The WorkMail organization under which the rule will be updated. // // This member is required. OrganizationId *string diff --git a/service/workmail/deserializers.go b/service/workmail/deserializers.go index 903ab3cb885..79ae8089c94 100644 --- a/service/workmail/deserializers.go +++ b/service/workmail/deserializers.go @@ -275,6 +275,126 @@ func awsAwsjson11_deserializeOpErrorAssociateMemberToGroup(response *smithyhttp. } } +type awsAwsjson11_deserializeOpAssumeImpersonationRole struct { +} + +func (*awsAwsjson11_deserializeOpAssumeImpersonationRole) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpAssumeImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorAssumeImpersonationRole(response, &metadata) + } + output := &AssumeImpersonationRoleOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentAssumeImpersonationRoleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorAssumeImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCancelMailboxExportJob struct { } @@ -785,6 +905,132 @@ func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, m } } +type awsAwsjson11_deserializeOpCreateImpersonationRole struct { +} + +func (*awsAwsjson11_deserializeOpCreateImpersonationRole) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateImpersonationRole(response, &metadata) + } + output := &CreateImpersonationRoleOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateImpersonationRoleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateMobileDeviceAccessRule struct { } @@ -1889,14 +2135,14 @@ func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { +type awsAwsjson11_deserializeOpDeleteImpersonationRole struct { } -func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpDeleteImpersonationRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1910,9 +2156,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response, &metadata) } - output := &DeleteMailboxPermissionsOutput{} + output := &DeleteImpersonationRoleOutput{} out.Result = output var buff [1024]byte @@ -1932,7 +2178,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteImpersonationRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1946,7 +2192,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1987,12 +2233,6 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2012,14 +2252,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } } -type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride struct { +type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2033,9 +2273,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) } - output := &DeleteMobileDeviceAccessOverrideOutput{} + output := &DeleteMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -2055,7 +2295,130 @@ func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeser return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride struct { +} + +func (*awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMobileDeviceAccessOverride(response, &metadata) + } + output := &DeleteMobileDeviceAccessOverrideOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteMobileDeviceAccessOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4171,6 +4534,9 @@ func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response *smithyhttp. case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4301,14 +4667,14 @@ func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response *smithyht } } -type awsAwsjson11_deserializeOpGetMailboxDetails struct { +type awsAwsjson11_deserializeOpGetImpersonationRole struct { } -func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { +func (*awsAwsjson11_deserializeOpGetImpersonationRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4322,9 +4688,9 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRole(response, &metadata) } - output := &GetMailboxDetailsOutput{} + output := &GetImpersonationRoleOutput{} out.Result = output var buff [1024]byte @@ -4344,7 +4710,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4358,7 +4724,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4399,8 +4765,8 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -4408,6 +4774,9 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4418,14 +4787,14 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpGetMailDomain struct { +type awsAwsjson11_deserializeOpGetImpersonationRoleEffect struct { } -func (*awsAwsjson11_deserializeOpGetMailDomain) ID() string { +func (*awsAwsjson11_deserializeOpGetImpersonationRoleEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetImpersonationRoleEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4439,9 +4808,9 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMailDomain(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response, &metadata) } - output := &GetMailDomainOutput{} + output := &GetImpersonationRoleEffectOutput{} out.Result = output var buff [1024]byte @@ -4461,7 +4830,7 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMailDomainOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetImpersonationRoleEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4475,7 +4844,7 @@ func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetImpersonationRoleEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4516,18 +4885,24 @@ func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4538,14 +4913,14 @@ func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect struct { +type awsAwsjson11_deserializeOpGetMailboxDetails struct { } -func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) ID() string { +func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4559,9 +4934,9 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) } - output := &GetMobileDeviceAccessEffectOutput{} + output := &GetMailboxDetailsOutput{} out.Result = output var buff [1024]byte @@ -4581,7 +4956,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessEffectOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4595,7 +4970,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4636,8 +5011,8 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithy } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -4655,14 +5030,14 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithy } } -type awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride struct { +type awsAwsjson11_deserializeOpGetMailDomain struct { } -func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) ID() string { +func (*awsAwsjson11_deserializeOpGetMailDomain) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4676,9 +5051,9 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMailDomain(response, &metadata) } - output := &GetMobileDeviceAccessOverrideOutput{} + output := &GetMailDomainOutput{} out.Result = output var buff [1024]byte @@ -4698,7 +5073,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMailDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4712,7 +5087,7 @@ func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4753,21 +5128,18 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smit } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4778,14 +5150,14 @@ func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smit } } -type awsAwsjson11_deserializeOpListAccessControlRules struct { +type awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect struct { } -func (*awsAwsjson11_deserializeOpListAccessControlRules) ID() string { +func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4799,9 +5171,9 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccessControlRules(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response, &metadata) } - output := &ListAccessControlRulesOutput{} + output := &GetMobileDeviceAccessEffectOutput{} out.Result = output var buff [1024]byte @@ -4821,7 +5193,7 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4835,7 +5207,7 @@ func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4876,6 +5248,9 @@ func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp. } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -4892,14 +5267,14 @@ func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListAliases struct { +type awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride struct { } -func (*awsAwsjson11_deserializeOpListAliases) ID() string { +func (*awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4913,9 +5288,9 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response, &metadata) } - output := &ListAliasesOutput{} + output := &GetMobileDeviceAccessOverrideOutput{} out.Result = output var buff [1024]byte @@ -4935,7 +5310,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMobileDeviceAccessOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4949,7 +5324,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4993,9 +5368,6 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -5005,6 +5377,9 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5015,14 +5390,14 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpListAvailabilityConfigurations struct { +type awsAwsjson11_deserializeOpListAccessControlRules struct { } -func (*awsAwsjson11_deserializeOpListAvailabilityConfigurations) ID() string { +func (*awsAwsjson11_deserializeOpListAccessControlRules) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5036,9 +5411,9 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAccessControlRules(response, &metadata) } - output := &ListAvailabilityConfigurationsOutput{} + output := &ListAccessControlRulesOutput{} out.Result = output var buff [1024]byte @@ -5058,7 +5433,7 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAvailabilityConfigurationsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5072,7 +5447,7 @@ func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeseria return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5129,14 +5504,14 @@ func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smi } } -type awsAwsjson11_deserializeOpListGroupMembers struct { +type awsAwsjson11_deserializeOpListAliases struct { } -func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { +func (*awsAwsjson11_deserializeOpListAliases) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5150,9 +5525,9 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) } - output := &ListGroupMembersOutput{} + output := &ListAliasesOutput{} out.Result = output var buff [1024]byte @@ -5172,7 +5547,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5186,7 +5561,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5252,14 +5627,14 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListGroups struct { +type awsAwsjson11_deserializeOpListAvailabilityConfigurations struct { } -func (*awsAwsjson11_deserializeOpListGroups) ID() string { +func (*awsAwsjson11_deserializeOpListAvailabilityConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAvailabilityConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5273,9 +5648,9 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response, &metadata) } - output := &ListGroupsOutput{} + output := &ListAvailabilityConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -5295,7 +5670,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAvailabilityConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5309,7 +5684,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAvailabilityConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5350,12 +5725,6 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -5372,14 +5741,14 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListMailboxExportJobs struct { +type awsAwsjson11_deserializeOpListGroupMembers struct { } -func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { +func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5393,9 +5762,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) } - output := &ListMailboxExportJobsOutput{} + output := &ListGroupMembersOutput{} out.Result = output var buff [1024]byte @@ -5415,7 +5784,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5429,7 +5798,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5470,6 +5839,12 @@ func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.R } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -5489,14 +5864,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListMailboxPermissions struct { +type awsAwsjson11_deserializeOpListGroups struct { } -func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpListGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5510,9 +5885,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) } - output := &ListMailboxPermissionsOutput{} + output := &ListGroupsOutput{} out.Result = output var buff [1024]byte @@ -5532,7 +5907,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5546,7 +5921,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5609,14 +5984,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListMailDomains struct { +type awsAwsjson11_deserializeOpListImpersonationRoles struct { } -func (*awsAwsjson11_deserializeOpListMailDomains) ID() string { +func (*awsAwsjson11_deserializeOpListImpersonationRoles) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListImpersonationRoles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5630,9 +6005,9 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailDomains(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListImpersonationRoles(response, &metadata) } - output := &ListMailDomainsOutput{} + output := &ListImpersonationRolesOutput{} out.Result = output var buff [1024]byte @@ -5652,7 +6027,7 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailDomainsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListImpersonationRolesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5666,7 +6041,7 @@ func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListImpersonationRoles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5726,14 +6101,14 @@ func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides struct { +type awsAwsjson11_deserializeOpListMailboxExportJobs struct { } -func (*awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5747,9 +6122,9 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) } - output := &ListMobileDeviceAccessOverridesOutput{} + output := &ListMailboxExportJobsOutput{} out.Result = output var buff [1024]byte @@ -5769,7 +6144,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5783,7 +6158,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5824,9 +6199,6 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *sm } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -5846,14 +6218,14 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *sm } } -type awsAwsjson11_deserializeOpListMobileDeviceAccessRules struct { +type awsAwsjson11_deserializeOpListMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpListMobileDeviceAccessRules) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5867,9 +6239,9 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) } - output := &ListMobileDeviceAccessRulesOutput{} + output := &ListMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -5889,7 +6261,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessRulesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5903,7 +6275,7 @@ func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5944,6 +6316,9 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithy } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -5963,14 +6338,14 @@ func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithy } } -type awsAwsjson11_deserializeOpListOrganizations struct { +type awsAwsjson11_deserializeOpListMailDomains struct { } -func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { +func (*awsAwsjson11_deserializeOpListMailDomains) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5984,9 +6359,9 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailDomains(response, &metadata) } - output := &ListOrganizationsOutput{} + output := &ListMailDomainsOutput{} out.Result = output var buff [1024]byte @@ -6006,7 +6381,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailDomainsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6020,7 +6395,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6064,6 +6439,12 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6074,14 +6455,14 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListResourceDelegates struct { +type awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides struct { } -func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { +func (*awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessOverrides) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6095,9 +6476,9 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response, &metadata) } - output := &ListResourceDelegatesOutput{} + output := &ListMobileDeviceAccessOverridesOutput{} out.Result = output var buff [1024]byte @@ -6117,7 +6498,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessOverridesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6131,7 +6512,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessOverrides(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6175,9 +6556,6 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6197,14 +6575,14 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListResources struct { +type awsAwsjson11_deserializeOpListMobileDeviceAccessRules struct { } -func (*awsAwsjson11_deserializeOpListResources) ID() string { +func (*awsAwsjson11_deserializeOpListMobileDeviceAccessRules) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMobileDeviceAccessRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6218,9 +6596,9 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResources(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response, &metadata) } - output := &ListResourcesOutput{} + output := &ListMobileDeviceAccessRulesOutput{} out.Result = output var buff [1024]byte @@ -6240,7 +6618,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourcesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMobileDeviceAccessRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6254,7 +6632,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMobileDeviceAccessRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6314,14 +6692,14 @@ func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListOrganizations struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6335,9 +6713,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListOrganizationsOutput{} out.Result = output var buff [1024]byte @@ -6357,7 +6735,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6371,7 +6749,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6412,8 +6790,8 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6425,14 +6803,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListUsers struct { +type awsAwsjson11_deserializeOpListResourceDelegates struct { } -func (*awsAwsjson11_deserializeOpListUsers) ID() string { +func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6446,9 +6824,9 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) } - output := &ListUsersOutput{} + output := &ListResourceDelegatesOutput{} out.Result = output var buff [1024]byte @@ -6468,7 +6846,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6482,7 +6860,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6523,6 +6901,12 @@ func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, met } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -6542,14 +6926,14 @@ func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpPutAccessControlRule struct { +type awsAwsjson11_deserializeOpListResources struct { } -func (*awsAwsjson11_deserializeOpPutAccessControlRule) ID() string { +func (*awsAwsjson11_deserializeOpListResources) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6563,9 +6947,9 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutAccessControlRule(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResources(response, &metadata) } - output := &PutAccessControlRuleOutput{} + output := &ListResourcesOutput{} out.Result = output var buff [1024]byte @@ -6585,7 +6969,7 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutAccessControlRuleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6599,7 +6983,7 @@ func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6640,15 +7024,9 @@ func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Re } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -6665,14 +7043,14 @@ func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6686,9 +7064,9 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutEmailMonitoringConfigurationOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6708,7 +7086,7 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutEmailMonitoringConfigurationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6722,7 +7100,7 @@ func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6763,15 +7141,6 @@ func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *sm } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6785,14 +7154,14 @@ func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *sm } } -type awsAwsjson11_deserializeOpPutInboundDmarcSettings struct { +type awsAwsjson11_deserializeOpListUsers struct { } -func (*awsAwsjson11_deserializeOpPutInboundDmarcSettings) ID() string { +func (*awsAwsjson11_deserializeOpListUsers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6806,9 +7175,9 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) } - output := &PutInboundDmarcSettingsOutput{} + output := &ListUsersOutput{} out.Result = output var buff [1024]byte @@ -6828,7 +7197,7 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutInboundDmarcSettingsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6842,7 +7211,7 @@ func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6883,6 +7252,9 @@ func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -6899,14 +7271,14 @@ func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp } } -type awsAwsjson11_deserializeOpPutMailboxPermissions struct { +type awsAwsjson11_deserializeOpPutAccessControlRule struct { } -func (*awsAwsjson11_deserializeOpPutMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpPutAccessControlRule) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6920,9 +7292,9 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutAccessControlRule(response, &metadata) } - output := &PutMailboxPermissionsOutput{} + output := &PutAccessControlRuleOutput{} out.Result = output var buff [1024]byte @@ -6942,7 +7314,7 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutAccessControlRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6956,7 +7328,7 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7000,18 +7372,21 @@ func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.R case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7022,14 +7397,14 @@ func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride struct { +type awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration struct { } -func (*awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) ID() string { +func (*awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutEmailMonitoringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7043,9 +7418,9 @@ func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response, &metadata) } - output := &PutMobileDeviceAccessOverrideOutput{} + output := &PutEmailMonitoringConfigurationOutput{} out.Result = output var buff [1024]byte @@ -7065,7 +7440,7 @@ func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutMobileDeviceAccessOverrideOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutEmailMonitoringConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7079,7 +7454,7 @@ func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutEmailMonitoringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7120,12 +7495,6 @@ func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response *smit } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -7135,6 +7504,9 @@ func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response *smit case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7145,14 +7517,14 @@ func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response *smit } } -type awsAwsjson11_deserializeOpPutRetentionPolicy struct { +type awsAwsjson11_deserializeOpPutInboundDmarcSettings struct { } -func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpPutInboundDmarcSettings) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutInboundDmarcSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7166,9 +7538,9 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response, &metadata) } - output := &PutRetentionPolicyOutput{} + output := &PutInboundDmarcSettingsOutput{} out.Result = output var buff [1024]byte @@ -7188,7 +7560,7 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutRetentionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutInboundDmarcSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7202,7 +7574,7 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutInboundDmarcSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7243,12 +7615,6 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -7265,14 +7631,14 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpRegisterMailDomain struct { +type awsAwsjson11_deserializeOpPutMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpRegisterMailDomain) ID() string { +func (*awsAwsjson11_deserializeOpPutMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRegisterMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7286,9 +7652,9 @@ func (m *awsAwsjson11_deserializeOpRegisterMailDomain) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRegisterMailDomain(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response, &metadata) } - output := &RegisterMailDomainOutput{} + output := &PutMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -7308,7 +7674,7 @@ func (m *awsAwsjson11_deserializeOpRegisterMailDomain) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRegisterMailDomainOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7322,7 +7688,7 @@ func (m *awsAwsjson11_deserializeOpRegisterMailDomain) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRegisterMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7363,14 +7729,14 @@ func awsAwsjson11_deserializeOpErrorRegisterMailDomain(response *smithyhttp.Resp } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("MailDomainInUseException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainInUseException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -7388,14 +7754,14 @@ func awsAwsjson11_deserializeOpErrorRegisterMailDomain(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpRegisterToWorkMail struct { +type awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride struct { } -func (*awsAwsjson11_deserializeOpRegisterToWorkMail) ID() string { +func (*awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutMobileDeviceAccessOverride) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7409,9 +7775,9 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response, &metadata) } - output := &RegisterToWorkMailOutput{} + output := &PutMobileDeviceAccessOverrideOutput{} out.Result = output var buff [1024]byte @@ -7431,7 +7797,7 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRegisterToWorkMailOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutMobileDeviceAccessOverrideOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7445,7 +7811,7 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutMobileDeviceAccessOverride(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7486,18 +7852,6 @@ func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Resp } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - - case strings.EqualFold("EntityAlreadyRegisteredException", errorCode): - return awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) @@ -7507,12 +7861,6 @@ func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -7529,14 +7877,14 @@ func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpResetPassword struct { +type awsAwsjson11_deserializeOpPutRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpResetPassword) ID() string { +func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7550,9 +7898,9 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorResetPassword(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) } - output := &ResetPasswordOutput{} + output := &PutRetentionPolicyOutput{} out.Result = output var buff [1024]byte @@ -7572,7 +7920,7 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentResetPasswordOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutRetentionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7586,7 +7934,7 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7627,23 +7975,11 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidPasswordException", errorCode): - return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -7651,9 +7987,6 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7664,14 +7997,14 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpStartMailboxExportJob struct { +type awsAwsjson11_deserializeOpRegisterMailDomain struct { } -func (*awsAwsjson11_deserializeOpStartMailboxExportJob) ID() string { +func (*awsAwsjson11_deserializeOpRegisterMailDomain) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRegisterMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7685,9 +8018,9 @@ func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRegisterMailDomain(response, &metadata) } - output := &StartMailboxExportJobOutput{} + output := &RegisterMailDomainOutput{} out.Result = output var buff [1024]byte @@ -7707,7 +8040,7 @@ func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartMailboxExportJobOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRegisterMailDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7721,7 +8054,7 @@ func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRegisterMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7762,15 +8095,15 @@ func awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response *smithyhttp.R } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("MailDomainInUseException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainInUseException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -7787,14 +8120,14 @@ func awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpRegisterToWorkMail struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpRegisterToWorkMail) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7808,9 +8141,9 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response, &metadata) } - output := &TagResourceOutput{} + output := &RegisterToWorkMailOutput{} out.Result = output var buff [1024]byte @@ -7830,7 +8163,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRegisterToWorkMailOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7844,7 +8177,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7885,14 +8218,38 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityAlreadyRegisteredException", errorCode): + return awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7904,14 +8261,14 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpTestAvailabilityConfiguration struct { +type awsAwsjson11_deserializeOpResetPassword struct { } -func (*awsAwsjson11_deserializeOpTestAvailabilityConfiguration) ID() string { +func (*awsAwsjson11_deserializeOpResetPassword) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTestAvailabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7925,9 +8282,9 @@ func (m *awsAwsjson11_deserializeOpTestAvailabilityConfiguration) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorResetPassword(response, &metadata) } - output := &TestAvailabilityConfigurationOutput{} + output := &ResetPasswordOutput{} out.Result = output var buff [1024]byte @@ -7947,7 +8304,7 @@ func (m *awsAwsjson11_deserializeOpTestAvailabilityConfiguration) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTestAvailabilityConfigurationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentResetPasswordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7961,7 +8318,7 @@ func (m *awsAwsjson11_deserializeOpTestAvailabilityConfiguration) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8002,17 +8359,32 @@ func awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response *smit } switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidPasswordException", errorCode): + return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8024,14 +8396,14 @@ func awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response *smit } } -type awsAwsjson11_deserializeOpUntagResource struct { +type awsAwsjson11_deserializeOpStartMailboxExportJob struct { } -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { +func (*awsAwsjson11_deserializeOpStartMailboxExportJob) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8045,9 +8417,9 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response, &metadata) } - output := &UntagResourceOutput{} + output := &StartMailboxExportJobOutput{} out.Result = output var buff [1024]byte @@ -8067,7 +8439,7 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartMailboxExportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8081,7 +8453,7 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8122,8 +8494,20 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8135,14 +8519,14 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration struct { +type awsAwsjson11_deserializeOpTagResource struct { } -func (*awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) ID() string { +func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8156,9 +8540,9 @@ func (m *awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdateAvailabilityConfigurationOutput{} + output := &TagResourceOutput{} out.Result = output var buff [1024]byte @@ -8178,7 +8562,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAvailabilityConfigurationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8192,7 +8576,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8233,18 +8617,15 @@ func awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response *sm } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8255,14 +8636,14 @@ func awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response *sm } } -type awsAwsjson11_deserializeOpUpdateDefaultMailDomain struct { +type awsAwsjson11_deserializeOpTestAvailabilityConfiguration struct { } -func (*awsAwsjson11_deserializeOpUpdateDefaultMailDomain) ID() string { +func (*awsAwsjson11_deserializeOpTestAvailabilityConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateDefaultMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTestAvailabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8276,9 +8657,9 @@ func (m *awsAwsjson11_deserializeOpUpdateDefaultMailDomain) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response, &metadata) } - output := &UpdateDefaultMailDomainOutput{} + output := &TestAvailabilityConfigurationOutput{} out.Result = output var buff [1024]byte @@ -8298,7 +8679,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDefaultMailDomain) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateDefaultMailDomainOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentTestAvailabilityConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8312,7 +8693,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDefaultMailDomain) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorTestAvailabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8356,18 +8737,15 @@ func awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response *smithyhttp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8378,14 +8756,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response *smithyhttp } } -type awsAwsjson11_deserializeOpUpdateMailboxQuota struct { +type awsAwsjson11_deserializeOpUntagResource struct { } -func (*awsAwsjson11_deserializeOpUpdateMailboxQuota) ID() string { +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8399,9 +8777,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) } - output := &UpdateMailboxQuotaOutput{} + output := &UntagResourceOutput{} out.Result = output var buff [1024]byte @@ -8421,7 +8799,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8435,7 +8813,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8476,20 +8854,8 @@ func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Resp } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8501,14 +8867,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule struct { +type awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration struct { } -func (*awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) ID() string { +func (*awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateAvailabilityConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8522,9 +8888,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response, &metadata) } - output := &UpdateMobileDeviceAccessRuleOutput{} + output := &UpdateAvailabilityConfigurationOutput{} out.Result = output var buff [1024]byte @@ -8544,7 +8910,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMobileDeviceAccessRuleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateAvailabilityConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8558,7 +8924,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateAvailabilityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8599,9 +8965,6 @@ func awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response *smith } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -8611,6 +8974,9 @@ func awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response *smith case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8621,14 +8987,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response *smith } } -type awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress struct { +type awsAwsjson11_deserializeOpUpdateDefaultMailDomain struct { } -func (*awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) ID() string { +func (*awsAwsjson11_deserializeOpUpdateDefaultMailDomain) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateDefaultMailDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8642,9 +9008,9 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response, &metadata) } - output := &UpdatePrimaryEmailAddressOutput{} + output := &UpdateDefaultMailDomainOutput{} out.Result = output var buff [1024]byte @@ -8664,7 +9030,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdatePrimaryEmailAddressOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateDefaultMailDomainOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8678,7 +9044,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateDefaultMailDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8719,21 +9085,6 @@ func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyht } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -8749,9 +9100,6 @@ func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyht case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8762,14 +9110,14 @@ func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyht } } -type awsAwsjson11_deserializeOpUpdateResource struct { +type awsAwsjson11_deserializeOpUpdateImpersonationRole struct { } -func (*awsAwsjson11_deserializeOpUpdateResource) ID() string { +func (*awsAwsjson11_deserializeOpUpdateImpersonationRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateImpersonationRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8783,9 +9131,9 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateImpersonationRole(response, &metadata) } - output := &UpdateResourceOutput{} + output := &UpdateImpersonationRoleOutput{} out.Result = output var buff [1024]byte @@ -8805,7 +9153,7 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateImpersonationRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8819,7 +9167,7 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateImpersonationRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8860,29 +9208,17 @@ func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response } switch { - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) case strings.EqualFold("EntityStateException", errorCode): return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidConfigurationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidConfigurationException(response, errorBody) - - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("NameAvailabilityException", errorCode): - return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -8890,6 +9226,9 @@ func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8900,11 +9239,36 @@ func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response } } -func awsAwsjson11_deserializeErrorDirectoryInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson11_deserializeOpUpdateMailboxQuota struct { +} + +func (*awsAwsjson11_deserializeOpUpdateMailboxQuota) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response, &metadata) + } + output := &UpdateMailboxQuotaOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -8915,12 +9279,10 @@ func awsAwsjson11_deserializeErrorDirectoryInUseException(response *smithyhttp.R Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.DirectoryInUseException{} - err := awsAwsjson11_deserializeDocumentDirectoryInUseException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8928,22 +9290,35 @@ func awsAwsjson11_deserializeErrorDirectoryInUseException(response *smithyhttp.R Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -8953,12 +9328,498 @@ func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException( return err } - output := &types.DirectoryServiceAuthenticationFailedException{} - err := awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule struct { +} + +func (*awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateMobileDeviceAccessRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response, &metadata) + } + output := &UpdateMobileDeviceAccessRuleOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateMobileDeviceAccessRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateMobileDeviceAccessRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress struct { +} + +func (*awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response, &metadata) + } + output := &UpdatePrimaryEmailAddressOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdatePrimaryEmailAddressOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateResource struct { +} + +func (*awsAwsjson11_deserializeOpUpdateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateResource(response, &metadata) + } + output := &UpdateResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidConfigurationException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("NameAvailabilityException", errorCode): + return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorDirectoryInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DirectoryInUseException{} + err := awsAwsjson11_deserializeDocumentDirectoryInUseException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DirectoryServiceAuthenticationFailedException{} + err := awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(&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(), @@ -9747,6 +10608,11 @@ func awsAwsjson11_deserializeDocumentAccessControlRule(v **types.AccessControlRu sv.Effect = types.AccessControlRuleEffect(jtv) } + case "ImpersonationRoleIds": + if err := awsAwsjson11_deserializeDocumentImpersonationRoleIdList(&sv.ImpersonationRoleIds, value); err != nil { + return err + } + case "IpRanges": if err := awsAwsjson11_deserializeDocumentIpRangeList(&sv.IpRanges, value); err != nil { return err @@ -9766,6 +10632,11 @@ func awsAwsjson11_deserializeDocumentAccessControlRule(v **types.AccessControlRu return err } + case "NotImpersonationRoleIds": + if err := awsAwsjson11_deserializeDocumentImpersonationRoleIdList(&sv.NotImpersonationRoleIds, value); err != nil { + return err + } + case "NotIpRanges": if err := awsAwsjson11_deserializeDocumentIpRangeList(&sv.NotIpRanges, value); err != nil { return err @@ -10304,11 +11175,263 @@ func awsAwsjson11_deserializeDocumentDeviceUserAgentList(v *[]string, value inte cv = append(cv, col) } - *v = cv + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDirectoryInUseException(v **types.DirectoryInUseException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectoryInUseException + if *v == nil { + sv = &types.DirectoryInUseException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(v **types.DirectoryServiceAuthenticationFailedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectoryServiceAuthenticationFailedException + if *v == nil { + sv = &types.DirectoryServiceAuthenticationFailedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.DirectoryUnavailableException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectoryUnavailableException + if *v == nil { + sv = &types.DirectoryUnavailableException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDnsRecord(v **types.DnsRecord, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DnsRecord + if *v == nil { + sv = &types.DnsRecord{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Hostname": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Hostname = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDnsRecords(v *[]types.DnsRecord, 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.DnsRecord + if *v == nil { + cv = []types.DnsRecord{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DnsRecord + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDnsRecord(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailAddressInUseException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmailAddressInUseException + if *v == nil { + sv = &types.EmailAddressInUseException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } -func awsAwsjson11_deserializeDocumentDirectoryInUseException(v **types.DirectoryInUseException, value interface{}) error { +func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types.EntityAlreadyRegisteredException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10321,9 +11444,9 @@ func awsAwsjson11_deserializeDocumentDirectoryInUseException(v **types.Directory return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DirectoryInUseException + var sv *types.EntityAlreadyRegisteredException if *v == nil { - sv = &types.DirectoryInUseException{} + sv = &types.EntityAlreadyRegisteredException{} } else { sv = *v } @@ -10348,7 +11471,7 @@ func awsAwsjson11_deserializeDocumentDirectoryInUseException(v **types.Directory return nil } -func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(v **types.DirectoryServiceAuthenticationFailedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10361,9 +11484,9 @@ func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedExcepti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DirectoryServiceAuthenticationFailedException + var sv *types.EntityNotFoundException if *v == nil { - sv = &types.DirectoryServiceAuthenticationFailedException{} + sv = &types.EntityNotFoundException{} } else { sv = *v } @@ -10388,7 +11511,7 @@ func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedExcepti return nil } -func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.DirectoryUnavailableException, value interface{}) error { +func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10401,9 +11524,9 @@ func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.Dir return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DirectoryUnavailableException + var sv *types.EntityStateException if *v == nil { - sv = &types.DirectoryUnavailableException{} + sv = &types.EntityStateException{} } else { sv = *v } @@ -10428,7 +11551,7 @@ func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.Dir return nil } -func awsAwsjson11_deserializeDocumentDnsRecord(v **types.DnsRecord, value interface{}) error { +func awsAwsjson11_deserializeDocumentFolderConfiguration(v **types.FolderConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10441,40 +11564,44 @@ func awsAwsjson11_deserializeDocumentDnsRecord(v **types.DnsRecord, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DnsRecord + var sv *types.FolderConfiguration if *v == nil { - sv = &types.DnsRecord{} + sv = &types.FolderConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "Hostname": + case "Action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected RetentionAction to be of type string, got %T instead", value) } - sv.Hostname = ptr.String(jtv) + sv.Action = types.RetentionAction(jtv) } - case "Type": + case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected FolderName to be of type string, got %T instead", value) } - sv.Type = ptr.String(jtv) + sv.Name = types.FolderName(jtv) } - case "Value": + case "Period": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected RetentionPeriod to be json.Number, got %T instead", value) } - sv.Value = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Period = ptr.Int32(int32(i64)) } default: @@ -10486,7 +11613,7 @@ func awsAwsjson11_deserializeDocumentDnsRecord(v **types.DnsRecord, value interf return nil } -func awsAwsjson11_deserializeDocumentDnsRecords(v *[]types.DnsRecord, value interface{}) error { +func awsAwsjson11_deserializeDocumentFolderConfigurations(v *[]types.FolderConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10499,17 +11626,17 @@ func awsAwsjson11_deserializeDocumentDnsRecords(v *[]types.DnsRecord, value inte return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DnsRecord + var cv []types.FolderConfiguration if *v == nil { - cv = []types.DnsRecord{} + cv = []types.FolderConfiguration{} } else { cv = *v } for _, value := range shape { - var col types.DnsRecord + var col types.FolderConfiguration destAddr := &col - if err := awsAwsjson11_deserializeDocumentDnsRecord(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentFolderConfiguration(&destAddr, value); err != nil { return err } col = *destAddr @@ -10520,7 +11647,7 @@ func awsAwsjson11_deserializeDocumentDnsRecords(v *[]types.DnsRecord, value inte return nil } -func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailAddressInUseException, value interface{}) error { +func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10533,22 +11660,81 @@ func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EmailAddressInUseException + var sv *types.Group if *v == nil { - sv = &types.EmailAddressInUseException{} + sv = &types.Group{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "DisabledDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DisabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Email": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Email = ptr.String(jtv) + } + + case "EnabledDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) + } + sv.State = types.EntityState(jtv) } default: @@ -10560,7 +11746,7 @@ func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailA return nil } -func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types.EntityAlreadyRegisteredException, value interface{}) error { +func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10568,39 +11754,33 @@ func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types. return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityAlreadyRegisteredException + var cv []types.Group if *v == nil { - sv = &types.EntityAlreadyRegisteredException{} + cv = []types.Group{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.Group + destAddr := &col + if err := awsAwsjson11_deserializeDocumentGroup(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationMatchedRule(v **types.ImpersonationMatchedRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10613,22 +11793,31 @@ func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNot return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityNotFoundException + var sv *types.ImpersonationMatchedRule if *v == nil { - sv = &types.EntityNotFoundException{} + sv = &types.ImpersonationMatchedRule{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "ImpersonationRuleId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRuleId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.ImpersonationRuleId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) } default: @@ -10640,7 +11829,41 @@ func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNot return nil } -func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateException, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationMatchedRuleList(v *[]types.ImpersonationMatchedRule, 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.ImpersonationMatchedRule + if *v == nil { + cv = []types.ImpersonationMatchedRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ImpersonationMatchedRule + destAddr := &col + if err := awsAwsjson11_deserializeDocumentImpersonationMatchedRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentImpersonationRole(v **types.ImpersonationRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10648,27 +11871,77 @@ func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateE return nil } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ImpersonationRole + if *v == nil { + sv = &types.ImpersonationRole{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "ImpersonationRoleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleId to be of type string, got %T instead", value) + } + sv.ImpersonationRoleId = ptr.String(jtv) + } - var sv *types.EntityStateException - if *v == nil { - sv = &types.EntityStateException{} - } else { - sv = *v - } + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "Message": + case "Type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRoleType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Type = types.ImpersonationRoleType(jtv) } default: @@ -10680,7 +11953,7 @@ func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateE return nil } -func awsAwsjson11_deserializeDocumentFolderConfiguration(v **types.FolderConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationRoleIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10688,61 +11961,35 @@ func awsAwsjson11_deserializeDocumentFolderConfiguration(v **types.FolderConfigu return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FolderConfiguration + var cv []string if *v == nil { - sv = &types.FolderConfiguration{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RetentionAction to be of type string, got %T instead", value) - } - sv.Action = types.RetentionAction(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FolderName to be of type string, got %T instead", value) - } - sv.Name = types.FolderName(jtv) - } - - case "Period": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected RetentionPeriod to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Period = ptr.Int32(int32(i64)) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleId to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentFolderConfigurations(v *[]types.FolderConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationRoleList(v *[]types.ImpersonationRole, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10755,17 +12002,17 @@ func awsAwsjson11_deserializeDocumentFolderConfigurations(v *[]types.FolderConfi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.FolderConfiguration + var cv []types.ImpersonationRole if *v == nil { - cv = []types.FolderConfiguration{} + cv = []types.ImpersonationRole{} } else { cv = *v } for _, value := range shape { - var col types.FolderConfiguration + var col types.ImpersonationRole destAddr := &col - if err := awsAwsjson11_deserializeDocumentFolderConfiguration(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentImpersonationRole(&destAddr, value); err != nil { return err } col = *destAddr @@ -10776,7 +12023,7 @@ func awsAwsjson11_deserializeDocumentFolderConfigurations(v *[]types.FolderConfi return nil } -func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationRule(v **types.ImpersonationRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10789,81 +12036,59 @@ func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) e return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Group + var sv *types.ImpersonationRule if *v == nil { - sv = &types.Group{} + sv = &types.ImpersonationRule{} } else { sv = *v } for key, value := range shape { switch key { - case "DisabledDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DisabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Email": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRuleDescription to be of type string, got %T instead", value) } - sv.Email = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "EnabledDate": + case "Effect": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessEffect to be of type string, got %T instead", value) } + sv.Effect = types.AccessEffect(jtv) } - case "Id": + case "ImpersonationRuleId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRuleId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.ImpersonationRuleId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRuleName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) - } - sv.State = types.EntityState(jtv) + case "NotTargetUsers": + if err := awsAwsjson11_deserializeDocumentTargetUsers(&sv.NotTargetUsers, value); err != nil { + return err + } + + case "TargetUsers": + if err := awsAwsjson11_deserializeDocumentTargetUsers(&sv.TargetUsers, value); err != nil { + return err } default: @@ -10875,7 +12100,7 @@ func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) e return nil } -func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) error { +func awsAwsjson11_deserializeDocumentImpersonationRuleList(v *[]types.ImpersonationRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10888,17 +12113,17 @@ func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Group + var cv []types.ImpersonationRule if *v == nil { - cv = []types.Group{} + cv = []types.ImpersonationRule{} } else { cv = *v } for _, value := range shape { - var col types.Group + var col types.ImpersonationRule destAddr := &col - if err := awsAwsjson11_deserializeDocumentGroup(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentImpersonationRule(&destAddr, value); err != nil { return err } col = *destAddr @@ -12816,6 +14041,42 @@ func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) return nil } +func awsAwsjson11_deserializeDocumentTargetUsers(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityIdentifier to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13145,6 +14406,59 @@ func awsAwsjson11_deserializeOpDocumentAssociateMemberToGroupOutput(v **Associat return nil } +func awsAwsjson11_deserializeOpDocumentAssumeImpersonationRoleOutput(v **AssumeImpersonationRoleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssumeImpersonationRoleOutput + if *v == nil { + sv = &AssumeImpersonationRoleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExpiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpiresIn to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = ptr.Int64(i64) + } + + case "Token": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationToken to be of type string, got %T instead", value) + } + sv.Token = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCancelMailboxExportJobOutput(v **CancelMailboxExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13207,7 +14521,38 @@ func awsAwsjson11_deserializeOpDocumentCreateAliasOutput(v **CreateAliasOutput, return nil } -func awsAwsjson11_deserializeOpDocumentCreateAvailabilityConfigurationOutput(v **CreateAvailabilityConfigurationOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentCreateAvailabilityConfigurationOutput(v **CreateAvailabilityConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateAvailabilityConfigurationOutput + if *v == nil { + sv = &CreateAvailabilityConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13220,15 +14565,24 @@ func awsAwsjson11_deserializeOpDocumentCreateAvailabilityConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateAvailabilityConfigurationOutput + var sv *CreateGroupOutput if *v == nil { - sv = &CreateAvailabilityConfigurationOutput{} + sv = &CreateGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "GroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.GroupId = ptr.String(jtv) + } + default: _, _ = key, value @@ -13238,7 +14592,7 @@ func awsAwsjson11_deserializeOpDocumentCreateAvailabilityConfigurationOutput(v * return nil } -func awsAwsjson11_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentCreateImpersonationRoleOutput(v **CreateImpersonationRoleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13251,22 +14605,22 @@ func awsAwsjson11_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateGroupOutput + var sv *CreateImpersonationRoleOutput if *v == nil { - sv = &CreateGroupOutput{} + sv = &CreateImpersonationRoleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "GroupId": + case "ImpersonationRoleId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + return fmt.Errorf("expected ImpersonationRoleId to be of type string, got %T instead", value) } - sv.GroupId = ptr.String(jtv) + sv.ImpersonationRoleId = ptr.String(jtv) } default: @@ -13593,6 +14947,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, return nil } +func awsAwsjson11_deserializeOpDocumentDeleteImpersonationRoleOutput(v **DeleteImpersonationRoleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteImpersonationRoleOutput + if *v == nil { + sv = &DeleteImpersonationRoleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **DeleteMailboxPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14754,6 +16139,164 @@ func awsAwsjson11_deserializeOpDocumentGetDefaultRetentionPolicyOutput(v **GetDe return nil } +func awsAwsjson11_deserializeOpDocumentGetImpersonationRoleEffectOutput(v **GetImpersonationRoleEffectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetImpersonationRoleEffectOutput + if *v == nil { + sv = &GetImpersonationRoleEffectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessEffect to be of type string, got %T instead", value) + } + sv.Effect = types.AccessEffect(jtv) + } + + case "MatchedRules": + if err := awsAwsjson11_deserializeDocumentImpersonationMatchedRuleList(&sv.MatchedRules, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleType to be of type string, got %T instead", value) + } + sv.Type = types.ImpersonationRoleType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetImpersonationRoleOutput(v **GetImpersonationRoleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetImpersonationRoleOutput + if *v == nil { + sv = &GetImpersonationRoleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DateCreated": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DateModified": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "ImpersonationRoleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleId to be of type string, got %T instead", value) + } + sv.ImpersonationRoleId = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Rules": + if err := awsAwsjson11_deserializeDocumentImpersonationRuleList(&sv.Rules, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImpersonationRoleType to be of type string, got %T instead", value) + } + sv.Type = types.ImpersonationRoleType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(v **GetMailboxDetailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15264,6 +16807,51 @@ func awsAwsjson11_deserializeOpDocumentListGroupsOutput(v **ListGroupsOutput, va return nil } +func awsAwsjson11_deserializeOpDocumentListImpersonationRolesOutput(v **ListImpersonationRolesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListImpersonationRolesOutput + if *v == nil { + sv = &ListImpersonationRolesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Roles": + if err := awsAwsjson11_deserializeDocumentImpersonationRoleList(&sv.Roles, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(v **ListMailboxExportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16188,6 +17776,37 @@ func awsAwsjson11_deserializeOpDocumentUpdateDefaultMailDomainOutput(v **UpdateD return nil } +func awsAwsjson11_deserializeOpDocumentUpdateImpersonationRoleOutput(v **UpdateImpersonationRoleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateImpersonationRoleOutput + if *v == nil { + sv = &UpdateImpersonationRoleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(v **UpdateMailboxQuotaOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/workmail/doc.go b/service/workmail/doc.go index 37ca239966a..423ff08bd14 100644 --- a/service/workmail/doc.go +++ b/service/workmail/doc.go @@ -3,7 +3,7 @@ // Package workmail provides the API client, operations, and parameter types for // Amazon WorkMail. // -// Amazon WorkMail is a secure, managed business email and calendaring service with +// WorkMail is a secure, managed business email and calendaring service with // support for existing desktop and mobile email clients. You can access your // email, contacts, and calendars using Microsoft Outlook, your browser, or other // native iOS and Android email applications. You can integrate WorkMail with your diff --git a/service/workmail/generated.json b/service/workmail/generated.json index dea2230e79b..68c5c6952dc 100644 --- a/service/workmail/generated.json +++ b/service/workmail/generated.json @@ -10,10 +10,12 @@ "api_client_test.go", "api_op_AssociateDelegateToResource.go", "api_op_AssociateMemberToGroup.go", + "api_op_AssumeImpersonationRole.go", "api_op_CancelMailboxExportJob.go", "api_op_CreateAlias.go", "api_op_CreateAvailabilityConfiguration.go", "api_op_CreateGroup.go", + "api_op_CreateImpersonationRole.go", "api_op_CreateMobileDeviceAccessRule.go", "api_op_CreateOrganization.go", "api_op_CreateResource.go", @@ -23,6 +25,7 @@ "api_op_DeleteAvailabilityConfiguration.go", "api_op_DeleteEmailMonitoringConfiguration.go", "api_op_DeleteGroup.go", + "api_op_DeleteImpersonationRole.go", "api_op_DeleteMailboxPermissions.go", "api_op_DeleteMobileDeviceAccessOverride.go", "api_op_DeleteMobileDeviceAccessRule.go", @@ -43,6 +46,8 @@ "api_op_DisassociateMemberFromGroup.go", "api_op_GetAccessControlEffect.go", "api_op_GetDefaultRetentionPolicy.go", + "api_op_GetImpersonationRole.go", + "api_op_GetImpersonationRoleEffect.go", "api_op_GetMailDomain.go", "api_op_GetMailboxDetails.go", "api_op_GetMobileDeviceAccessEffect.go", @@ -52,6 +57,7 @@ "api_op_ListAvailabilityConfigurations.go", "api_op_ListGroupMembers.go", "api_op_ListGroups.go", + "api_op_ListImpersonationRoles.go", "api_op_ListMailDomains.go", "api_op_ListMailboxExportJobs.go", "api_op_ListMailboxPermissions.go", @@ -77,6 +83,7 @@ "api_op_UntagResource.go", "api_op_UpdateAvailabilityConfiguration.go", "api_op_UpdateDefaultMailDomain.go", + "api_op_UpdateImpersonationRole.go", "api_op_UpdateMailboxQuota.go", "api_op_UpdateMobileDeviceAccessRule.go", "api_op_UpdatePrimaryEmailAddress.go", diff --git a/service/workmail/serializers.go b/service/workmail/serializers.go index 93542c841ae..bff27d8247a 100644 --- a/service/workmail/serializers.go +++ b/service/workmail/serializers.go @@ -125,6 +125,61 @@ func (m *awsAwsjson11_serializeOpAssociateMemberToGroup) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpAssumeImpersonationRole struct { +} + +func (*awsAwsjson11_serializeOpAssumeImpersonationRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpAssumeImpersonationRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeImpersonationRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.AssumeImpersonationRole") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentAssumeImpersonationRoleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCancelMailboxExportJob struct { } @@ -345,6 +400,61 @@ func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateImpersonationRole struct { +} + +func (*awsAwsjson11_serializeOpCreateImpersonationRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateImpersonationRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateImpersonationRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateImpersonationRole") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateImpersonationRoleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateMobileDeviceAccessRule struct { } @@ -840,6 +950,61 @@ func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteImpersonationRole struct { +} + +func (*awsAwsjson11_serializeOpDeleteImpersonationRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteImpersonationRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteImpersonationRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteImpersonationRole") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteImpersonationRoleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteMailboxPermissions struct { } @@ -1940,6 +2105,116 @@ func (m *awsAwsjson11_serializeOpGetDefaultRetentionPolicy) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetImpersonationRole struct { +} + +func (*awsAwsjson11_serializeOpGetImpersonationRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetImpersonationRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetImpersonationRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetImpersonationRole") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetImpersonationRoleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetImpersonationRoleEffect struct { +} + +func (*awsAwsjson11_serializeOpGetImpersonationRoleEffect) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetImpersonationRoleEffect) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetImpersonationRoleEffectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetImpersonationRoleEffect") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetImpersonationRoleEffectInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetMailboxDetails struct { } @@ -2435,14 +2710,14 @@ func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMailboxExportJobs struct { +type awsAwsjson11_serializeOpListImpersonationRoles struct { } -func (*awsAwsjson11_serializeOpListMailboxExportJobs) ID() string { +func (*awsAwsjson11_serializeOpListImpersonationRoles) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListImpersonationRoles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2450,7 +2725,7 @@ func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMailboxExportJobsInput) + input, ok := in.Parameters.(*ListImpersonationRolesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2471,10 +2746,10 @@ func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxExportJobs") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListImpersonationRoles") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMailboxExportJobsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListImpersonationRolesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2490,14 +2765,69 @@ func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMailboxPermissions struct { +type awsAwsjson11_serializeOpListMailboxExportJobs struct { } -func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_serializeOpListMailboxExportJobs) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMailboxExportJobsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxExportJobs") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMailboxExportJobsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListMailboxPermissions struct { +} + +func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -3810,6 +4140,61 @@ func (m *awsAwsjson11_serializeOpUpdateDefaultMailDomain) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateImpersonationRole struct { +} + +func (*awsAwsjson11_serializeOpUpdateImpersonationRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateImpersonationRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateImpersonationRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.UpdateImpersonationRole") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateImpersonationRoleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateMailboxQuota struct { } @@ -4193,6 +4578,71 @@ func awsAwsjson11_serializeDocumentFolderConfigurations(v []types.FolderConfigur return nil } +func awsAwsjson11_serializeDocumentImpersonationRoleIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentImpersonationRule(v *types.ImpersonationRule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.Effect) > 0 { + ok := object.Key("Effect") + ok.String(string(v.Effect)) + } + + if v.ImpersonationRuleId != nil { + ok := object.Key("ImpersonationRuleId") + ok.String(*v.ImpersonationRuleId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.NotTargetUsers != nil { + ok := object.Key("NotTargetUsers") + if err := awsAwsjson11_serializeDocumentTargetUsers(v.NotTargetUsers, ok); err != nil { + return err + } + } + + if v.TargetUsers != nil { + ok := object.Key("TargetUsers") + if err := awsAwsjson11_serializeDocumentTargetUsers(v.TargetUsers, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentImpersonationRuleList(v []types.ImpersonationRule, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentImpersonationRule(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentIpRangeList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4268,6 +4718,17 @@ func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentTargetUsers(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentUserIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4323,6 +4784,23 @@ func awsAwsjson11_serializeOpDocumentAssociateMemberToGroupInput(v *AssociateMem return nil } +func awsAwsjson11_serializeOpDocumentAssumeImpersonationRoleInput(v *AssumeImpersonationRoleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCancelMailboxExportJobInput(v *CancelMailboxExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4420,6 +4898,45 @@ func awsAwsjson11_serializeOpDocumentCreateGroupInput(v *CreateGroupInput, value return nil } +func awsAwsjson11_serializeOpDocumentCreateImpersonationRoleInput(v *CreateImpersonationRoleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.Rules != nil { + ok := object.Key("Rules") + if err := awsAwsjson11_serializeDocumentImpersonationRuleList(v.Rules, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateMobileDeviceAccessRuleInput(v *CreateMobileDeviceAccessRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4681,6 +5198,23 @@ func awsAwsjson11_serializeOpDocumentDeleteGroupInput(v *DeleteGroupInput, value return nil } +func awsAwsjson11_serializeOpDocumentDeleteImpersonationRoleInput(v *DeleteImpersonationRoleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteMailboxPermissionsInput(v *DeleteMailboxPermissionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5006,6 +5540,11 @@ func awsAwsjson11_serializeOpDocumentGetAccessControlEffectInput(v *GetAccessCon ok.String(*v.Action) } + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + if v.IpAddress != nil { ok := object.Key("IpAddress") ok.String(*v.IpAddress) @@ -5036,6 +5575,45 @@ func awsAwsjson11_serializeOpDocumentGetDefaultRetentionPolicyInput(v *GetDefaul return nil } +func awsAwsjson11_serializeOpDocumentGetImpersonationRoleEffectInput(v *GetImpersonationRoleEffectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.TargetUser != nil { + ok := object.Key("TargetUser") + ok.String(*v.TargetUser) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetImpersonationRoleInput(v *GetImpersonationRoleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetMailboxDetailsInput(v *GetMailboxDetailsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5234,6 +5812,28 @@ func awsAwsjson11_serializeOpDocumentListGroupsInput(v *ListGroupsInput, value s return nil } +func awsAwsjson11_serializeOpDocumentListImpersonationRolesInput(v *ListImpersonationRolesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListMailboxExportJobsInput(v *ListMailboxExportJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5470,6 +6070,13 @@ func awsAwsjson11_serializeOpDocumentPutAccessControlRuleInput(v *PutAccessContr ok.String(string(v.Effect)) } + if v.ImpersonationRoleIds != nil { + ok := object.Key("ImpersonationRoleIds") + if err := awsAwsjson11_serializeDocumentImpersonationRoleIdList(v.ImpersonationRoleIds, ok); err != nil { + return err + } + } + if v.IpRanges != nil { ok := object.Key("IpRanges") if err := awsAwsjson11_serializeDocumentIpRangeList(v.IpRanges, ok); err != nil { @@ -5489,6 +6096,13 @@ func awsAwsjson11_serializeOpDocumentPutAccessControlRuleInput(v *PutAccessContr } } + if v.NotImpersonationRoleIds != nil { + ok := object.Key("NotImpersonationRoleIds") + if err := awsAwsjson11_serializeDocumentImpersonationRoleIdList(v.NotImpersonationRoleIds, ok); err != nil { + return err + } + } + if v.NotIpRanges != nil { ok := object.Key("NotIpRanges") if err := awsAwsjson11_serializeDocumentIpRangeList(v.NotIpRanges, ok); err != nil { @@ -5882,6 +6496,45 @@ func awsAwsjson11_serializeOpDocumentUpdateDefaultMailDomainInput(v *UpdateDefau return nil } +func awsAwsjson11_serializeOpDocumentUpdateImpersonationRoleInput(v *UpdateImpersonationRoleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.ImpersonationRoleId != nil { + ok := object.Key("ImpersonationRoleId") + ok.String(*v.ImpersonationRoleId) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.Rules != nil { + ok := object.Key("Rules") + if err := awsAwsjson11_serializeDocumentImpersonationRuleList(v.Rules, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateMailboxQuotaInput(v *UpdateMailboxQuotaInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/workmail/types/enums.go b/service/workmail/types/enums.go index 59e858cf1fd..2924256d1bc 100644 --- a/service/workmail/types/enums.go +++ b/service/workmail/types/enums.go @@ -20,6 +20,24 @@ func (AccessControlRuleEffect) Values() []AccessControlRuleEffect { } } +type AccessEffect string + +// Enum values for AccessEffect +const ( + AccessEffectAllow AccessEffect = "ALLOW" + AccessEffectDeny AccessEffect = "DENY" +) + +// Values returns all known values for AccessEffect. 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 (AccessEffect) Values() []AccessEffect { + return []AccessEffect{ + "ALLOW", + "DENY", + } +} + type AvailabilityProviderType string // Enum values for AvailabilityProviderType @@ -102,6 +120,24 @@ func (FolderName) Values() []FolderName { } } +type ImpersonationRoleType string + +// Enum values for ImpersonationRoleType +const ( + ImpersonationRoleTypeFullAccess ImpersonationRoleType = "FULL_ACCESS" + ImpersonationRoleTypeReadOnly ImpersonationRoleType = "READ_ONLY" +) + +// Values returns all known values for ImpersonationRoleType. 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 (ImpersonationRoleType) Values() []ImpersonationRoleType { + return []ImpersonationRoleType{ + "FULL_ACCESS", + "READ_ONLY", + } +} + type MailboxExportJobState string // Enum values for MailboxExportJobState diff --git a/service/workmail/types/errors.go b/service/workmail/types/errors.go index c20cf4720ff..cefcb68d85c 100644 --- a/service/workmail/types/errors.go +++ b/service/workmail/types/errors.go @@ -172,9 +172,9 @@ func (e *InvalidConfigurationException) ErrorMessage() string { func (e *InvalidConfigurationException) ErrorCode() string { return "InvalidConfigurationException" } func (e *InvalidConfigurationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You SES configuration has customizations that Amazon WorkMail cannot save. The -// error message lists the invalid setting. For examples of invalid settings, refer -// to CreateReceiptRule +// You SES configuration has customizations that WorkMail cannot save. The error +// message lists the invalid setting. For examples of invalid settings, refer to +// CreateReceiptRule // (https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateReceiptRule.html). type InvalidCustomSesConfigurationException struct { Message *string @@ -315,7 +315,7 @@ func (e *MailDomainStateException) ErrorMessage() string { func (e *MailDomainStateException) ErrorCode() string { return "MailDomainStateException" } func (e *MailDomainStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The user, group, or resource name isn't unique in Amazon WorkMail. +// The user, group, or resource name isn't unique in WorkMail. type NameAvailabilityException struct { Message *string @@ -374,7 +374,7 @@ func (e *OrganizationStateException) ErrorMessage() string { func (e *OrganizationStateException) ErrorCode() string { return "OrganizationStateException" } func (e *OrganizationStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// This user, group, or resource name is not allowed in Amazon WorkMail. +// This user, group, or resource name is not allowed in WorkMail. type ReservedNameException struct { Message *string diff --git a/service/workmail/types/types.go b/service/workmail/types/types.go index c667db3fd55..61254d04aad 100644 --- a/service/workmail/types/types.go +++ b/service/workmail/types/types.go @@ -7,7 +7,7 @@ import ( "time" ) -// A rule that controls access to an Amazon WorkMail organization. +// A rule that controls access to an WorkMail organization. type AccessControlRule struct { // Access protocol actions to include in the rule. Valid values include ActiveSync, @@ -26,6 +26,9 @@ type AccessControlRule struct { // The rule effect. Effect AccessControlRuleEffect + // Impersonation role IDs to include in the rule. + ImpersonationRoleIds []string + // IPv4 CIDR ranges to include in the rule. IpRanges []string @@ -36,6 +39,9 @@ type AccessControlRule struct { // ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. NotActions []string + // Impersonation role IDs to exclude from the rule. + NotImpersonationRoleIds []string + // IPv4 CIDR ranges to exclude from the rule. NotIpRanges []string @@ -61,7 +67,7 @@ type AvailabilityConfiguration struct { DomainName *string // If ProviderType is EWS, then this field contains - // RedactedEwsAvailabilityProvider. Otherwise, it is not requried. + // RedactedEwsAvailabilityProvider. Otherwise, it is not required. EwsProvider *RedactedEwsAvailabilityProvider // If ProviderType is LAMBDA then this field contains LambdaAvailabilityProvider. @@ -123,11 +129,11 @@ type DnsRecord struct { noSmithyDocumentSerde } -// The domain to associate with an Amazon WorkMail organization. When you configure -// a domain hosted in Amazon Route 53 (Route 53), all recommended DNS records are +// The domain to associate with an WorkMail organization. When you configure a +// domain hosted in Amazon Route 53 (Route 53), all recommended DNS records are // added to the organization when you create it. For more information, see Adding a // domain (https://docs.aws.amazon.com/workmail/latest/adminguide/add_domain.html) -// in the Amazon WorkMail Administrator Guide. +// in the WorkMail Administrator Guide. type Domain struct { // The fully qualified domain name. @@ -182,16 +188,16 @@ type FolderConfiguration struct { noSmithyDocumentSerde } -// The representation of an Amazon WorkMail group. +// The representation of an WorkMail group. type Group struct { - // The date indicating when the group was disabled from Amazon WorkMail use. + // The date indicating when the group was disabled from WorkMail use. DisabledDate *time.Time // The email of the group. Email *string - // The date indicating when the group was enabled for Amazon WorkMail use. + // The date indicating when the group was enabled for WorkMail use. EnabledDate *time.Time // The identifier of the group. @@ -206,6 +212,68 @@ type Group struct { noSmithyDocumentSerde } +// The impersonation rule that matched the input. +type ImpersonationMatchedRule struct { + + // The ID of the rule that matched the input + ImpersonationRuleId *string + + // The name of the rule that matched the input. + Name *string + + noSmithyDocumentSerde +} + +// An impersonation role for the given WorkMail organization. +type ImpersonationRole struct { + + // The date when the impersonation role was created. + DateCreated *time.Time + + // The date when the impersonation role was last modified. + DateModified *time.Time + + // The identifier of the impersonation role. + ImpersonationRoleId *string + + // The impersonation role name. + Name *string + + // The impersonation role type. + Type ImpersonationRoleType + + noSmithyDocumentSerde +} + +// The rules for the given impersonation role. +type ImpersonationRule struct { + + // The effect of the rule when it matches the input. Allowed effect values are + // ALLOW or DENY. + // + // This member is required. + Effect AccessEffect + + // The identifier of the rule. + // + // This member is required. + ImpersonationRuleId *string + + // The rule description. + Description *string + + // The rule name. + Name *string + + // A list of user IDs that don't match the rule. + NotTargetUsers []string + + // A list of user IDs that match the rule. + TargetUsers []string + + noSmithyDocumentSerde +} + // Describes a Lambda based availability provider. type LambdaAvailabilityProvider struct { @@ -268,10 +336,10 @@ type MailDomainSummary struct { // The representation of a user or group. type Member struct { - // The date indicating when the member was disabled from Amazon WorkMail use. + // The date indicating when the member was disabled from WorkMail use. DisabledDate *time.Time - // The date indicating when the member was enabled for Amazon WorkMail use. + // The date indicating when the member was enabled for WorkMail use. EnabledDate *time.Time // The identifier of the member. @@ -325,7 +393,7 @@ type MobileDeviceAccessOverride struct { noSmithyDocumentSerde } -// A rule that controls access to mobile devices for an Amazon WorkMail group. +// A rule that controls access to mobile devices for an WorkMail group. type MobileDeviceAccessRule struct { // The date and time at which an access rule was created. @@ -442,13 +510,13 @@ type RedactedEwsAvailabilityProvider struct { // The representation of a resource. type Resource struct { - // The date indicating when the resource was disabled from Amazon WorkMail use. + // The date indicating when the resource was disabled from WorkMail use. DisabledDate *time.Time // The email of the resource. Email *string - // The date indicating when the resource was enabled for Amazon WorkMail use. + // The date indicating when the resource was enabled for WorkMail use. EnabledDate *time.Time // The identifier of the resource. @@ -482,10 +550,10 @@ type Tag struct { noSmithyDocumentSerde } -// The representation of an Amazon WorkMail user. +// The representation of an WorkMail user. type User struct { - // The date indicating when the user was disabled from Amazon WorkMail use. + // The date indicating when the user was disabled from WorkMail use. DisabledDate *time.Time // The display name of the user. @@ -494,7 +562,7 @@ type User struct { // The email of the user. Email *string - // The date indicating when the user was enabled for Amazon WorkMail use. + // The date indicating when the user was enabled for WorkMail use. EnabledDate *time.Time // The identifier of the user. diff --git a/service/workmail/validators.go b/service/workmail/validators.go index 4affbfc10cc..4b538bcf12f 100644 --- a/service/workmail/validators.go +++ b/service/workmail/validators.go @@ -50,6 +50,26 @@ func (m *validateOpAssociateMemberToGroup) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpAssumeImpersonationRole struct { +} + +func (*validateOpAssumeImpersonationRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeImpersonationRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCancelMailboxExportJob struct { } @@ -130,6 +150,26 @@ func (m *validateOpCreateGroup) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateImpersonationRole struct { +} + +func (*validateOpCreateImpersonationRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateImpersonationRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateMobileDeviceAccessRule struct { } @@ -310,6 +350,26 @@ func (m *validateOpDeleteGroup) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteImpersonationRole struct { +} + +func (*validateOpDeleteImpersonationRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteImpersonationRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteMailboxPermissions struct { } @@ -710,6 +770,46 @@ func (m *validateOpGetDefaultRetentionPolicy) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpGetImpersonationRoleEffect struct { +} + +func (*validateOpGetImpersonationRoleEffect) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetImpersonationRoleEffect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetImpersonationRoleEffectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetImpersonationRoleEffectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetImpersonationRole struct { +} + +func (*validateOpGetImpersonationRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetImpersonationRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetMailboxDetails struct { } @@ -890,6 +990,26 @@ func (m *validateOpListGroups) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpListImpersonationRoles struct { +} + +func (*validateOpListImpersonationRoles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListImpersonationRoles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListImpersonationRolesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListImpersonationRolesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListMailboxExportJobs struct { } @@ -1370,6 +1490,26 @@ func (m *validateOpUpdateDefaultMailDomain) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpUpdateImpersonationRole struct { +} + +func (*validateOpUpdateImpersonationRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateImpersonationRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateImpersonationRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateImpersonationRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateMailboxQuota struct { } @@ -1458,6 +1598,10 @@ func addOpAssociateMemberToGroupValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpAssociateMemberToGroup{}, middleware.After) } +func addOpAssumeImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeImpersonationRole{}, middleware.After) +} + func addOpCancelMailboxExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelMailboxExportJob{}, middleware.After) } @@ -1474,6 +1618,10 @@ func addOpCreateGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGroup{}, middleware.After) } +func addOpCreateImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateImpersonationRole{}, middleware.After) +} + func addOpCreateMobileDeviceAccessRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMobileDeviceAccessRule{}, middleware.After) } @@ -1510,6 +1658,10 @@ func addOpDeleteGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteGroup{}, middleware.After) } +func addOpDeleteImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteImpersonationRole{}, middleware.After) +} + func addOpDeleteMailboxPermissionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMailboxPermissions{}, middleware.After) } @@ -1590,6 +1742,14 @@ func addOpGetDefaultRetentionPolicyValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpGetDefaultRetentionPolicy{}, middleware.After) } +func addOpGetImpersonationRoleEffectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetImpersonationRoleEffect{}, middleware.After) +} + +func addOpGetImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetImpersonationRole{}, middleware.After) +} + func addOpGetMailboxDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMailboxDetails{}, middleware.After) } @@ -1626,6 +1786,10 @@ func addOpListGroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListGroups{}, middleware.After) } +func addOpListImpersonationRolesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListImpersonationRoles{}, middleware.After) +} + func addOpListMailboxExportJobsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMailboxExportJobs{}, middleware.After) } @@ -1722,6 +1886,10 @@ func addOpUpdateDefaultMailDomainValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpUpdateDefaultMailDomain{}, middleware.After) } +func addOpUpdateImpersonationRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateImpersonationRole{}, middleware.After) +} + func addOpUpdateMailboxQuotaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMailboxQuota{}, middleware.After) } @@ -1794,6 +1962,41 @@ func validateFolderConfigurations(v []types.FolderConfiguration) error { } } +func validateImpersonationRule(v *types.ImpersonationRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ImpersonationRule"} + if v.ImpersonationRuleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRuleId")) + } + if len(v.Effect) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Effect")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateImpersonationRuleList(v []types.ImpersonationRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ImpersonationRuleList"} + for i := range v { + if err := validateImpersonationRule(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLambdaAvailabilityProvider(v *types.LambdaAvailabilityProvider) error { if v == nil { return nil @@ -1886,6 +2089,24 @@ func validateOpAssociateMemberToGroupInput(v *AssociateMemberToGroupInput) error } } +func validateOpAssumeImpersonationRoleInput(v *AssumeImpersonationRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeImpersonationRoleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.ImpersonationRoleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRoleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelMailboxExportJobInput(v *CancelMailboxExportJobInput) error { if v == nil { return nil @@ -1974,6 +2195,34 @@ func validateOpCreateGroupInput(v *CreateGroupInput) error { } } +func validateOpCreateImpersonationRoleInput(v *CreateImpersonationRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateImpersonationRoleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Rules == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rules")) + } else if v.Rules != nil { + if err := validateImpersonationRuleList(v.Rules); err != nil { + invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateMobileDeviceAccessRuleInput(v *CreateMobileDeviceAccessRuleInput) error { if v == nil { return nil @@ -2145,6 +2394,24 @@ func validateOpDeleteGroupInput(v *DeleteGroupInput) error { } } +func validateOpDeleteImpersonationRoleInput(v *DeleteImpersonationRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteImpersonationRoleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.ImpersonationRoleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRoleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteMailboxPermissionsInput(v *DeleteMailboxPermissionsInput) error { if v == nil { return nil @@ -2483,9 +2750,6 @@ func validateOpGetAccessControlEffectInput(v *GetAccessControlEffectInput) error if v.Action == nil { invalidParams.Add(smithy.NewErrParamRequired("Action")) } - if v.UserId == nil { - invalidParams.Add(smithy.NewErrParamRequired("UserId")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2508,6 +2772,45 @@ func validateOpGetDefaultRetentionPolicyInput(v *GetDefaultRetentionPolicyInput) } } +func validateOpGetImpersonationRoleEffectInput(v *GetImpersonationRoleEffectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetImpersonationRoleEffectInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.ImpersonationRoleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRoleId")) + } + if v.TargetUser == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetUser")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetImpersonationRoleInput(v *GetImpersonationRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetImpersonationRoleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.ImpersonationRoleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRoleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetMailboxDetailsInput(v *GetMailboxDetailsInput) error { if v == nil { return nil @@ -2661,6 +2964,21 @@ func validateOpListGroupsInput(v *ListGroupsInput) error { } } +func validateOpListImpersonationRolesInput(v *ListImpersonationRolesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListImpersonationRolesInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListMailboxExportJobsInput(v *ListMailboxExportJobsInput) error { if v == nil { return nil @@ -3142,6 +3460,37 @@ func validateOpUpdateDefaultMailDomainInput(v *UpdateDefaultMailDomainInput) err } } +func validateOpUpdateImpersonationRoleInput(v *UpdateImpersonationRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateImpersonationRoleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.ImpersonationRoleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ImpersonationRoleId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Rules == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rules")) + } else if v.Rules != nil { + if err := validateImpersonationRuleList(v.Rules); err != nil { + invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateMailboxQuotaInput(v *UpdateMailboxQuotaInput) error { if v == nil { return nil