/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ /* * Do not modify this file. This file is generated from the macie2-2020-01-01.normal.json service model. */ using System; using System.Globalization; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.Macie2; using Amazon.Macie2.Model; using Amazon.Macie2.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using Amazon.Util; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public partial class Macie2MarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("macie2"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitationMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = AcceptInvitationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as AcceptInvitationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void AcceptInvitation_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("AcceptInvitation"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AcceptInvitationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("AcceptInvitation", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = AcceptInvitationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiersMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as BatchGetCustomDataIdentifiersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void BatchGetCustomDataIdentifiers_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowListMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateAllowListResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateAllowListResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateAllowList_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJobMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateClassificationJobResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateClassificationJobResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateClassificationJob_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifierMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateCustomDataIdentifierResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateCustomDataIdentifierResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateCustomDataIdentifier_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilterMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateFindingsFilterResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateFindingsFilterResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateFindingsFilter_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitationsMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateInvitationsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateInvitationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateInvitations_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMemberMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateMemberResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateMemberResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateMember_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindingsMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateSampleFindingsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateSampleFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void CreateSampleFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSampleFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSampleFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSampleFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSampleFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitationsMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeclineInvitationsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeclineInvitationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeclineInvitations_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeclineInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeclineInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeclineInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeclineInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowListMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeleteAllowListResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteAllowListResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowList_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowList_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowList_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowList_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteAllowList_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifierMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeleteCustomDataIdentifierResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteCustomDataIdentifierResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteCustomDataIdentifier_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilterMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeleteFindingsFilterResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteFindingsFilterResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteFindingsFilter_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitationsMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeleteInvitationsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteInvitationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteInvitations_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMemberMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DeleteMemberResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteMemberResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DeleteMember_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBucketsMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DescribeBucketsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DescribeBucketsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeBuckets_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeBuckets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeBucketsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeBuckets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeBucketsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJobMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DescribeClassificationJobResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DescribeClassificationJobResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeClassificationJob_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfigurationMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DescribeOrganizationConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DescribeOrganizationConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DescribeOrganizationConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DescribeOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DescribeOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacieMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DisableMacieResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DisableMacieResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableMacie_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DisableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccountMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DisableOrganizationAdminAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DisableOrganizationAdminAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisableOrganizationAdminAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DisableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccountMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DisassociateFromAdministratorAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromAdministratorAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccountMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DisassociateFromMasterAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DisassociateFromMasterAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateFromMasterAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateFromMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateFromMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateFromMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateFromMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMemberMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = DisassociateMemberResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DisassociateMemberResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void DisassociateMember_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DisassociateMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DisassociateMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DisassociateMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DisassociateMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacieMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = EnableMacieResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as EnableMacieResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableMacie_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("EnableMacie"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableMacieRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableMacie", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableMacieResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccountMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = EnableOrganizationAdminAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as EnableOrganizationAdminAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void EnableOrganizationAdminAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("EnableOrganizationAdminAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new EnableOrganizationAdminAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("EnableOrganizationAdminAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = EnableOrganizationAdminAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccountMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAdministratorAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAdministratorAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAdministratorAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAdministratorAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAdministratorAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAdministratorAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAdministratorAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowListMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAllowListResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAllowListResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowList_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowList_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowList_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowList_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAllowList_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAutomatedDiscoveryConfigurationMarshallTest() { var operation = service_model.FindOperation("GetAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetAutomatedDiscoveryConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAutomatedDiscoveryConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAutomatedDiscoveryConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAutomatedDiscoveryConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetAutomatedDiscoveryConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatisticsMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetBucketStatisticsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetBucketStatisticsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetBucketStatistics_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetBucketStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetBucketStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetBucketStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetBucketStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfigurationMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetClassificationExportConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetClassificationExportConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationExportConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScopeMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetClassificationScopeResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetClassificationScopeResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScope_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScope_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScope_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScope_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetClassificationScope_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifierMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetCustomDataIdentifierResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetCustomDataIdentifierResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetCustomDataIdentifier_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetFindingsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilterMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetFindingsFilterResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetFindingsFilterResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsFilter_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfigurationMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetFindingsPublicationConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingsPublicationConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatisticsMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetFindingStatisticsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetFindingStatisticsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetFindingStatistics_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetFindingStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetFindingStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetFindingStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetFindingStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCountMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetInvitationsCountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetInvitationsCountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetInvitationsCount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetInvitationsCount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInvitationsCountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInvitationsCount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInvitationsCountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSessionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetMacieSessionResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetMacieSessionResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMacieSession_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccountMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetMasterAccountResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetMasterAccountResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMasterAccount_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetMasterAccount"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMasterAccountRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMasterAccount", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMasterAccountResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMemberMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetMemberResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetMemberResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetMember_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetMember"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMemberRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMember", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMemberResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfileMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetResourceProfileResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetResourceProfileResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetResourceProfile_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetRevealConfigurationMarshallTest() { var operation = service_model.FindOperation("GetRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetRevealConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetRevealConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetRevealConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetRevealConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetRevealConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetRevealConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetRevealConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSensitiveDataOccurrencesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrences_UnprocessableEntityExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrences"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrences", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("UnprocessableEntityException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","UnprocessableEntityException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesAvailabilityMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrencesAvailability"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrencesAvailability", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetSensitiveDataOccurrencesAvailabilityResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSensitiveDataOccurrencesAvailabilityResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesAvailability_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrencesAvailability"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrencesAvailability", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesAvailabilityResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesAvailability_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrencesAvailability"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrencesAvailability", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesAvailabilityResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesAvailability_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrencesAvailability"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrencesAvailability", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesAvailabilityResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitiveDataOccurrencesAvailability_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitiveDataOccurrencesAvailability"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitiveDataOccurrencesAvailabilityRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitiveDataOccurrencesAvailability", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitiveDataOccurrencesAvailabilityResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplateMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSensitivityInspectionTemplateResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplate_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplate_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplate_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplate_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetSensitivityInspectionTemplate_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatisticsMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetUsageStatisticsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetUsageStatisticsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageStatistics_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotalsMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetUsageTotalsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetUsageTotalsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void GetUsageTotals_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("GetUsageTotals"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetUsageTotalsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetUsageTotals", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetUsageTotalsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListAllowListsMarshallTest() { var operation = service_model.FindOperation("ListAllowLists"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAllowListsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAllowLists", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListAllowListsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListAllowListsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListAllowLists_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAllowLists"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAllowListsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAllowLists", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAllowListsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListAllowLists_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListAllowLists"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAllowListsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAllowLists", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAllowListsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListAllowLists_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListAllowLists"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAllowListsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAllowLists", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAllowListsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListAllowLists_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListAllowLists"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAllowListsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListAllowLists", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListAllowListsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobsMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListClassificationJobsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListClassificationJobsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationJobs_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationJobs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationJobsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationJobs", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationJobsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationScopesMarshallTest() { var operation = service_model.FindOperation("ListClassificationScopes"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationScopesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationScopes", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListClassificationScopesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListClassificationScopesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationScopes_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationScopes"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationScopesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationScopes", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationScopesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationScopes_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationScopes"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationScopesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationScopes", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationScopesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationScopes_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationScopes"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationScopesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationScopes", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationScopesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListClassificationScopes_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListClassificationScopes"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListClassificationScopesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListClassificationScopes", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListClassificationScopesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiersMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListCustomDataIdentifiersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListCustomDataIdentifiersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListCustomDataIdentifiers_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListCustomDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListCustomDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListCustomDataIdentifiers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListCustomDataIdentifiersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListFindingsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindings_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindings", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFiltersMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListFindingsFiltersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListFindingsFiltersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListFindingsFilters_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindingsFilters"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsFiltersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFindingsFilters", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFindingsFiltersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitationsMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListInvitationsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListInvitationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListInvitations_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListInvitations"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListInvitationsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListInvitations", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListInvitationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListManagedDataIdentifiersMarshallTest() { var operation = service_model.FindOperation("ListManagedDataIdentifiers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListManagedDataIdentifiersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListManagedDataIdentifiers", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListManagedDataIdentifiersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListManagedDataIdentifiersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembersMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListMembersResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListMembersResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListMembers_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListMembers"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListMembersRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListMembers", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListMembersResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccountsMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListOrganizationAdminAccountsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListOrganizationAdminAccountsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListOrganizationAdminAccounts_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListOrganizationAdminAccounts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOrganizationAdminAccountsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListOrganizationAdminAccounts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListOrganizationAdminAccountsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifactsMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListResourceProfileArtifactsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListResourceProfileArtifactsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifacts_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileArtifactsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifacts_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileArtifactsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifacts_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileArtifactsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifacts_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileArtifactsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileArtifacts_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileArtifacts"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileArtifactsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileArtifacts", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileArtifactsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetectionsMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListResourceProfileDetectionsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListResourceProfileDetectionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListResourceProfileDetections_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplatesMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListSensitivityInspectionTemplatesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplates_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplates_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplates_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplates_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListSensitivityInspectionTemplates_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListSensitivityInspectionTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListSensitivityInspectionTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListSensitivityInspectionTemplates", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListSensitivityInspectionTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void ListTagsForResourceMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListTagsForResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfigurationMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = PutClassificationExportConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutClassificationExportConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutClassificationExportConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("PutClassificationExportConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutClassificationExportConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutClassificationExportConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutClassificationExportConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfigurationMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutFindingsPublicationConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void PutFindingsPublicationConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("PutFindingsPublicationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutFindingsPublicationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutFindingsPublicationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutFindingsPublicationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResourcesMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = SearchResourcesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as SearchResourcesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void SearchResources_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("SearchResources"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SearchResourcesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("SearchResources", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = SearchResourcesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TagResourceMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = TagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifierMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = TestCustomDataIdentifierResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TestCustomDataIdentifierResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void TestCustomDataIdentifier_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("TestCustomDataIdentifier"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TestCustomDataIdentifierRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TestCustomDataIdentifier", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TestCustomDataIdentifierResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UntagResourceMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UntagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UntagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowListMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateAllowListResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateAllowListResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowList_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowList_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowList_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowList_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAllowList_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAllowList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAllowListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAllowList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAllowListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAutomatedDiscoveryConfigurationMarshallTest() { var operation = service_model.FindOperation("UpdateAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateAutomatedDiscoveryConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAutomatedDiscoveryConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAutomatedDiscoveryConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAutomatedDiscoveryConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateAutomatedDiscoveryConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAutomatedDiscoveryConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAutomatedDiscoveryConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateAutomatedDiscoveryConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateAutomatedDiscoveryConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJobMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateClassificationJobResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateClassificationJobResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationJob_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationJob"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationJobRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationJob", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationJobResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScopeMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateClassificationScopeResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateClassificationScopeResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScope_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScope_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScope_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScope_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateClassificationScope_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateClassificationScope"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateClassificationScopeRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateClassificationScope", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateClassificationScopeResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilterMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateFindingsFilterResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateFindingsFilterResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateFindingsFilter_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateFindingsFilter"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateFindingsFilterRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateFindingsFilter", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateFindingsFilterResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSessionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateMacieSessionResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateMacieSessionResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMacieSession_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMacieSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMacieSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMacieSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMacieSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSessionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateMemberSessionResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateMemberSessionResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateMemberSession_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateMemberSession"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateMemberSessionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateMemberSession", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateMemberSessionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfigurationMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateOrganizationConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateOrganizationConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_ConflictExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ConflictException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ConflictException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateOrganizationConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateOrganizationConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateOrganizationConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateOrganizationConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateOrganizationConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateResourceProfileResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateResourceProfileResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfile_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfile"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfile", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetectionsMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateResourceProfileDetectionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_ServiceQuotaExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceQuotaExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceQuotaExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateResourceProfileDetections_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateResourceProfileDetections"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateResourceProfileDetectionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateResourceProfileDetections", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateResourceProfileDetectionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateRevealConfigurationMarshallTest() { var operation = service_model.FindOperation("UpdateRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateRevealConfiguration", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateRevealConfigurationResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateRevealConfigurationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateRevealConfiguration_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateRevealConfiguration_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateRevealConfiguration_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateRevealConfiguration_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateRevealConfiguration"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateRevealConfigurationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateRevealConfiguration", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateRevealConfigurationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplateMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateSensitivityInspectionTemplateResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplate_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplate_InternalServerExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalServerException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalServerException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplate_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplate_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottlingException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottlingException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("Macie2")] public void UpdateSensitivityInspectionTemplate_ValidationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSensitivityInspectionTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSensitivityInspectionTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSensitivityInspectionTemplate", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ValidationException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ValidationException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSensitivityInspectionTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }