repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateAssessmentFrameworkControlSet Marshaller /// </summary> public class CreateAssessmentFrameworkControlSetMarshaller : IRequestMarshaller<CreateAssessmentFrameworkControlSet, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(CreateAssessmentFrameworkControlSet requestObject, JsonMarshallerContext context) { if(requestObject.IsSetControls()) { context.Writer.WritePropertyName("controls"); context.Writer.WriteArrayStart(); foreach(var requestObjectControlsListValue in requestObject.Controls) { context.Writer.WriteObjectStart(); var marshaller = CreateAssessmentFrameworkControlMarshaller.Instance; marshaller.Marshall(requestObjectControlsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(requestObject.Name); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static CreateAssessmentFrameworkControlSetMarshaller Instance = new CreateAssessmentFrameworkControlSetMarshaller(); } }
78
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateAssessmentFramework Request Marshaller /// </summary> public class CreateAssessmentFrameworkRequestMarshaller : IMarshaller<IRequest, CreateAssessmentFrameworkRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((CreateAssessmentFrameworkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAssessmentFrameworkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; request.ResourcePath = "/assessmentFrameworks"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetComplianceType()) { context.Writer.WritePropertyName("complianceType"); context.Writer.Write(publicRequest.ComplianceType); } if(publicRequest.IsSetControlSets()) { context.Writer.WritePropertyName("controlSets"); context.Writer.WriteArrayStart(); foreach(var publicRequestControlSetsListValue in publicRequest.ControlSets) { context.Writer.WriteObjectStart(); var marshaller = CreateAssessmentFrameworkControlSetMarshaller.Instance; marshaller.Marshall(publicRequestControlSetsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("tags"); context.Writer.WriteObjectStart(); foreach (var publicRequestTagsKvp in publicRequest.Tags) { context.Writer.WritePropertyName(publicRequestTagsKvp.Key); var publicRequestTagsValue = publicRequestTagsKvp.Value; context.Writer.Write(publicRequestTagsValue); } context.Writer.WriteObjectEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateAssessmentFrameworkRequestMarshaller _instance = new CreateAssessmentFrameworkRequestMarshaller(); internal static CreateAssessmentFrameworkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentFrameworkRequestMarshaller Instance { get { return _instance; } } } }
143
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAssessmentFramework operation /// </summary> public class CreateAssessmentFrameworkResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateAssessmentFrameworkResponse response = new CreateAssessmentFrameworkResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("framework", targetDepth)) { var unmarshaller = FrameworkUnmarshaller.Instance; response.Framework = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceQuotaExceededException")) { return ServiceQuotaExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAssessmentFrameworkResponseUnmarshaller _instance = new CreateAssessmentFrameworkResponseUnmarshaller(); internal static CreateAssessmentFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
126
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateAssessmentReport Request Marshaller /// </summary> public class CreateAssessmentReportRequestMarshaller : IMarshaller<IRequest, CreateAssessmentReportRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((CreateAssessmentReportRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAssessmentReportRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); request.ResourcePath = "/assessments/{assessmentId}/reports"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetQueryStatement()) { context.Writer.WritePropertyName("queryStatement"); context.Writer.Write(publicRequest.QueryStatement); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateAssessmentReportRequestMarshaller _instance = new CreateAssessmentReportRequestMarshaller(); internal static CreateAssessmentReportRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentReportRequestMarshaller Instance { get { return _instance; } } } }
116
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAssessmentReport operation /// </summary> public class CreateAssessmentReportResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateAssessmentReportResponse response = new CreateAssessmentReportResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentReport", targetDepth)) { var unmarshaller = AssessmentReportUnmarshaller.Instance; response.AssessmentReport = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAssessmentReportResponseUnmarshaller _instance = new CreateAssessmentReportResponseUnmarshaller(); internal static CreateAssessmentReportResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentReportResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateAssessment Request Marshaller /// </summary> public class CreateAssessmentRequestMarshaller : IMarshaller<IRequest, CreateAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((CreateAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; request.ResourcePath = "/assessments"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAssessmentReportsDestination()) { context.Writer.WritePropertyName("assessmentReportsDestination"); context.Writer.WriteObjectStart(); var marshaller = AssessmentReportsDestinationMarshaller.Instance; marshaller.Marshall(publicRequest.AssessmentReportsDestination, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetFrameworkId()) { context.Writer.WritePropertyName("frameworkId"); context.Writer.Write(publicRequest.FrameworkId); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetRoles()) { context.Writer.WritePropertyName("roles"); context.Writer.WriteArrayStart(); foreach(var publicRequestRolesListValue in publicRequest.Roles) { context.Writer.WriteObjectStart(); var marshaller = RoleMarshaller.Instance; marshaller.Marshall(publicRequestRolesListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetScope()) { context.Writer.WritePropertyName("scope"); context.Writer.WriteObjectStart(); var marshaller = ScopeMarshaller.Instance; marshaller.Marshall(publicRequest.Scope, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("tags"); context.Writer.WriteObjectStart(); foreach (var publicRequestTagsKvp in publicRequest.Tags) { context.Writer.WritePropertyName(publicRequestTagsKvp.Key); var publicRequestTagsValue = publicRequestTagsKvp.Value; context.Writer.Write(publicRequestTagsValue); } context.Writer.WriteObjectEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateAssessmentRequestMarshaller _instance = new CreateAssessmentRequestMarshaller(); internal static CreateAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentRequestMarshaller Instance { get { return _instance; } } } }
165
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAssessment operation /// </summary> public class CreateAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateAssessmentResponse response = new CreateAssessmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessment", targetDepth)) { var unmarshaller = AssessmentUnmarshaller.Instance; response.Assessment = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceQuotaExceededException")) { return ServiceQuotaExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAssessmentResponseUnmarshaller _instance = new CreateAssessmentResponseUnmarshaller(); internal static CreateAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
126
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateControlMappingSource Marshaller /// </summary> public class CreateControlMappingSourceMarshaller : IRequestMarshaller<CreateControlMappingSource, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(CreateControlMappingSource requestObject, JsonMarshallerContext context) { if(requestObject.IsSetSourceDescription()) { context.Writer.WritePropertyName("sourceDescription"); context.Writer.Write(requestObject.SourceDescription); } if(requestObject.IsSetSourceFrequency()) { context.Writer.WritePropertyName("sourceFrequency"); context.Writer.Write(requestObject.SourceFrequency); } if(requestObject.IsSetSourceKeyword()) { context.Writer.WritePropertyName("sourceKeyword"); context.Writer.WriteObjectStart(); var marshaller = SourceKeywordMarshaller.Instance; marshaller.Marshall(requestObject.SourceKeyword, context); context.Writer.WriteObjectEnd(); } if(requestObject.IsSetSourceName()) { context.Writer.WritePropertyName("sourceName"); context.Writer.Write(requestObject.SourceName); } if(requestObject.IsSetSourceSetUpOption()) { context.Writer.WritePropertyName("sourceSetUpOption"); context.Writer.Write(requestObject.SourceSetUpOption); } if(requestObject.IsSetSourceType()) { context.Writer.WritePropertyName("sourceType"); context.Writer.Write(requestObject.SourceType); } if(requestObject.IsSetTroubleshootingText()) { context.Writer.WritePropertyName("troubleshootingText"); context.Writer.Write(requestObject.TroubleshootingText); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static CreateControlMappingSourceMarshaller Instance = new CreateControlMappingSourceMarshaller(); } }
103
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateControl Request Marshaller /// </summary> public class CreateControlRequestMarshaller : IMarshaller<IRequest, CreateControlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((CreateControlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateControlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; request.ResourcePath = "/controls"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetActionPlanInstructions()) { context.Writer.WritePropertyName("actionPlanInstructions"); context.Writer.Write(publicRequest.ActionPlanInstructions); } if(publicRequest.IsSetActionPlanTitle()) { context.Writer.WritePropertyName("actionPlanTitle"); context.Writer.Write(publicRequest.ActionPlanTitle); } if(publicRequest.IsSetControlMappingSources()) { context.Writer.WritePropertyName("controlMappingSources"); context.Writer.WriteArrayStart(); foreach(var publicRequestControlMappingSourcesListValue in publicRequest.ControlMappingSources) { context.Writer.WriteObjectStart(); var marshaller = CreateControlMappingSourceMarshaller.Instance; marshaller.Marshall(publicRequestControlMappingSourcesListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetTags()) { context.Writer.WritePropertyName("tags"); context.Writer.WriteObjectStart(); foreach (var publicRequestTagsKvp in publicRequest.Tags) { context.Writer.WritePropertyName(publicRequestTagsKvp.Key); var publicRequestTagsValue = publicRequestTagsKvp.Value; context.Writer.Write(publicRequestTagsValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTestingInformation()) { context.Writer.WritePropertyName("testingInformation"); context.Writer.Write(publicRequest.TestingInformation); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateControlRequestMarshaller _instance = new CreateControlRequestMarshaller(); internal static CreateControlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateControlRequestMarshaller Instance { get { return _instance; } } } }
155
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateControl operation /// </summary> public class CreateControlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateControlResponse response = new CreateControlResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("control", targetDepth)) { var unmarshaller = ControlUnmarshaller.Instance; response.Control = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceQuotaExceededException")) { return ServiceQuotaExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateControlResponseUnmarshaller _instance = new CreateControlResponseUnmarshaller(); internal static CreateControlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateControlResponseUnmarshaller Instance { get { return _instance; } } } }
126
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// CreateDelegationRequest Marshaller /// </summary> public class CreateDelegationRequestMarshaller : IRequestMarshaller<CreateDelegationRequest, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(CreateDelegationRequest requestObject, JsonMarshallerContext context) { if(requestObject.IsSetComment()) { context.Writer.WritePropertyName("comment"); context.Writer.Write(requestObject.Comment); } if(requestObject.IsSetControlSetId()) { context.Writer.WritePropertyName("controlSetId"); context.Writer.Write(requestObject.ControlSetId); } if(requestObject.IsSetRoleArn()) { context.Writer.WritePropertyName("roleArn"); context.Writer.Write(requestObject.RoleArn); } if(requestObject.IsSetRoleType()) { context.Writer.WritePropertyName("roleType"); context.Writer.Write(requestObject.RoleType); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static CreateDelegationRequestMarshaller Instance = new CreateDelegationRequestMarshaller(); } }
80
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateDelegationRequest Object /// </summary> public class CreateDelegationRequestUnmarshaller : IUnmarshaller<CreateDelegationRequest, XmlUnmarshallerContext>, IUnmarshaller<CreateDelegationRequest, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> CreateDelegationRequest IUnmarshaller<CreateDelegationRequest, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public CreateDelegationRequest Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; CreateDelegationRequest unmarshalledObject = new CreateDelegationRequest(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("comment", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Comment = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("controlSetId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ControlSetId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("roleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("roleType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RoleType = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static CreateDelegationRequestUnmarshaller _instance = new CreateDelegationRequestUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static CreateDelegationRequestUnmarshaller Instance { get { return _instance; } } } }
110
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DefaultExportDestination Marshaller /// </summary> public class DefaultExportDestinationMarshaller : IRequestMarshaller<DefaultExportDestination, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(DefaultExportDestination requestObject, JsonMarshallerContext context) { if(requestObject.IsSetDestination()) { context.Writer.WritePropertyName("destination"); context.Writer.Write(requestObject.Destination); } if(requestObject.IsSetDestinationType()) { context.Writer.WritePropertyName("destinationType"); context.Writer.Write(requestObject.DestinationType); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static DefaultExportDestinationMarshaller Instance = new DefaultExportDestinationMarshaller(); } }
68
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DefaultExportDestination Object /// </summary> public class DefaultExportDestinationUnmarshaller : IUnmarshaller<DefaultExportDestination, XmlUnmarshallerContext>, IUnmarshaller<DefaultExportDestination, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> DefaultExportDestination IUnmarshaller<DefaultExportDestination, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public DefaultExportDestination Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; DefaultExportDestination unmarshalledObject = new DefaultExportDestination(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("destination", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Destination = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("destinationType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DestinationType = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DefaultExportDestinationUnmarshaller _instance = new DefaultExportDestinationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DefaultExportDestinationUnmarshaller Instance { get { return _instance; } } } }
98
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DelegationMetadata Object /// </summary> public class DelegationMetadataUnmarshaller : IUnmarshaller<DelegationMetadata, XmlUnmarshallerContext>, IUnmarshaller<DelegationMetadata, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> DelegationMetadata IUnmarshaller<DelegationMetadata, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public DelegationMetadata Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; DelegationMetadata unmarshalledObject = new DelegationMetadata(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AssessmentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("assessmentName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AssessmentName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("controlSetName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ControlSetName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("creationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Id = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("roleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Status = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DelegationMetadataUnmarshaller _instance = new DelegationMetadataUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DelegationMetadataUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Delegation Object /// </summary> public class DelegationUnmarshaller : IUnmarshaller<Delegation, XmlUnmarshallerContext>, IUnmarshaller<Delegation, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Delegation IUnmarshaller<Delegation, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public Delegation Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Delegation unmarshalledObject = new Delegation(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AssessmentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("assessmentName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AssessmentName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("comment", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Comment = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("controlSetId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ControlSetId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdBy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("creationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Id = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdated", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("roleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("roleType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.RoleType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Status = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DelegationUnmarshaller _instance = new DelegationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DelegationUnmarshaller Instance { get { return _instance; } } } }
152
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAssessmentFramework Request Marshaller /// </summary> public class DeleteAssessmentFrameworkRequestMarshaller : IMarshaller<IRequest, DeleteAssessmentFrameworkRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteAssessmentFrameworkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAssessmentFrameworkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetFrameworkId()) throw new AmazonAuditManagerException("Request object does not have required field FrameworkId set"); request.AddPathResource("{frameworkId}", StringUtils.FromString(publicRequest.FrameworkId)); request.ResourcePath = "/assessmentFrameworks/{frameworkId}"; return request; } private static DeleteAssessmentFrameworkRequestMarshaller _instance = new DeleteAssessmentFrameworkRequestMarshaller(); internal static DeleteAssessmentFrameworkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentFrameworkRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAssessmentFramework operation /// </summary> public class DeleteAssessmentFrameworkResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteAssessmentFrameworkResponse response = new DeleteAssessmentFrameworkResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAssessmentFrameworkResponseUnmarshaller _instance = new DeleteAssessmentFrameworkResponseUnmarshaller(); internal static DeleteAssessmentFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAssessmentFrameworkShare Request Marshaller /// </summary> public class DeleteAssessmentFrameworkShareRequestMarshaller : IMarshaller<IRequest, DeleteAssessmentFrameworkShareRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteAssessmentFrameworkShareRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAssessmentFrameworkShareRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetRequestId()) throw new AmazonAuditManagerException("Request object does not have required field RequestId set"); request.AddPathResource("{requestId}", StringUtils.FromString(publicRequest.RequestId)); if (publicRequest.IsSetRequestType()) request.Parameters.Add("requestType", StringUtils.FromString(publicRequest.RequestType)); request.ResourcePath = "/assessmentFrameworkShareRequests/{requestId}"; request.UseQueryString = true; return request; } private static DeleteAssessmentFrameworkShareRequestMarshaller _instance = new DeleteAssessmentFrameworkShareRequestMarshaller(); internal static DeleteAssessmentFrameworkShareRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentFrameworkShareRequestMarshaller Instance { get { return _instance; } } } }
91
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAssessmentFrameworkShare operation /// </summary> public class DeleteAssessmentFrameworkShareResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteAssessmentFrameworkShareResponse response = new DeleteAssessmentFrameworkShareResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAssessmentFrameworkShareResponseUnmarshaller _instance = new DeleteAssessmentFrameworkShareResponseUnmarshaller(); internal static DeleteAssessmentFrameworkShareResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentFrameworkShareResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAssessmentReport Request Marshaller /// </summary> public class DeleteAssessmentReportRequestMarshaller : IMarshaller<IRequest, DeleteAssessmentReportRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteAssessmentReportRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAssessmentReportRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetAssessmentReportId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentReportId set"); request.AddPathResource("{assessmentReportId}", StringUtils.FromString(publicRequest.AssessmentReportId)); request.ResourcePath = "/assessments/{assessmentId}/reports/{assessmentReportId}"; return request; } private static DeleteAssessmentReportRequestMarshaller _instance = new DeleteAssessmentReportRequestMarshaller(); internal static DeleteAssessmentReportRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentReportRequestMarshaller Instance { get { return _instance; } } } }
90
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAssessmentReport operation /// </summary> public class DeleteAssessmentReportResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteAssessmentReportResponse response = new DeleteAssessmentReportResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAssessmentReportResponseUnmarshaller _instance = new DeleteAssessmentReportResponseUnmarshaller(); internal static DeleteAssessmentReportResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentReportResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAssessment Request Marshaller /// </summary> public class DeleteAssessmentRequestMarshaller : IMarshaller<IRequest, DeleteAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); request.ResourcePath = "/assessments/{assessmentId}"; return request; } private static DeleteAssessmentRequestMarshaller _instance = new DeleteAssessmentRequestMarshaller(); internal static DeleteAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAssessment operation /// </summary> public class DeleteAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteAssessmentResponse response = new DeleteAssessmentResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAssessmentResponseUnmarshaller _instance = new DeleteAssessmentResponseUnmarshaller(); internal static DeleteAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeleteControl Request Marshaller /// </summary> public class DeleteControlRequestMarshaller : IMarshaller<IRequest, DeleteControlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeleteControlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteControlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetControlId()) throw new AmazonAuditManagerException("Request object does not have required field ControlId set"); request.AddPathResource("{controlId}", StringUtils.FromString(publicRequest.ControlId)); request.ResourcePath = "/controls/{controlId}"; return request; } private static DeleteControlRequestMarshaller _instance = new DeleteControlRequestMarshaller(); internal static DeleteControlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteControlRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteControl operation /// </summary> public class DeleteControlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteControlResponse response = new DeleteControlResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteControlResponseUnmarshaller _instance = new DeleteControlResponseUnmarshaller(); internal static DeleteControlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteControlResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeregisterAccount Request Marshaller /// </summary> public class DeregisterAccountRequestMarshaller : IMarshaller<IRequest, DeregisterAccountRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeregisterAccountRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeregisterAccountRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; request.ResourcePath = "/account/deregisterAccount"; return request; } private static DeregisterAccountRequestMarshaller _instance = new DeregisterAccountRequestMarshaller(); internal static DeregisterAccountRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeregisterAccountRequestMarshaller Instance { get { return _instance; } } } }
85
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeregisterAccount operation /// </summary> public class DeregisterAccountResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeregisterAccountResponse response = new DeregisterAccountResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeregisterAccountResponseUnmarshaller _instance = new DeregisterAccountResponseUnmarshaller(); internal static DeregisterAccountResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeregisterAccountResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeregisterOrganizationAdminAccount Request Marshaller /// </summary> public class DeregisterOrganizationAdminAccountRequestMarshaller : IMarshaller<IRequest, DeregisterOrganizationAdminAccountRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DeregisterOrganizationAdminAccountRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeregisterOrganizationAdminAccountRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "POST"; request.ResourcePath = "/account/deregisterOrganizationAdminAccount"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAdminAccountId()) { context.Writer.WritePropertyName("adminAccountId"); context.Writer.Write(publicRequest.AdminAccountId); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static DeregisterOrganizationAdminAccountRequestMarshaller _instance = new DeregisterOrganizationAdminAccountRequestMarshaller(); internal static DeregisterOrganizationAdminAccountRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeregisterOrganizationAdminAccountRequestMarshaller Instance { get { return _instance; } } } }
101
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeregisterOrganizationAdminAccount operation /// </summary> public class DeregisterOrganizationAdminAccountResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeregisterOrganizationAdminAccountResponse response = new DeregisterOrganizationAdminAccountResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeregisterOrganizationAdminAccountResponseUnmarshaller _instance = new DeregisterOrganizationAdminAccountResponseUnmarshaller(); internal static DeregisterOrganizationAdminAccountResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeregisterOrganizationAdminAccountResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DeregistrationPolicy Marshaller /// </summary> public class DeregistrationPolicyMarshaller : IRequestMarshaller<DeregistrationPolicy, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(DeregistrationPolicy requestObject, JsonMarshallerContext context) { if(requestObject.IsSetDeleteResources()) { context.Writer.WritePropertyName("deleteResources"); context.Writer.Write(requestObject.DeleteResources); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static DeregistrationPolicyMarshaller Instance = new DeregistrationPolicyMarshaller(); } }
62
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeregistrationPolicy Object /// </summary> public class DeregistrationPolicyUnmarshaller : IUnmarshaller<DeregistrationPolicy, XmlUnmarshallerContext>, IUnmarshaller<DeregistrationPolicy, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> DeregistrationPolicy IUnmarshaller<DeregistrationPolicy, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public DeregistrationPolicy Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; DeregistrationPolicy unmarshalledObject = new DeregistrationPolicy(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("deleteResources", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DeleteResources = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DeregistrationPolicyUnmarshaller _instance = new DeregistrationPolicyUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DeregistrationPolicyUnmarshaller Instance { get { return _instance; } } } }
92
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// DisassociateAssessmentReportEvidenceFolder Request Marshaller /// </summary> public class DisassociateAssessmentReportEvidenceFolderRequestMarshaller : IMarshaller<IRequest, DisassociateAssessmentReportEvidenceFolderRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((DisassociateAssessmentReportEvidenceFolderRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DisassociateAssessmentReportEvidenceFolderRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "PUT"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); request.ResourcePath = "/assessments/{assessmentId}/disassociateFromAssessmentReport"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetEvidenceFolderId()) { context.Writer.WritePropertyName("evidenceFolderId"); context.Writer.Write(publicRequest.EvidenceFolderId); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static DisassociateAssessmentReportEvidenceFolderRequestMarshaller _instance = new DisassociateAssessmentReportEvidenceFolderRequestMarshaller(); internal static DisassociateAssessmentReportEvidenceFolderRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateAssessmentReportEvidenceFolderRequestMarshaller Instance { get { return _instance; } } } }
104
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DisassociateAssessmentReportEvidenceFolder operation /// </summary> public class DisassociateAssessmentReportEvidenceFolderResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DisassociateAssessmentReportEvidenceFolderResponse response = new DisassociateAssessmentReportEvidenceFolderResponse(); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DisassociateAssessmentReportEvidenceFolderResponseUnmarshaller _instance = new DisassociateAssessmentReportEvidenceFolderResponseUnmarshaller(); internal static DisassociateAssessmentReportEvidenceFolderResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateAssessmentReportEvidenceFolderResponseUnmarshaller Instance { get { return _instance; } } } }
111
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for EvidenceFinderEnablement Object /// </summary> public class EvidenceFinderEnablementUnmarshaller : IUnmarshaller<EvidenceFinderEnablement, XmlUnmarshallerContext>, IUnmarshaller<EvidenceFinderEnablement, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> EvidenceFinderEnablement IUnmarshaller<EvidenceFinderEnablement, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public EvidenceFinderEnablement Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; EvidenceFinderEnablement unmarshalledObject = new EvidenceFinderEnablement(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("backfillStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.BackfillStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("enablementStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EnablementStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("error", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Error = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("eventDataStoreArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EventDataStoreArn = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static EvidenceFinderEnablementUnmarshaller _instance = new EvidenceFinderEnablementUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static EvidenceFinderEnablementUnmarshaller Instance { get { return _instance; } } } }
110
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for EvidenceInsights Object /// </summary> public class EvidenceInsightsUnmarshaller : IUnmarshaller<EvidenceInsights, XmlUnmarshallerContext>, IUnmarshaller<EvidenceInsights, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> EvidenceInsights IUnmarshaller<EvidenceInsights, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public EvidenceInsights Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; EvidenceInsights unmarshalledObject = new EvidenceInsights(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("compliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.CompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("inconclusiveEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.InconclusiveEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("noncompliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.NoncompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static EvidenceInsightsUnmarshaller _instance = new EvidenceInsightsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static EvidenceInsightsUnmarshaller Instance { get { return _instance; } } } }
104
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Evidence Object /// </summary> public class EvidenceUnmarshaller : IUnmarshaller<Evidence, XmlUnmarshallerContext>, IUnmarshaller<Evidence, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Evidence IUnmarshaller<Evidence, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public Evidence Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Evidence unmarshalledObject = new Evidence(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentReportSelection", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AssessmentReportSelection = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("attributes", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); unmarshalledObject.Attributes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("awsAccountId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AwsAccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("awsOrganization", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.AwsOrganization = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("complianceCheck", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ComplianceCheck = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("dataSource", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DataSource = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("eventName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EventName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("eventSource", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EventSource = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("evidenceAwsAccountId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EvidenceAwsAccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("evidenceByType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EvidenceByType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("evidenceFolderId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EvidenceFolderId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("iamId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.IamId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Id = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("resourcesIncluded", targetDepth)) { var unmarshaller = new ListUnmarshaller<Resource, ResourceUnmarshaller>(ResourceUnmarshaller.Instance); unmarshalledObject.ResourcesIncluded = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("time", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.Time = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static EvidenceUnmarshaller _instance = new EvidenceUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static EvidenceUnmarshaller Instance { get { return _instance; } } } }
176
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for FrameworkMetadata Object /// </summary> public class FrameworkMetadataUnmarshaller : IUnmarshaller<FrameworkMetadata, XmlUnmarshallerContext>, IUnmarshaller<FrameworkMetadata, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> FrameworkMetadata IUnmarshaller<FrameworkMetadata, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public FrameworkMetadata Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; FrameworkMetadata unmarshalledObject = new FrameworkMetadata(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("complianceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ComplianceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("logo", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Logo = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static FrameworkMetadataUnmarshaller _instance = new FrameworkMetadataUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static FrameworkMetadataUnmarshaller Instance { get { return _instance; } } } }
110
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Framework Object /// </summary> public class FrameworkUnmarshaller : IUnmarshaller<Framework, XmlUnmarshallerContext>, IUnmarshaller<Framework, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Framework IUnmarshaller<Framework, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public Framework Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Framework unmarshalledObject = new Framework(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("arn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Arn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("complianceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ComplianceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("controlSets", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlSet, ControlSetUnmarshaller>(ControlSetUnmarshaller.Instance); unmarshalledObject.ControlSets = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("controlSources", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ControlSources = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdBy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Id = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdatedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedBy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.LastUpdatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("logo", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Logo = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); unmarshalledObject.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static FrameworkUnmarshaller _instance = new FrameworkUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static FrameworkUnmarshaller Instance { get { return _instance; } } } }
170
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetAccountStatus Request Marshaller /// </summary> public class GetAccountStatusRequestMarshaller : IMarshaller<IRequest, GetAccountStatusRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetAccountStatusRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAccountStatusRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; request.ResourcePath = "/account/status"; return request; } private static GetAccountStatusRequestMarshaller _instance = new GetAccountStatusRequestMarshaller(); internal static GetAccountStatusRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAccountStatusRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAccountStatus operation /// </summary> public class GetAccountStatusResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetAccountStatusResponse response = new GetAccountStatusResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAccountStatusResponseUnmarshaller _instance = new GetAccountStatusResponseUnmarshaller(); internal static GetAccountStatusResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAccountStatusResponseUnmarshaller Instance { get { return _instance; } } } }
110
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetAssessmentFramework Request Marshaller /// </summary> public class GetAssessmentFrameworkRequestMarshaller : IMarshaller<IRequest, GetAssessmentFrameworkRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetAssessmentFrameworkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAssessmentFrameworkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetFrameworkId()) throw new AmazonAuditManagerException("Request object does not have required field FrameworkId set"); request.AddPathResource("{frameworkId}", StringUtils.FromString(publicRequest.FrameworkId)); request.ResourcePath = "/assessmentFrameworks/{frameworkId}"; return request; } private static GetAssessmentFrameworkRequestMarshaller _instance = new GetAssessmentFrameworkRequestMarshaller(); internal static GetAssessmentFrameworkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentFrameworkRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAssessmentFramework operation /// </summary> public class GetAssessmentFrameworkResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetAssessmentFrameworkResponse response = new GetAssessmentFrameworkResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("framework", targetDepth)) { var unmarshaller = FrameworkUnmarshaller.Instance; response.Framework = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAssessmentFrameworkResponseUnmarshaller _instance = new GetAssessmentFrameworkResponseUnmarshaller(); internal static GetAssessmentFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetAssessmentReportUrl Request Marshaller /// </summary> public class GetAssessmentReportUrlRequestMarshaller : IMarshaller<IRequest, GetAssessmentReportUrlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetAssessmentReportUrlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAssessmentReportUrlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetAssessmentReportId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentReportId set"); request.AddPathResource("{assessmentReportId}", StringUtils.FromString(publicRequest.AssessmentReportId)); request.ResourcePath = "/assessments/{assessmentId}/reports/{assessmentReportId}/url"; return request; } private static GetAssessmentReportUrlRequestMarshaller _instance = new GetAssessmentReportUrlRequestMarshaller(); internal static GetAssessmentReportUrlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentReportUrlRequestMarshaller Instance { get { return _instance; } } } }
90
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAssessmentReportUrl operation /// </summary> public class GetAssessmentReportUrlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetAssessmentReportUrlResponse response = new GetAssessmentReportUrlResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("preSignedUrl", targetDepth)) { var unmarshaller = URLUnmarshaller.Instance; response.PreSignedUrl = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAssessmentReportUrlResponseUnmarshaller _instance = new GetAssessmentReportUrlResponseUnmarshaller(); internal static GetAssessmentReportUrlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentReportUrlResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetAssessment Request Marshaller /// </summary> public class GetAssessmentRequestMarshaller : IMarshaller<IRequest, GetAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); request.ResourcePath = "/assessments/{assessmentId}"; return request; } private static GetAssessmentRequestMarshaller _instance = new GetAssessmentRequestMarshaller(); internal static GetAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAssessment operation /// </summary> public class GetAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetAssessmentResponse response = new GetAssessmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessment", targetDepth)) { var unmarshaller = AssessmentUnmarshaller.Instance; response.Assessment = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("userRole", targetDepth)) { var unmarshaller = RoleUnmarshaller.Instance; response.UserRole = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAssessmentResponseUnmarshaller _instance = new GetAssessmentResponseUnmarshaller(); internal static GetAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetChangeLogs Request Marshaller /// </summary> public class GetChangeLogsRequestMarshaller : IMarshaller<IRequest, GetChangeLogsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetChangeLogsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetChangeLogsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (publicRequest.IsSetControlId()) request.Parameters.Add("controlId", StringUtils.FromString(publicRequest.ControlId)); if (publicRequest.IsSetControlSetId()) request.Parameters.Add("controlSetId", StringUtils.FromString(publicRequest.ControlSetId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessments/{assessmentId}/changelogs"; request.UseQueryString = true; return request; } private static GetChangeLogsRequestMarshaller _instance = new GetChangeLogsRequestMarshaller(); internal static GetChangeLogsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetChangeLogsRequestMarshaller Instance { get { return _instance; } } } }
100
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetChangeLogs operation /// </summary> public class GetChangeLogsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetChangeLogsResponse response = new GetChangeLogsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("changeLogs", targetDepth)) { var unmarshaller = new ListUnmarshaller<ChangeLog, ChangeLogUnmarshaller>(ChangeLogUnmarshaller.Instance); response.ChangeLogs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetChangeLogsResponseUnmarshaller _instance = new GetChangeLogsResponseUnmarshaller(); internal static GetChangeLogsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetChangeLogsResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetControl Request Marshaller /// </summary> public class GetControlRequestMarshaller : IMarshaller<IRequest, GetControlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetControlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetControlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetControlId()) throw new AmazonAuditManagerException("Request object does not have required field ControlId set"); request.AddPathResource("{controlId}", StringUtils.FromString(publicRequest.ControlId)); request.ResourcePath = "/controls/{controlId}"; return request; } private static GetControlRequestMarshaller _instance = new GetControlRequestMarshaller(); internal static GetControlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetControlRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetControl operation /// </summary> public class GetControlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetControlResponse response = new GetControlResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("control", targetDepth)) { var unmarshaller = ControlUnmarshaller.Instance; response.Control = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetControlResponseUnmarshaller _instance = new GetControlResponseUnmarshaller(); internal static GetControlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetControlResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetDelegations Request Marshaller /// </summary> public class GetDelegationsRequestMarshaller : IMarshaller<IRequest, GetDelegationsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetDelegationsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetDelegationsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/delegations"; request.UseQueryString = true; return request; } private static GetDelegationsRequestMarshaller _instance = new GetDelegationsRequestMarshaller(); internal static GetDelegationsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDelegationsRequestMarshaller Instance { get { return _instance; } } } }
91
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetDelegations operation /// </summary> public class GetDelegationsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetDelegationsResponse response = new GetDelegationsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("delegations", targetDepth)) { var unmarshaller = new ListUnmarshaller<DelegationMetadata, DelegationMetadataUnmarshaller>(DelegationMetadataUnmarshaller.Instance); response.Delegations = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetDelegationsResponseUnmarshaller _instance = new GetDelegationsResponseUnmarshaller(); internal static GetDelegationsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDelegationsResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidenceByEvidenceFolder Request Marshaller /// </summary> public class GetEvidenceByEvidenceFolderRequestMarshaller : IMarshaller<IRequest, GetEvidenceByEvidenceFolderRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceByEvidenceFolderRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceByEvidenceFolderRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetControlSetId()) throw new AmazonAuditManagerException("Request object does not have required field ControlSetId set"); request.AddPathResource("{controlSetId}", StringUtils.FromString(publicRequest.ControlSetId)); if (!publicRequest.IsSetEvidenceFolderId()) throw new AmazonAuditManagerException("Request object does not have required field EvidenceFolderId set"); request.AddPathResource("{evidenceFolderId}", StringUtils.FromString(publicRequest.EvidenceFolderId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence"; request.UseQueryString = true; return request; } private static GetEvidenceByEvidenceFolderRequestMarshaller _instance = new GetEvidenceByEvidenceFolderRequestMarshaller(); internal static GetEvidenceByEvidenceFolderRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceByEvidenceFolderRequestMarshaller Instance { get { return _instance; } } } }
100
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidenceByEvidenceFolder operation /// </summary> public class GetEvidenceByEvidenceFolderResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceByEvidenceFolderResponse response = new GetEvidenceByEvidenceFolderResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidence", targetDepth)) { var unmarshaller = new ListUnmarshaller<Evidence, EvidenceUnmarshaller>(EvidenceUnmarshaller.Instance); response.Evidence = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceByEvidenceFolderResponseUnmarshaller _instance = new GetEvidenceByEvidenceFolderResponseUnmarshaller(); internal static GetEvidenceByEvidenceFolderResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceByEvidenceFolderResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidenceFileUploadUrl Request Marshaller /// </summary> public class GetEvidenceFileUploadUrlRequestMarshaller : IMarshaller<IRequest, GetEvidenceFileUploadUrlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceFileUploadUrlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceFileUploadUrlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetFileName()) request.Parameters.Add("fileName", StringUtils.FromString(publicRequest.FileName)); request.ResourcePath = "/evidenceFileUploadUrl"; request.UseQueryString = true; return request; } private static GetEvidenceFileUploadUrlRequestMarshaller _instance = new GetEvidenceFileUploadUrlRequestMarshaller(); internal static GetEvidenceFileUploadUrlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFileUploadUrlRequestMarshaller Instance { get { return _instance; } } } }
88
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidenceFileUploadUrl operation /// </summary> public class GetEvidenceFileUploadUrlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceFileUploadUrlResponse response = new GetEvidenceFileUploadUrlResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidenceFileName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EvidenceFileName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("uploadUrl", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.UploadUrl = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ThrottlingException")) { return ThrottlingExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceFileUploadUrlResponseUnmarshaller _instance = new GetEvidenceFileUploadUrlResponseUnmarshaller(); internal static GetEvidenceFileUploadUrlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFileUploadUrlResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidenceFolder Request Marshaller /// </summary> public class GetEvidenceFolderRequestMarshaller : IMarshaller<IRequest, GetEvidenceFolderRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceFolderRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceFolderRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetControlSetId()) throw new AmazonAuditManagerException("Request object does not have required field ControlSetId set"); request.AddPathResource("{controlSetId}", StringUtils.FromString(publicRequest.ControlSetId)); if (!publicRequest.IsSetEvidenceFolderId()) throw new AmazonAuditManagerException("Request object does not have required field EvidenceFolderId set"); request.AddPathResource("{evidenceFolderId}", StringUtils.FromString(publicRequest.EvidenceFolderId)); request.ResourcePath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}"; return request; } private static GetEvidenceFolderRequestMarshaller _instance = new GetEvidenceFolderRequestMarshaller(); internal static GetEvidenceFolderRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFolderRequestMarshaller Instance { get { return _instance; } } } }
93
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidenceFolder operation /// </summary> public class GetEvidenceFolderResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceFolderResponse response = new GetEvidenceFolderResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidenceFolder", targetDepth)) { var unmarshaller = AssessmentEvidenceFolderUnmarshaller.Instance; response.EvidenceFolder = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceFolderResponseUnmarshaller _instance = new GetEvidenceFolderResponseUnmarshaller(); internal static GetEvidenceFolderResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFolderResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidenceFoldersByAssessmentControl Request Marshaller /// </summary> public class GetEvidenceFoldersByAssessmentControlRequestMarshaller : IMarshaller<IRequest, GetEvidenceFoldersByAssessmentControlRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceFoldersByAssessmentControlRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceFoldersByAssessmentControlRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetControlId()) throw new AmazonAuditManagerException("Request object does not have required field ControlId set"); request.AddPathResource("{controlId}", StringUtils.FromString(publicRequest.ControlId)); if (!publicRequest.IsSetControlSetId()) throw new AmazonAuditManagerException("Request object does not have required field ControlSetId set"); request.AddPathResource("{controlSetId}", StringUtils.FromString(publicRequest.ControlSetId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessments/{assessmentId}/evidenceFolders-by-assessment-control/{controlSetId}/{controlId}"; request.UseQueryString = true; return request; } private static GetEvidenceFoldersByAssessmentControlRequestMarshaller _instance = new GetEvidenceFoldersByAssessmentControlRequestMarshaller(); internal static GetEvidenceFoldersByAssessmentControlRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFoldersByAssessmentControlRequestMarshaller Instance { get { return _instance; } } } }
100
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidenceFoldersByAssessmentControl operation /// </summary> public class GetEvidenceFoldersByAssessmentControlResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceFoldersByAssessmentControlResponse response = new GetEvidenceFoldersByAssessmentControlResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidenceFolders", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentEvidenceFolder, AssessmentEvidenceFolderUnmarshaller>(AssessmentEvidenceFolderUnmarshaller.Instance); response.EvidenceFolders = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceFoldersByAssessmentControlResponseUnmarshaller _instance = new GetEvidenceFoldersByAssessmentControlResponseUnmarshaller(); internal static GetEvidenceFoldersByAssessmentControlResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFoldersByAssessmentControlResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidenceFoldersByAssessment Request Marshaller /// </summary> public class GetEvidenceFoldersByAssessmentRequestMarshaller : IMarshaller<IRequest, GetEvidenceFoldersByAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceFoldersByAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceFoldersByAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessments/{assessmentId}/evidenceFolders"; request.UseQueryString = true; return request; } private static GetEvidenceFoldersByAssessmentRequestMarshaller _instance = new GetEvidenceFoldersByAssessmentRequestMarshaller(); internal static GetEvidenceFoldersByAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFoldersByAssessmentRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidenceFoldersByAssessment operation /// </summary> public class GetEvidenceFoldersByAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceFoldersByAssessmentResponse response = new GetEvidenceFoldersByAssessmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidenceFolders", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentEvidenceFolder, AssessmentEvidenceFolderUnmarshaller>(AssessmentEvidenceFolderUnmarshaller.Instance); response.EvidenceFolders = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceFoldersByAssessmentResponseUnmarshaller _instance = new GetEvidenceFoldersByAssessmentResponseUnmarshaller(); internal static GetEvidenceFoldersByAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceFoldersByAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetEvidence Request Marshaller /// </summary> public class GetEvidenceRequestMarshaller : IMarshaller<IRequest, GetEvidenceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetEvidenceRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetEvidenceRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); if (!publicRequest.IsSetControlSetId()) throw new AmazonAuditManagerException("Request object does not have required field ControlSetId set"); request.AddPathResource("{controlSetId}", StringUtils.FromString(publicRequest.ControlSetId)); if (!publicRequest.IsSetEvidenceFolderId()) throw new AmazonAuditManagerException("Request object does not have required field EvidenceFolderId set"); request.AddPathResource("{evidenceFolderId}", StringUtils.FromString(publicRequest.EvidenceFolderId)); if (!publicRequest.IsSetEvidenceId()) throw new AmazonAuditManagerException("Request object does not have required field EvidenceId set"); request.AddPathResource("{evidenceId}", StringUtils.FromString(publicRequest.EvidenceId)); request.ResourcePath = "/assessments/{assessmentId}/controlSets/{controlSetId}/evidenceFolders/{evidenceFolderId}/evidence/{evidenceId}"; return request; } private static GetEvidenceRequestMarshaller _instance = new GetEvidenceRequestMarshaller(); internal static GetEvidenceRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceRequestMarshaller Instance { get { return _instance; } } } }
96
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetEvidence operation /// </summary> public class GetEvidenceResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetEvidenceResponse response = new GetEvidenceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("evidence", targetDepth)) { var unmarshaller = EvidenceUnmarshaller.Instance; response.Evidence = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetEvidenceResponseUnmarshaller _instance = new GetEvidenceResponseUnmarshaller(); internal static GetEvidenceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetEvidenceResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetInsightsByAssessment Request Marshaller /// </summary> public class GetInsightsByAssessmentRequestMarshaller : IMarshaller<IRequest, GetInsightsByAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetInsightsByAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetInsightsByAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAssessmentId()) throw new AmazonAuditManagerException("Request object does not have required field AssessmentId set"); request.AddPathResource("{assessmentId}", StringUtils.FromString(publicRequest.AssessmentId)); request.ResourcePath = "/insights/assessments/{assessmentId}"; return request; } private static GetInsightsByAssessmentRequestMarshaller _instance = new GetInsightsByAssessmentRequestMarshaller(); internal static GetInsightsByAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetInsightsByAssessmentRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetInsightsByAssessment operation /// </summary> public class GetInsightsByAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetInsightsByAssessmentResponse response = new GetInsightsByAssessmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("insights", targetDepth)) { var unmarshaller = InsightsByAssessmentUnmarshaller.Instance; response.Insights = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetInsightsByAssessmentResponseUnmarshaller _instance = new GetInsightsByAssessmentResponseUnmarshaller(); internal static GetInsightsByAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetInsightsByAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetInsights Request Marshaller /// </summary> public class GetInsightsRequestMarshaller : IMarshaller<IRequest, GetInsightsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetInsightsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetInsightsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; request.ResourcePath = "/insights"; return request; } private static GetInsightsRequestMarshaller _instance = new GetInsightsRequestMarshaller(); internal static GetInsightsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetInsightsRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetInsights operation /// </summary> public class GetInsightsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetInsightsResponse response = new GetInsightsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("insights", targetDepth)) { var unmarshaller = InsightsUnmarshaller.Instance; response.Insights = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetInsightsResponseUnmarshaller _instance = new GetInsightsResponseUnmarshaller(); internal static GetInsightsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetInsightsResponseUnmarshaller Instance { get { return _instance; } } } }
114
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetOrganizationAdminAccount Request Marshaller /// </summary> public class GetOrganizationAdminAccountRequestMarshaller : IMarshaller<IRequest, GetOrganizationAdminAccountRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetOrganizationAdminAccountRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetOrganizationAdminAccountRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; request.ResourcePath = "/account/organizationAdminAccount"; return request; } private static GetOrganizationAdminAccountRequestMarshaller _instance = new GetOrganizationAdminAccountRequestMarshaller(); internal static GetOrganizationAdminAccountRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetOrganizationAdminAccountRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetOrganizationAdminAccount operation /// </summary> public class GetOrganizationAdminAccountResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetOrganizationAdminAccountResponse response = new GetOrganizationAdminAccountResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("adminAccountId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AdminAccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("organizationId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.OrganizationId = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetOrganizationAdminAccountResponseUnmarshaller _instance = new GetOrganizationAdminAccountResponseUnmarshaller(); internal static GetOrganizationAdminAccountResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetOrganizationAdminAccountResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetServicesInScope Request Marshaller /// </summary> public class GetServicesInScopeRequestMarshaller : IMarshaller<IRequest, GetServicesInScopeRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetServicesInScopeRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetServicesInScopeRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; request.ResourcePath = "/services"; return request; } private static GetServicesInScopeRequestMarshaller _instance = new GetServicesInScopeRequestMarshaller(); internal static GetServicesInScopeRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetServicesInScopeRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetServicesInScope operation /// </summary> public class GetServicesInScopeResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetServicesInScopeResponse response = new GetServicesInScopeResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("serviceMetadata", targetDepth)) { var unmarshaller = new ListUnmarshaller<ServiceMetadata, ServiceMetadataUnmarshaller>(ServiceMetadataUnmarshaller.Instance); response.ServiceMetadata = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetServicesInScopeResponseUnmarshaller _instance = new GetServicesInScopeResponseUnmarshaller(); internal static GetServicesInScopeResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetServicesInScopeResponseUnmarshaller Instance { get { return _instance; } } } }
118
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// GetSettings Request Marshaller /// </summary> public class GetSettingsRequestMarshaller : IMarshaller<IRequest, GetSettingsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((GetSettingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetSettingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (!publicRequest.IsSetAttribute()) throw new AmazonAuditManagerException("Request object does not have required field Attribute set"); request.AddPathResource("{attribute}", StringUtils.FromString(publicRequest.Attribute)); request.ResourcePath = "/settings/{attribute}"; return request; } private static GetSettingsRequestMarshaller _instance = new GetSettingsRequestMarshaller(); internal static GetSettingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetSettingsRequestMarshaller Instance { get { return _instance; } } } }
87
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetSettings operation /// </summary> public class GetSettingsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetSettingsResponse response = new GetSettingsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("settings", targetDepth)) { var unmarshaller = SettingsUnmarshaller.Instance; response.Settings = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetSettingsResponseUnmarshaller _instance = new GetSettingsResponseUnmarshaller(); internal static GetSettingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetSettingsResponseUnmarshaller Instance { get { return _instance; } } } }
114
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for InsightsByAssessment Object /// </summary> public class InsightsByAssessmentUnmarshaller : IUnmarshaller<InsightsByAssessment, XmlUnmarshallerContext>, IUnmarshaller<InsightsByAssessment, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> InsightsByAssessment IUnmarshaller<InsightsByAssessment, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public InsightsByAssessment Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; InsightsByAssessment unmarshalledObject = new InsightsByAssessment(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentControlsCountByNoncompliantEvidence", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.AssessmentControlsCountByNoncompliantEvidence = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("compliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.CompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("inconclusiveEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.InconclusiveEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdated", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("noncompliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.NoncompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("totalAssessmentControlsCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.TotalAssessmentControlsCount = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static InsightsByAssessmentUnmarshaller _instance = new InsightsByAssessmentUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InsightsByAssessmentUnmarshaller Instance { get { return _instance; } } } }
122
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Insights Object /// </summary> public class InsightsUnmarshaller : IUnmarshaller<Insights, XmlUnmarshallerContext>, IUnmarshaller<Insights, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Insights IUnmarshaller<Insights, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public Insights Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Insights unmarshalledObject = new Insights(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("activeAssessmentsCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.ActiveAssessmentsCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("assessmentControlsCountByNoncompliantEvidence", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.AssessmentControlsCountByNoncompliantEvidence = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("compliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.CompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("inconclusiveEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.InconclusiveEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdated", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.LastUpdated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("noncompliantEvidenceCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.NoncompliantEvidenceCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("totalAssessmentControlsCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.TotalAssessmentControlsCount = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static InsightsUnmarshaller _instance = new InsightsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InsightsUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for InternalServerException Object /// </summary> public class InternalServerExceptionUnmarshaller : IErrorResponseUnmarshaller<InternalServerException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public InternalServerException Unmarshall(JsonUnmarshallerContext context) { return this.Unmarshall(context, new Amazon.Runtime.Internal.ErrorResponse()); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <param name="errorResponse"></param> /// <returns></returns> public InternalServerException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); InternalServerException unmarshalledObject = new InternalServerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { } return unmarshalledObject; } private static InternalServerExceptionUnmarshaller _instance = new InternalServerExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InternalServerExceptionUnmarshaller Instance { get { return _instance; } } } }
85
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListAssessmentControlInsightsByControlDomain Request Marshaller /// </summary> public class ListAssessmentControlInsightsByControlDomainRequestMarshaller : IMarshaller<IRequest, ListAssessmentControlInsightsByControlDomainRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListAssessmentControlInsightsByControlDomainRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListAssessmentControlInsightsByControlDomainRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetAssessmentId()) request.Parameters.Add("assessmentId", StringUtils.FromString(publicRequest.AssessmentId)); if (publicRequest.IsSetControlDomainId()) request.Parameters.Add("controlDomainId", StringUtils.FromString(publicRequest.ControlDomainId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/insights/controls-by-assessment"; request.UseQueryString = true; return request; } private static ListAssessmentControlInsightsByControlDomainRequestMarshaller _instance = new ListAssessmentControlInsightsByControlDomainRequestMarshaller(); internal static ListAssessmentControlInsightsByControlDomainRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentControlInsightsByControlDomainRequestMarshaller Instance { get { return _instance; } } } }
97
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListAssessmentControlInsightsByControlDomain operation /// </summary> public class ListAssessmentControlInsightsByControlDomainResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListAssessmentControlInsightsByControlDomainResponse response = new ListAssessmentControlInsightsByControlDomainResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("controlInsightsByAssessment", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlInsightsMetadataByAssessmentItem, ControlInsightsMetadataByAssessmentItemUnmarshaller>(ControlInsightsMetadataByAssessmentItemUnmarshaller.Instance); response.ControlInsightsByAssessment = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListAssessmentControlInsightsByControlDomainResponseUnmarshaller _instance = new ListAssessmentControlInsightsByControlDomainResponseUnmarshaller(); internal static ListAssessmentControlInsightsByControlDomainResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentControlInsightsByControlDomainResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListAssessmentFrameworkShareRequests Request Marshaller /// </summary> public class ListAssessmentFrameworkShareRequestsRequestMarshaller : IMarshaller<IRequest, ListAssessmentFrameworkShareRequestsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListAssessmentFrameworkShareRequestsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListAssessmentFrameworkShareRequestsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); if (publicRequest.IsSetRequestType()) request.Parameters.Add("requestType", StringUtils.FromString(publicRequest.RequestType)); request.ResourcePath = "/assessmentFrameworkShareRequests"; request.UseQueryString = true; return request; } private static ListAssessmentFrameworkShareRequestsRequestMarshaller _instance = new ListAssessmentFrameworkShareRequestsRequestMarshaller(); internal static ListAssessmentFrameworkShareRequestsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentFrameworkShareRequestsRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListAssessmentFrameworkShareRequests operation /// </summary> public class ListAssessmentFrameworkShareRequestsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListAssessmentFrameworkShareRequestsResponse response = new ListAssessmentFrameworkShareRequestsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentFrameworkShareRequests", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentFrameworkShareRequest, AssessmentFrameworkShareRequestUnmarshaller>(AssessmentFrameworkShareRequestUnmarshaller.Instance); response.AssessmentFrameworkShareRequests = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListAssessmentFrameworkShareRequestsResponseUnmarshaller _instance = new ListAssessmentFrameworkShareRequestsResponseUnmarshaller(); internal static ListAssessmentFrameworkShareRequestsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentFrameworkShareRequestsResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListAssessmentFrameworks Request Marshaller /// </summary> public class ListAssessmentFrameworksRequestMarshaller : IMarshaller<IRequest, ListAssessmentFrameworksRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListAssessmentFrameworksRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListAssessmentFrameworksRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetFrameworkType()) request.Parameters.Add("frameworkType", StringUtils.FromString(publicRequest.FrameworkType)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessmentFrameworks"; request.UseQueryString = true; return request; } private static ListAssessmentFrameworksRequestMarshaller _instance = new ListAssessmentFrameworksRequestMarshaller(); internal static ListAssessmentFrameworksRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentFrameworksRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListAssessmentFrameworks operation /// </summary> public class ListAssessmentFrameworksResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListAssessmentFrameworksResponse response = new ListAssessmentFrameworksResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("frameworkMetadataList", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentFrameworkMetadata, AssessmentFrameworkMetadataUnmarshaller>(AssessmentFrameworkMetadataUnmarshaller.Instance); response.FrameworkMetadataList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListAssessmentFrameworksResponseUnmarshaller _instance = new ListAssessmentFrameworksResponseUnmarshaller(); internal static ListAssessmentFrameworksResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentFrameworksResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListAssessmentReports Request Marshaller /// </summary> public class ListAssessmentReportsRequestMarshaller : IMarshaller<IRequest, ListAssessmentReportsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListAssessmentReportsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListAssessmentReportsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/assessmentReports"; request.UseQueryString = true; return request; } private static ListAssessmentReportsRequestMarshaller _instance = new ListAssessmentReportsRequestMarshaller(); internal static ListAssessmentReportsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentReportsRequestMarshaller Instance { get { return _instance; } } } }
91
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListAssessmentReports operation /// </summary> public class ListAssessmentReportsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListAssessmentReportsResponse response = new ListAssessmentReportsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentReports", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentReportMetadata, AssessmentReportMetadataUnmarshaller>(AssessmentReportMetadataUnmarshaller.Instance); response.AssessmentReports = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListAssessmentReportsResponseUnmarshaller _instance = new ListAssessmentReportsResponseUnmarshaller(); internal static ListAssessmentReportsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentReportsResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListAssessments Request Marshaller /// </summary> public class ListAssessmentsRequestMarshaller : IMarshaller<IRequest, ListAssessmentsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListAssessmentsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListAssessmentsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); if (publicRequest.IsSetStatus()) request.Parameters.Add("status", StringUtils.FromString(publicRequest.Status)); request.ResourcePath = "/assessments"; request.UseQueryString = true; return request; } private static ListAssessmentsRequestMarshaller _instance = new ListAssessmentsRequestMarshaller(); internal static ListAssessmentsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentsRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListAssessments operation /// </summary> public class ListAssessmentsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListAssessmentsResponse response = new ListAssessmentsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("assessmentMetadata", targetDepth)) { var unmarshaller = new ListUnmarshaller<AssessmentMetadataItem, AssessmentMetadataItemUnmarshaller>(AssessmentMetadataItemUnmarshaller.Instance); response.AssessmentMetadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListAssessmentsResponseUnmarshaller _instance = new ListAssessmentsResponseUnmarshaller(); internal static ListAssessmentsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListAssessmentsResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListControlDomainInsightsByAssessment Request Marshaller /// </summary> public class ListControlDomainInsightsByAssessmentRequestMarshaller : IMarshaller<IRequest, ListControlDomainInsightsByAssessmentRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListControlDomainInsightsByAssessmentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListControlDomainInsightsByAssessmentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetAssessmentId()) request.Parameters.Add("assessmentId", StringUtils.FromString(publicRequest.AssessmentId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/insights/control-domains-by-assessment"; request.UseQueryString = true; return request; } private static ListControlDomainInsightsByAssessmentRequestMarshaller _instance = new ListControlDomainInsightsByAssessmentRequestMarshaller(); internal static ListControlDomainInsightsByAssessmentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlDomainInsightsByAssessmentRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListControlDomainInsightsByAssessment operation /// </summary> public class ListControlDomainInsightsByAssessmentResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListControlDomainInsightsByAssessmentResponse response = new ListControlDomainInsightsByAssessmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("controlDomainInsights", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlDomainInsights, ControlDomainInsightsUnmarshaller>(ControlDomainInsightsUnmarshaller.Instance); response.ControlDomainInsights = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListControlDomainInsightsByAssessmentResponseUnmarshaller _instance = new ListControlDomainInsightsByAssessmentResponseUnmarshaller(); internal static ListControlDomainInsightsByAssessmentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlDomainInsightsByAssessmentResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListControlDomainInsights Request Marshaller /// </summary> public class ListControlDomainInsightsRequestMarshaller : IMarshaller<IRequest, ListControlDomainInsightsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListControlDomainInsightsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListControlDomainInsightsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/insights/control-domains"; request.UseQueryString = true; return request; } private static ListControlDomainInsightsRequestMarshaller _instance = new ListControlDomainInsightsRequestMarshaller(); internal static ListControlDomainInsightsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlDomainInsightsRequestMarshaller Instance { get { return _instance; } } } }
91
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListControlDomainInsights operation /// </summary> public class ListControlDomainInsightsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListControlDomainInsightsResponse response = new ListControlDomainInsightsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("controlDomainInsights", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlDomainInsights, ControlDomainInsightsUnmarshaller>(ControlDomainInsightsUnmarshaller.Instance); response.ControlDomainInsights = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListControlDomainInsightsResponseUnmarshaller _instance = new ListControlDomainInsightsResponseUnmarshaller(); internal static ListControlDomainInsightsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlDomainInsightsResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListControlInsightsByControlDomain Request Marshaller /// </summary> public class ListControlInsightsByControlDomainRequestMarshaller : IMarshaller<IRequest, ListControlInsightsByControlDomainRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListControlInsightsByControlDomainRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListControlInsightsByControlDomainRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetControlDomainId()) request.Parameters.Add("controlDomainId", StringUtils.FromString(publicRequest.ControlDomainId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/insights/controls"; request.UseQueryString = true; return request; } private static ListControlInsightsByControlDomainRequestMarshaller _instance = new ListControlInsightsByControlDomainRequestMarshaller(); internal static ListControlInsightsByControlDomainRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlInsightsByControlDomainRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListControlInsightsByControlDomain operation /// </summary> public class ListControlInsightsByControlDomainResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListControlInsightsByControlDomainResponse response = new ListControlInsightsByControlDomainResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("controlInsightsMetadata", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlInsightsMetadataItem, ControlInsightsMetadataItemUnmarshaller>(ControlInsightsMetadataItemUnmarshaller.Instance); response.ControlInsightsMetadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListControlInsightsByControlDomainResponseUnmarshaller _instance = new ListControlInsightsByControlDomainResponseUnmarshaller(); internal static ListControlInsightsByControlDomainResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlInsightsByControlDomainResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListControls Request Marshaller /// </summary> public class ListControlsRequestMarshaller : IMarshaller<IRequest, ListControlsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListControlsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListControlsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetControlType()) request.Parameters.Add("controlType", StringUtils.FromString(publicRequest.ControlType)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/controls"; request.UseQueryString = true; return request; } private static ListControlsRequestMarshaller _instance = new ListControlsRequestMarshaller(); internal static ListControlsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlsRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListControls operation /// </summary> public class ListControlsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListControlsResponse response = new ListControlsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("controlMetadataList", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlMetadata, ControlMetadataUnmarshaller>(ControlMetadataUnmarshaller.Instance); response.ControlMetadataList = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListControlsResponseUnmarshaller _instance = new ListControlsResponseUnmarshaller(); internal static ListControlsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListControlsResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListKeywordsForDataSource Request Marshaller /// </summary> public class ListKeywordsForDataSourceRequestMarshaller : IMarshaller<IRequest, ListKeywordsForDataSourceRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListKeywordsForDataSourceRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListKeywordsForDataSourceRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); if (publicRequest.IsSetSource()) request.Parameters.Add("source", StringUtils.FromString(publicRequest.Source)); request.ResourcePath = "/dataSourceKeywords"; request.UseQueryString = true; return request; } private static ListKeywordsForDataSourceRequestMarshaller _instance = new ListKeywordsForDataSourceRequestMarshaller(); internal static ListKeywordsForDataSourceRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListKeywordsForDataSourceRequestMarshaller Instance { get { return _instance; } } } }
94
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListKeywordsForDataSource operation /// </summary> public class ListKeywordsForDataSourceResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListKeywordsForDataSourceResponse response = new ListKeywordsForDataSourceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("keywords", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.Keywords = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListKeywordsForDataSourceResponseUnmarshaller _instance = new ListKeywordsForDataSourceResponseUnmarshaller(); internal static ListKeywordsForDataSourceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListKeywordsForDataSourceResponseUnmarshaller Instance { get { return _instance; } } } }
124
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// ListNotifications Request Marshaller /// </summary> public class ListNotificationsRequestMarshaller : IMarshaller<IRequest, ListNotificationsRequest> , IMarshaller<IRequest,AmazonWebServiceRequest> { /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="input"></param> /// <returns></returns> public IRequest Marshall(AmazonWebServiceRequest input) { return this.Marshall((ListNotificationsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListNotificationsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.AuditManager"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2017-07-25"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/notifications"; request.UseQueryString = true; return request; } private static ListNotificationsRequestMarshaller _instance = new ListNotificationsRequestMarshaller(); internal static ListNotificationsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListNotificationsRequestMarshaller Instance { get { return _instance; } } } }
91
aws-sdk-net
aws
C#
/* * 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 auditmanager-2017-07-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AuditManager.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AuditManager.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListNotifications operation /// </summary> public class ListNotificationsResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListNotificationsResponse response = new ListNotificationsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("nextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("notifications", targetDepth)) { var unmarshaller = new ListUnmarshaller<Notification, NotificationUnmarshaller>(NotificationUnmarshaller.Instance); response.Notifications = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerException")) { return InternalServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ValidationException")) { return ValidationExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAuditManagerException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListNotificationsResponseUnmarshaller _instance = new ListNotificationsResponseUnmarshaller(); internal static ListNotificationsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListNotificationsResponseUnmarshaller Instance { get { return _instance; } } } }
124