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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for BadRequestException Object /// </summary> public class BadRequestExceptionUnmarshaller : IErrorResponseUnmarshaller<BadRequestException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public BadRequestException 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 BadRequestException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); BadRequestException unmarshalledObject = new BadRequestException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { } return unmarshalledObject; } private static BadRequestExceptionUnmarshaller _instance = new BadRequestExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static BadRequestExceptionUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ConflictException Object /// </summary> public class ConflictExceptionUnmarshaller : IErrorResponseUnmarshaller<ConflictException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public ConflictException 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 ConflictException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); ConflictException unmarshalledObject = new ConflictException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { } return unmarshalledObject; } private static ConflictExceptionUnmarshaller _instance = new ConflictExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static ConflictExceptionUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Cors Marshaller /// </summary> public class CorsMarshaller : IRequestMarshaller<Cors, 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(Cors requestObject, JsonMarshallerContext context) { if(requestObject.IsSetAllowCredentials()) { context.Writer.WritePropertyName("allowCredentials"); context.Writer.Write(requestObject.AllowCredentials); } if(requestObject.IsSetAllowHeaders()) { context.Writer.WritePropertyName("allowHeaders"); context.Writer.WriteArrayStart(); foreach(var requestObjectAllowHeadersListValue in requestObject.AllowHeaders) { context.Writer.Write(requestObjectAllowHeadersListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetAllowMethods()) { context.Writer.WritePropertyName("allowMethods"); context.Writer.WriteArrayStart(); foreach(var requestObjectAllowMethodsListValue in requestObject.AllowMethods) { context.Writer.Write(requestObjectAllowMethodsListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetAllowOrigins()) { context.Writer.WritePropertyName("allowOrigins"); context.Writer.WriteArrayStart(); foreach(var requestObjectAllowOriginsListValue in requestObject.AllowOrigins) { context.Writer.Write(requestObjectAllowOriginsListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetExposeHeaders()) { context.Writer.WritePropertyName("exposeHeaders"); context.Writer.WriteArrayStart(); foreach(var requestObjectExposeHeadersListValue in requestObject.ExposeHeaders) { context.Writer.Write(requestObjectExposeHeadersListValue); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetMaxAge()) { context.Writer.WritePropertyName("maxAge"); context.Writer.Write(requestObject.MaxAge); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static CorsMarshaller Instance = new CorsMarshaller(); } }
112
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Cors Object /// </summary> public class CorsUnmarshaller : IUnmarshaller<Cors, XmlUnmarshallerContext>, IUnmarshaller<Cors, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Cors IUnmarshaller<Cors, 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 Cors Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Cors unmarshalledObject = new Cors(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("allowCredentials", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.AllowCredentials = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("allowHeaders", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); unmarshalledObject.AllowHeaders = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("allowMethods", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); unmarshalledObject.AllowMethods = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("allowOrigins", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); unmarshalledObject.AllowOrigins = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("exposeHeaders", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); unmarshalledObject.ExposeHeaders = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("maxAge", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.MaxAge = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static CorsUnmarshaller _instance = new CorsUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static CorsUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateApiMapping Request Marshaller /// </summary> public class CreateApiMappingRequestMarshaller : IMarshaller<IRequest, CreateApiMappingRequest> , 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((CreateApiMappingRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateApiMappingRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); request.ResourcePath = "/v2/domainnames/{domainName}/apimappings"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetApiId()) { context.Writer.WritePropertyName("apiId"); context.Writer.Write(publicRequest.ApiId); } if(publicRequest.IsSetApiMappingKey()) { context.Writer.WritePropertyName("apiMappingKey"); context.Writer.Write(publicRequest.ApiMappingKey); } if(publicRequest.IsSetStage()) { context.Writer.WritePropertyName("stage"); context.Writer.Write(publicRequest.Stage); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateApiMappingRequestMarshaller _instance = new CreateApiMappingRequestMarshaller(); internal static CreateApiMappingRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateApiMappingRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateApiMapping operation /// </summary> public class CreateApiMappingResponseUnmarshaller : 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) { CreateApiMappingResponse response = new CreateApiMappingResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiMappingId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiMappingKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingKey = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("stage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Stage = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateApiMappingResponseUnmarshaller _instance = new CreateApiMappingResponseUnmarshaller(); internal static CreateApiMappingResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateApiMappingResponseUnmarshaller Instance { get { return _instance; } } } }
140
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateApi Request Marshaller /// </summary> public class CreateApiRequestMarshaller : IMarshaller<IRequest, CreateApiRequest> , 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((CreateApiRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateApiRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; request.ResourcePath = "/v2/apis"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetApiKeySelectionExpression()) { context.Writer.WritePropertyName("apiKeySelectionExpression"); context.Writer.Write(publicRequest.ApiKeySelectionExpression); } if(publicRequest.IsSetCorsConfiguration()) { context.Writer.WritePropertyName("corsConfiguration"); context.Writer.WriteObjectStart(); var marshaller = CorsMarshaller.Instance; marshaller.Marshall(publicRequest.CorsConfiguration, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetCredentialsArn()) { context.Writer.WritePropertyName("credentialsArn"); context.Writer.Write(publicRequest.CredentialsArn); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetDisableExecuteApiEndpoint()) { context.Writer.WritePropertyName("disableExecuteApiEndpoint"); context.Writer.Write(publicRequest.DisableExecuteApiEndpoint); } if(publicRequest.IsSetDisableSchemaValidation()) { context.Writer.WritePropertyName("disableSchemaValidation"); context.Writer.Write(publicRequest.DisableSchemaValidation); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetProtocolType()) { context.Writer.WritePropertyName("protocolType"); context.Writer.Write(publicRequest.ProtocolType); } if(publicRequest.IsSetRouteKey()) { context.Writer.WritePropertyName("routeKey"); context.Writer.Write(publicRequest.RouteKey); } if(publicRequest.IsSetRouteSelectionExpression()) { context.Writer.WritePropertyName("routeSelectionExpression"); context.Writer.Write(publicRequest.RouteSelectionExpression); } 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.IsSetTarget()) { context.Writer.WritePropertyName("target"); context.Writer.Write(publicRequest.Target); } if(publicRequest.IsSetVersion()) { context.Writer.WritePropertyName("version"); context.Writer.Write(publicRequest.Version); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateApiRequestMarshaller _instance = new CreateApiRequestMarshaller(); internal static CreateApiRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateApiRequestMarshaller Instance { get { return _instance; } } } }
186
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateApi operation /// </summary> public class CreateApiResponseUnmarshaller : 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) { CreateApiResponse response = new CreateApiResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiEndpoint", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiEndpoint = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiKeySelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiKeySelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("corsConfiguration", targetDepth)) { var unmarshaller = CorsUnmarshaller.Instance; response.CorsConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("disableExecuteApiEndpoint", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.DisableExecuteApiEndpoint = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("disableSchemaValidation", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.DisableSchemaValidation = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("importInfo", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.ImportInfo = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("protocolType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ProtocolType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("version", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Version = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("warnings", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.Warnings = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateApiResponseUnmarshaller _instance = new CreateApiResponseUnmarshaller(); internal static CreateApiResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateApiResponseUnmarshaller Instance { get { return _instance; } } } }
212
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateAuthorizer Request Marshaller /// </summary> public class CreateAuthorizerRequestMarshaller : IMarshaller<IRequest, CreateAuthorizerRequest> , 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((CreateAuthorizerRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateAuthorizerRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/authorizers"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAuthorizerCredentialsArn()) { context.Writer.WritePropertyName("authorizerCredentialsArn"); context.Writer.Write(publicRequest.AuthorizerCredentialsArn); } if(publicRequest.IsSetAuthorizerPayloadFormatVersion()) { context.Writer.WritePropertyName("authorizerPayloadFormatVersion"); context.Writer.Write(publicRequest.AuthorizerPayloadFormatVersion); } if(publicRequest.IsSetAuthorizerResultTtlInSeconds()) { context.Writer.WritePropertyName("authorizerResultTtlInSeconds"); context.Writer.Write(publicRequest.AuthorizerResultTtlInSeconds); } if(publicRequest.IsSetAuthorizerType()) { context.Writer.WritePropertyName("authorizerType"); context.Writer.Write(publicRequest.AuthorizerType); } if(publicRequest.IsSetAuthorizerUri()) { context.Writer.WritePropertyName("authorizerUri"); context.Writer.Write(publicRequest.AuthorizerUri); } if(publicRequest.IsSetEnableSimpleResponses()) { context.Writer.WritePropertyName("enableSimpleResponses"); context.Writer.Write(publicRequest.EnableSimpleResponses); } if(publicRequest.IsSetIdentitySource()) { context.Writer.WritePropertyName("identitySource"); context.Writer.WriteArrayStart(); foreach(var publicRequestIdentitySourceListValue in publicRequest.IdentitySource) { context.Writer.Write(publicRequestIdentitySourceListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetIdentityValidationExpression()) { context.Writer.WritePropertyName("identityValidationExpression"); context.Writer.Write(publicRequest.IdentityValidationExpression); } if(publicRequest.IsSetJwtConfiguration()) { context.Writer.WritePropertyName("jwtConfiguration"); context.Writer.WriteObjectStart(); var marshaller = JWTConfigurationMarshaller.Instance; marshaller.Marshall(publicRequest.JwtConfiguration, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateAuthorizerRequestMarshaller _instance = new CreateAuthorizerRequestMarshaller(); internal static CreateAuthorizerRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAuthorizerRequestMarshaller Instance { get { return _instance; } } } }
168
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateAuthorizer operation /// </summary> public class CreateAuthorizerResponseUnmarshaller : 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) { CreateAuthorizerResponse response = new CreateAuthorizerResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("authorizerCredentialsArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerCredentialsArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerPayloadFormatVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerPayloadFormatVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerResultTtlInSeconds", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.AuthorizerResultTtlInSeconds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerUri", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerUri = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("enableSimpleResponses", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.EnableSimpleResponses = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("identitySource", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.IdentitySource = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("identityValidationExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IdentityValidationExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("jwtConfiguration", targetDepth)) { var unmarshaller = JWTConfigurationUnmarshaller.Instance; response.JwtConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateAuthorizerResponseUnmarshaller _instance = new CreateAuthorizerResponseUnmarshaller(); internal static CreateAuthorizerResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateAuthorizerResponseUnmarshaller Instance { get { return _instance; } } } }
182
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateDeployment Request Marshaller /// </summary> public class CreateDeploymentRequestMarshaller : IMarshaller<IRequest, CreateDeploymentRequest> , 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((CreateDeploymentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateDeploymentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/deployments"; 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.IsSetStageName()) { context.Writer.WritePropertyName("stageName"); context.Writer.Write(publicRequest.StageName); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateDeploymentRequestMarshaller _instance = new CreateDeploymentRequestMarshaller(); internal static CreateDeploymentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateDeploymentRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateDeployment operation /// </summary> public class CreateDeploymentResponseUnmarshaller : 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) { CreateDeploymentResponse response = new CreateDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("autoDeployed", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.AutoDeployed = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateDeploymentResponseUnmarshaller _instance = new CreateDeploymentResponseUnmarshaller(); internal static CreateDeploymentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateDeploymentResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateDomainName Request Marshaller /// </summary> public class CreateDomainNameRequestMarshaller : IMarshaller<IRequest, CreateDomainNameRequest> , 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((CreateDomainNameRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateDomainNameRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; request.ResourcePath = "/v2/domainnames"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetDomainName()) { context.Writer.WritePropertyName("domainName"); context.Writer.Write(publicRequest.DomainName); } if(publicRequest.IsSetDomainNameConfigurations()) { context.Writer.WritePropertyName("domainNameConfigurations"); context.Writer.WriteArrayStart(); foreach(var publicRequestDomainNameConfigurationsListValue in publicRequest.DomainNameConfigurations) { context.Writer.WriteObjectStart(); var marshaller = DomainNameConfigurationMarshaller.Instance; marshaller.Marshall(publicRequestDomainNameConfigurationsListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetMutualTlsAuthentication()) { context.Writer.WritePropertyName("mutualTlsAuthentication"); context.Writer.WriteObjectStart(); var marshaller = MutualTlsAuthenticationInputMarshaller.Instance; marshaller.Marshall(publicRequest.MutualTlsAuthentication, 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 CreateDomainNameRequestMarshaller _instance = new CreateDomainNameRequestMarshaller(); internal static CreateDomainNameRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateDomainNameRequestMarshaller Instance { get { return _instance; } } } }
142
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateDomainName operation /// </summary> public class CreateDomainNameResponseUnmarshaller : 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) { CreateDomainNameResponse response = new CreateDomainNameResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiMappingSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DomainName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainNameConfigurations", targetDepth)) { var unmarshaller = new ListUnmarshaller<DomainNameConfiguration, DomainNameConfigurationUnmarshaller>(DomainNameConfigurationUnmarshaller.Instance); response.DomainNameConfigurations = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("mutualTlsAuthentication", targetDepth)) { var unmarshaller = MutualTlsAuthenticationUnmarshaller.Instance; response.MutualTlsAuthentication = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateDomainNameResponseUnmarshaller _instance = new CreateDomainNameResponseUnmarshaller(); internal static CreateDomainNameResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateDomainNameResponseUnmarshaller Instance { get { return _instance; } } } }
150
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateIntegration Request Marshaller /// </summary> public class CreateIntegrationRequestMarshaller : IMarshaller<IRequest, CreateIntegrationRequest> , 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((CreateIntegrationRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateIntegrationRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/integrations"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetConnectionId()) { context.Writer.WritePropertyName("connectionId"); context.Writer.Write(publicRequest.ConnectionId); } if(publicRequest.IsSetConnectionType()) { context.Writer.WritePropertyName("connectionType"); context.Writer.Write(publicRequest.ConnectionType); } if(publicRequest.IsSetContentHandlingStrategy()) { context.Writer.WritePropertyName("contentHandlingStrategy"); context.Writer.Write(publicRequest.ContentHandlingStrategy); } if(publicRequest.IsSetCredentialsArn()) { context.Writer.WritePropertyName("credentialsArn"); context.Writer.Write(publicRequest.CredentialsArn); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetIntegrationMethod()) { context.Writer.WritePropertyName("integrationMethod"); context.Writer.Write(publicRequest.IntegrationMethod); } if(publicRequest.IsSetIntegrationSubtype()) { context.Writer.WritePropertyName("integrationSubtype"); context.Writer.Write(publicRequest.IntegrationSubtype); } if(publicRequest.IsSetIntegrationType()) { context.Writer.WritePropertyName("integrationType"); context.Writer.Write(publicRequest.IntegrationType); } if(publicRequest.IsSetIntegrationUri()) { context.Writer.WritePropertyName("integrationUri"); context.Writer.Write(publicRequest.IntegrationUri); } if(publicRequest.IsSetPassthroughBehavior()) { context.Writer.WritePropertyName("passthroughBehavior"); context.Writer.Write(publicRequest.PassthroughBehavior); } if(publicRequest.IsSetPayloadFormatVersion()) { context.Writer.WritePropertyName("payloadFormatVersion"); context.Writer.Write(publicRequest.PayloadFormatVersion); } if(publicRequest.IsSetRequestParameters()) { context.Writer.WritePropertyName("requestParameters"); context.Writer.WriteObjectStart(); foreach (var publicRequestRequestParametersKvp in publicRequest.RequestParameters) { context.Writer.WritePropertyName(publicRequestRequestParametersKvp.Key); var publicRequestRequestParametersValue = publicRequestRequestParametersKvp.Value; context.Writer.Write(publicRequestRequestParametersValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetRequestTemplates()) { context.Writer.WritePropertyName("requestTemplates"); context.Writer.WriteObjectStart(); foreach (var publicRequestRequestTemplatesKvp in publicRequest.RequestTemplates) { context.Writer.WritePropertyName(publicRequestRequestTemplatesKvp.Key); var publicRequestRequestTemplatesValue = publicRequestRequestTemplatesKvp.Value; context.Writer.Write(publicRequestRequestTemplatesValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetResponseParameters()) { context.Writer.WritePropertyName("responseParameters"); context.Writer.WriteObjectStart(); foreach (var publicRequestResponseParametersKvp in publicRequest.ResponseParameters) { context.Writer.WritePropertyName(publicRequestResponseParametersKvp.Key); var publicRequestResponseParametersValue = publicRequestResponseParametersKvp.Value; context.Writer.WriteObjectStart(); foreach (var publicRequestResponseParametersValueKvp in publicRequestResponseParametersValue) { context.Writer.WritePropertyName(publicRequestResponseParametersValueKvp.Key); var publicRequestResponseParametersValueValue = publicRequestResponseParametersValueKvp.Value; context.Writer.Write(publicRequestResponseParametersValueValue); } context.Writer.WriteObjectEnd(); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTemplateSelectionExpression()) { context.Writer.WritePropertyName("templateSelectionExpression"); context.Writer.Write(publicRequest.TemplateSelectionExpression); } if(publicRequest.IsSetTimeoutInMillis()) { context.Writer.WritePropertyName("timeoutInMillis"); context.Writer.Write(publicRequest.TimeoutInMillis); } if(publicRequest.IsSetTlsConfig()) { context.Writer.WritePropertyName("tlsConfig"); context.Writer.WriteObjectStart(); var marshaller = TlsConfigInputMarshaller.Instance; marshaller.Marshall(publicRequest.TlsConfig, context); context.Writer.WriteObjectEnd(); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateIntegrationRequestMarshaller _instance = new CreateIntegrationRequestMarshaller(); internal static CreateIntegrationRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateIntegrationRequestMarshaller Instance { get { return _instance; } } } }
237
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateIntegrationResponse Request Marshaller /// </summary> public class CreateIntegrationResponseRequestMarshaller : IMarshaller<IRequest, CreateIntegrationResponseRequest> , 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((CreateIntegrationResponseRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateIntegrationResponseRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetContentHandlingStrategy()) { context.Writer.WritePropertyName("contentHandlingStrategy"); context.Writer.Write(publicRequest.ContentHandlingStrategy); } if(publicRequest.IsSetIntegrationResponseKey()) { context.Writer.WritePropertyName("integrationResponseKey"); context.Writer.Write(publicRequest.IntegrationResponseKey); } if(publicRequest.IsSetResponseParameters()) { context.Writer.WritePropertyName("responseParameters"); context.Writer.WriteObjectStart(); foreach (var publicRequestResponseParametersKvp in publicRequest.ResponseParameters) { context.Writer.WritePropertyName(publicRequestResponseParametersKvp.Key); var publicRequestResponseParametersValue = publicRequestResponseParametersKvp.Value; context.Writer.Write(publicRequestResponseParametersValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetResponseTemplates()) { context.Writer.WritePropertyName("responseTemplates"); context.Writer.WriteObjectStart(); foreach (var publicRequestResponseTemplatesKvp in publicRequest.ResponseTemplates) { context.Writer.WritePropertyName(publicRequestResponseTemplatesKvp.Key); var publicRequestResponseTemplatesValue = publicRequestResponseTemplatesKvp.Value; context.Writer.Write(publicRequestResponseTemplatesValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetTemplateSelectionExpression()) { context.Writer.WritePropertyName("templateSelectionExpression"); context.Writer.Write(publicRequest.TemplateSelectionExpression); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateIntegrationResponseRequestMarshaller _instance = new CreateIntegrationResponseRequestMarshaller(); internal static CreateIntegrationResponseRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateIntegrationResponseRequestMarshaller Instance { get { return _instance; } } } }
147
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateIntegrationResponse operation /// </summary> public class CreateIntegrationResponseResponseUnmarshaller : 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) { CreateIntegrationResponseResponse response = new CreateIntegrationResponseResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("contentHandlingStrategy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentHandlingStrategy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseKey = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.ResponseParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseTemplates", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.ResponseTemplates = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("templateSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TemplateSelectionExpression = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateIntegrationResponseResponseUnmarshaller _instance = new CreateIntegrationResponseResponseUnmarshaller(); internal static CreateIntegrationResponseResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateIntegrationResponseResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateIntegration operation /// </summary> public class CreateIntegrationResponseUnmarshaller : 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) { CreateIntegrationResponse response = new CreateIntegrationResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("connectionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConnectionId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("connectionType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConnectionType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("contentHandlingStrategy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentHandlingStrategy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("credentialsArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CredentialsArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationMethod", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationMethod = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationSubtype", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationSubtype = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationUri", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationUri = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("passthroughBehavior", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PassthroughBehavior = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("payloadFormatVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PayloadFormatVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RequestParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestTemplates", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RequestTemplates = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, Dictionary<string, string>, StringUnmarshaller, DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>>(StringUnmarshaller.Instance, new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance)); response.ResponseParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("templateSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TemplateSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("timeoutInMillis", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.TimeoutInMillis = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tlsConfig", targetDepth)) { var unmarshaller = TlsConfigUnmarshaller.Instance; response.TlsConfig = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateIntegrationResponseUnmarshaller _instance = new CreateIntegrationResponseUnmarshaller(); internal static CreateIntegrationResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateIntegrationResponseUnmarshaller Instance { get { return _instance; } } } }
236
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateModel Request Marshaller /// </summary> public class CreateModelRequestMarshaller : IMarshaller<IRequest, CreateModelRequest> , 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((CreateModelRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateModelRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/models"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetContentType()) { context.Writer.WritePropertyName("contentType"); context.Writer.Write(publicRequest.ContentType); } 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.IsSetSchema()) { context.Writer.WritePropertyName("schema"); context.Writer.Write(publicRequest.Schema); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateModelRequestMarshaller _instance = new CreateModelRequestMarshaller(); internal static CreateModelRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateModelRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateModel operation /// </summary> public class CreateModelResponseUnmarshaller : 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) { CreateModelResponse response = new CreateModelResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("contentType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("modelId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ModelId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("schema", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Schema = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateModelResponseUnmarshaller _instance = new CreateModelResponseUnmarshaller(); internal static CreateModelResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateModelResponseUnmarshaller Instance { get { return _instance; } } } }
146
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateRoute Request Marshaller /// </summary> public class CreateRouteRequestMarshaller : IMarshaller<IRequest, CreateRouteRequest> , 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((CreateRouteRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateRouteRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/routes"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetApiKeyRequired()) { context.Writer.WritePropertyName("apiKeyRequired"); context.Writer.Write(publicRequest.ApiKeyRequired); } if(publicRequest.IsSetAuthorizationScopes()) { context.Writer.WritePropertyName("authorizationScopes"); context.Writer.WriteArrayStart(); foreach(var publicRequestAuthorizationScopesListValue in publicRequest.AuthorizationScopes) { context.Writer.Write(publicRequestAuthorizationScopesListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetAuthorizationType()) { context.Writer.WritePropertyName("authorizationType"); context.Writer.Write(publicRequest.AuthorizationType); } if(publicRequest.IsSetAuthorizerId()) { context.Writer.WritePropertyName("authorizerId"); context.Writer.Write(publicRequest.AuthorizerId); } if(publicRequest.IsSetModelSelectionExpression()) { context.Writer.WritePropertyName("modelSelectionExpression"); context.Writer.Write(publicRequest.ModelSelectionExpression); } if(publicRequest.IsSetOperationName()) { context.Writer.WritePropertyName("operationName"); context.Writer.Write(publicRequest.OperationName); } if(publicRequest.IsSetRequestModels()) { context.Writer.WritePropertyName("requestModels"); context.Writer.WriteObjectStart(); foreach (var publicRequestRequestModelsKvp in publicRequest.RequestModels) { context.Writer.WritePropertyName(publicRequestRequestModelsKvp.Key); var publicRequestRequestModelsValue = publicRequestRequestModelsKvp.Value; context.Writer.Write(publicRequestRequestModelsValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetRequestParameters()) { context.Writer.WritePropertyName("requestParameters"); context.Writer.WriteObjectStart(); foreach (var publicRequestRequestParametersKvp in publicRequest.RequestParameters) { context.Writer.WritePropertyName(publicRequestRequestParametersKvp.Key); var publicRequestRequestParametersValue = publicRequestRequestParametersKvp.Value; context.Writer.WriteObjectStart(); var marshaller = ParameterConstraintsMarshaller.Instance; marshaller.Marshall(publicRequestRequestParametersValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetRouteKey()) { context.Writer.WritePropertyName("routeKey"); context.Writer.Write(publicRequest.RouteKey); } if(publicRequest.IsSetRouteResponseSelectionExpression()) { context.Writer.WritePropertyName("routeResponseSelectionExpression"); context.Writer.Write(publicRequest.RouteResponseSelectionExpression); } if(publicRequest.IsSetTarget()) { context.Writer.WritePropertyName("target"); context.Writer.Write(publicRequest.Target); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateRouteRequestMarshaller _instance = new CreateRouteRequestMarshaller(); internal static CreateRouteRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateRouteRequestMarshaller Instance { get { return _instance; } } } }
190
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateRouteResponse Request Marshaller /// </summary> public class CreateRouteResponseRequestMarshaller : IMarshaller<IRequest, CreateRouteResponseRequest> , 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((CreateRouteResponseRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateRouteResponseRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetRouteId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteId set"); request.AddPathResource("{routeId}", StringUtils.FromString(publicRequest.RouteId)); request.ResourcePath = "/v2/apis/{apiId}/routes/{routeId}/routeresponses"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetModelSelectionExpression()) { context.Writer.WritePropertyName("modelSelectionExpression"); context.Writer.Write(publicRequest.ModelSelectionExpression); } if(publicRequest.IsSetResponseModels()) { context.Writer.WritePropertyName("responseModels"); context.Writer.WriteObjectStart(); foreach (var publicRequestResponseModelsKvp in publicRequest.ResponseModels) { context.Writer.WritePropertyName(publicRequestResponseModelsKvp.Key); var publicRequestResponseModelsValue = publicRequestResponseModelsKvp.Value; context.Writer.Write(publicRequestResponseModelsValue); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetResponseParameters()) { context.Writer.WritePropertyName("responseParameters"); context.Writer.WriteObjectStart(); foreach (var publicRequestResponseParametersKvp in publicRequest.ResponseParameters) { context.Writer.WritePropertyName(publicRequestResponseParametersKvp.Key); var publicRequestResponseParametersValue = publicRequestResponseParametersKvp.Value; context.Writer.WriteObjectStart(); var marshaller = ParameterConstraintsMarshaller.Instance; marshaller.Marshall(publicRequestResponseParametersValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetRouteResponseKey()) { context.Writer.WritePropertyName("routeResponseKey"); context.Writer.Write(publicRequest.RouteResponseKey); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static CreateRouteResponseRequestMarshaller _instance = new CreateRouteResponseRequestMarshaller(); internal static CreateRouteResponseRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateRouteResponseRequestMarshaller Instance { get { return _instance; } } } }
146
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateRouteResponse operation /// </summary> public class CreateRouteResponseResponseUnmarshaller : 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) { CreateRouteResponseResponse response = new CreateRouteResponseResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("modelSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ModelSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseModels", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.ResponseModels = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, ParameterConstraints, StringUnmarshaller, ParameterConstraintsUnmarshaller>(StringUnmarshaller.Instance, ParameterConstraintsUnmarshaller.Instance); response.ResponseParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeResponseId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteResponseId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeResponseKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteResponseKey = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateRouteResponseResponseUnmarshaller _instance = new CreateRouteResponseResponseUnmarshaller(); internal static CreateRouteResponseResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateRouteResponseResponseUnmarshaller Instance { get { return _instance; } } } }
146
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateRoute operation /// </summary> public class CreateRouteResponseUnmarshaller : 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) { CreateRouteResponse response = new CreateRouteResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiKeyRequired", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiKeyRequired = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizationScopes", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.AuthorizationScopes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizationType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizationType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("modelSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ModelSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("operationName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.OperationName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestModels", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RequestModels = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, ParameterConstraints, StringUnmarshaller, ParameterConstraintsUnmarshaller>(StringUnmarshaller.Instance, ParameterConstraintsUnmarshaller.Instance); response.RequestParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteKey = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeResponseSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteResponseSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("target", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Target = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateRouteResponseUnmarshaller _instance = new CreateRouteResponseUnmarshaller(); internal static CreateRouteResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateRouteResponseUnmarshaller Instance { get { return _instance; } } } }
194
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateStage Request Marshaller /// </summary> public class CreateStageRequestMarshaller : IMarshaller<IRequest, CreateStageRequest> , 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((CreateStageRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateStageRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/stages"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetAccessLogSettings()) { context.Writer.WritePropertyName("accessLogSettings"); context.Writer.WriteObjectStart(); var marshaller = AccessLogSettingsMarshaller.Instance; marshaller.Marshall(publicRequest.AccessLogSettings, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetAutoDeploy()) { context.Writer.WritePropertyName("autoDeploy"); context.Writer.Write(publicRequest.AutoDeploy); } if(publicRequest.IsSetClientCertificateId()) { context.Writer.WritePropertyName("clientCertificateId"); context.Writer.Write(publicRequest.ClientCertificateId); } if(publicRequest.IsSetDefaultRouteSettings()) { context.Writer.WritePropertyName("defaultRouteSettings"); context.Writer.WriteObjectStart(); var marshaller = RouteSettingsMarshaller.Instance; marshaller.Marshall(publicRequest.DefaultRouteSettings, context); context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetDeploymentId()) { context.Writer.WritePropertyName("deploymentId"); context.Writer.Write(publicRequest.DeploymentId); } if(publicRequest.IsSetDescription()) { context.Writer.WritePropertyName("description"); context.Writer.Write(publicRequest.Description); } if(publicRequest.IsSetRouteSettings()) { context.Writer.WritePropertyName("routeSettings"); context.Writer.WriteObjectStart(); foreach (var publicRequestRouteSettingsKvp in publicRequest.RouteSettings) { context.Writer.WritePropertyName(publicRequestRouteSettingsKvp.Key); var publicRequestRouteSettingsValue = publicRequestRouteSettingsKvp.Value; context.Writer.WriteObjectStart(); var marshaller = RouteSettingsMarshaller.Instance; marshaller.Marshall(publicRequestRouteSettingsValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteObjectEnd(); } if(publicRequest.IsSetStageName()) { context.Writer.WritePropertyName("stageName"); context.Writer.Write(publicRequest.StageName); } if(publicRequest.IsSetStageVariables()) { context.Writer.WritePropertyName("stageVariables"); context.Writer.WriteObjectStart(); foreach (var publicRequestStageVariablesKvp in publicRequest.StageVariables) { context.Writer.WritePropertyName(publicRequestStageVariablesKvp.Key); var publicRequestStageVariablesValue = publicRequestStageVariablesKvp.Value; context.Writer.Write(publicRequestStageVariablesValue); } 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 CreateStageRequestMarshaller _instance = new CreateStageRequestMarshaller(); internal static CreateStageRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateStageRequestMarshaller Instance { get { return _instance; } } } }
197
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateStage operation /// </summary> public class CreateStageResponseUnmarshaller : 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) { CreateStageResponse response = new CreateStageResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("accessLogSettings", targetDepth)) { var unmarshaller = AccessLogSettingsUnmarshaller.Instance; response.AccessLogSettings = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("autoDeploy", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.AutoDeploy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("clientCertificateId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ClientCertificateId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("defaultRouteSettings", targetDepth)) { var unmarshaller = RouteSettingsUnmarshaller.Instance; response.DefaultRouteSettings = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastDeploymentStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LastDeploymentStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("lastUpdatedDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastUpdatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeSettings", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, RouteSettings, StringUnmarshaller, RouteSettingsUnmarshaller>(StringUnmarshaller.Instance, RouteSettingsUnmarshaller.Instance); response.RouteSettings = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("stageName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.StageName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("stageVariables", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.StageVariables = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateStageResponseUnmarshaller _instance = new CreateStageResponseUnmarshaller(); internal static CreateStageResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateStageResponseUnmarshaller Instance { get { return _instance; } } } }
200
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// CreateVpcLink Request Marshaller /// </summary> public class CreateVpcLinkRequestMarshaller : IMarshaller<IRequest, CreateVpcLinkRequest> , 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((CreateVpcLinkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(CreateVpcLinkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "POST"; request.ResourcePath = "/v2/vpclinks"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetName()) { context.Writer.WritePropertyName("name"); context.Writer.Write(publicRequest.Name); } if(publicRequest.IsSetSecurityGroupIds()) { context.Writer.WritePropertyName("securityGroupIds"); context.Writer.WriteArrayStart(); foreach(var publicRequestSecurityGroupIdsListValue in publicRequest.SecurityGroupIds) { context.Writer.Write(publicRequestSecurityGroupIdsListValue); } context.Writer.WriteArrayEnd(); } if(publicRequest.IsSetSubnetIds()) { context.Writer.WritePropertyName("subnetIds"); context.Writer.WriteArrayStart(); foreach(var publicRequestSubnetIdsListValue in publicRequest.SubnetIds) { context.Writer.Write(publicRequestSubnetIdsListValue); } context.Writer.WriteArrayEnd(); } 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 CreateVpcLinkRequestMarshaller _instance = new CreateVpcLinkRequestMarshaller(); internal static CreateVpcLinkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateVpcLinkRequestMarshaller Instance { get { return _instance; } } } }
137
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateVpcLink operation /// </summary> public class CreateVpcLinkResponseUnmarshaller : 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) { CreateVpcLinkResponse response = new CreateVpcLinkResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("securityGroupIds", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.SecurityGroupIds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("subnetIds", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.SubnetIds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("vpcLinkId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.VpcLinkId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("vpcLinkStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.VpcLinkStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("vpcLinkStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.VpcLinkStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("vpcLinkVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.VpcLinkVersion = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateVpcLinkResponseUnmarshaller _instance = new CreateVpcLinkResponseUnmarshaller(); internal static CreateVpcLinkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateVpcLinkResponseUnmarshaller Instance { get { return _instance; } } } }
162
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAccessLogSettings Request Marshaller /// </summary> public class DeleteAccessLogSettingsRequestMarshaller : IMarshaller<IRequest, DeleteAccessLogSettingsRequest> , 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((DeleteAccessLogSettingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAccessLogSettingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetStageName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field StageName set"); request.AddPathResource("{stageName}", StringUtils.FromString(publicRequest.StageName)); request.ResourcePath = "/v2/apis/{apiId}/stages/{stageName}/accesslogsettings"; return request; } private static DeleteAccessLogSettingsRequestMarshaller _instance = new DeleteAccessLogSettingsRequestMarshaller(); internal static DeleteAccessLogSettingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAccessLogSettingsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAccessLogSettings operation /// </summary> public class DeleteAccessLogSettingsResponseUnmarshaller : 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) { DeleteAccessLogSettingsResponse response = new DeleteAccessLogSettingsResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAccessLogSettingsResponseUnmarshaller _instance = new DeleteAccessLogSettingsResponseUnmarshaller(); internal static DeleteAccessLogSettingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAccessLogSettingsResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteApiMapping Request Marshaller /// </summary> public class DeleteApiMappingRequestMarshaller : IMarshaller<IRequest, DeleteApiMappingRequest> , 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((DeleteApiMappingRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteApiMappingRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiMappingId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiMappingId set"); request.AddPathResource("{apiMappingId}", StringUtils.FromString(publicRequest.ApiMappingId)); if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); request.ResourcePath = "/v2/domainnames/{domainName}/apimappings/{apiMappingId}"; return request; } private static DeleteApiMappingRequestMarshaller _instance = new DeleteApiMappingRequestMarshaller(); internal static DeleteApiMappingRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteApiMappingRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteApiMapping operation /// </summary> public class DeleteApiMappingResponseUnmarshaller : 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) { DeleteApiMappingResponse response = new DeleteApiMappingResponse(); 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteApiMappingResponseUnmarshaller _instance = new DeleteApiMappingResponseUnmarshaller(); internal static DeleteApiMappingResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteApiMappingResponseUnmarshaller Instance { get { return _instance; } } } }
107
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteApi Request Marshaller /// </summary> public class DeleteApiRequestMarshaller : IMarshaller<IRequest, DeleteApiRequest> , 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((DeleteApiRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteApiRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}"; return request; } private static DeleteApiRequestMarshaller _instance = new DeleteApiRequestMarshaller(); internal static DeleteApiRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteApiRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteApi operation /// </summary> public class DeleteApiResponseUnmarshaller : 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) { DeleteApiResponse response = new DeleteApiResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteApiResponseUnmarshaller _instance = new DeleteApiResponseUnmarshaller(); internal static DeleteApiResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteApiResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteAuthorizer Request Marshaller /// </summary> public class DeleteAuthorizerRequestMarshaller : IMarshaller<IRequest, DeleteAuthorizerRequest> , 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((DeleteAuthorizerRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteAuthorizerRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetAuthorizerId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field AuthorizerId set"); request.AddPathResource("{authorizerId}", StringUtils.FromString(publicRequest.AuthorizerId)); request.ResourcePath = "/v2/apis/{apiId}/authorizers/{authorizerId}"; return request; } private static DeleteAuthorizerRequestMarshaller _instance = new DeleteAuthorizerRequestMarshaller(); internal static DeleteAuthorizerRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAuthorizerRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteAuthorizer operation /// </summary> public class DeleteAuthorizerResponseUnmarshaller : 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) { DeleteAuthorizerResponse response = new DeleteAuthorizerResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteAuthorizerResponseUnmarshaller _instance = new DeleteAuthorizerResponseUnmarshaller(); internal static DeleteAuthorizerResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteAuthorizerResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteCorsConfiguration Request Marshaller /// </summary> public class DeleteCorsConfigurationRequestMarshaller : IMarshaller<IRequest, DeleteCorsConfigurationRequest> , 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((DeleteCorsConfigurationRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteCorsConfigurationRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}/cors"; return request; } private static DeleteCorsConfigurationRequestMarshaller _instance = new DeleteCorsConfigurationRequestMarshaller(); internal static DeleteCorsConfigurationRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteCorsConfigurationRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteCorsConfiguration operation /// </summary> public class DeleteCorsConfigurationResponseUnmarshaller : 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) { DeleteCorsConfigurationResponse response = new DeleteCorsConfigurationResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteCorsConfigurationResponseUnmarshaller _instance = new DeleteCorsConfigurationResponseUnmarshaller(); internal static DeleteCorsConfigurationResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteCorsConfigurationResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteDeployment Request Marshaller /// </summary> public class DeleteDeploymentRequestMarshaller : IMarshaller<IRequest, DeleteDeploymentRequest> , 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((DeleteDeploymentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteDeploymentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetDeploymentId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DeploymentId set"); request.AddPathResource("{deploymentId}", StringUtils.FromString(publicRequest.DeploymentId)); request.ResourcePath = "/v2/apis/{apiId}/deployments/{deploymentId}"; return request; } private static DeleteDeploymentRequestMarshaller _instance = new DeleteDeploymentRequestMarshaller(); internal static DeleteDeploymentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteDeploymentRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteDeployment operation /// </summary> public class DeleteDeploymentResponseUnmarshaller : 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) { DeleteDeploymentResponse response = new DeleteDeploymentResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteDeploymentResponseUnmarshaller _instance = new DeleteDeploymentResponseUnmarshaller(); internal static DeleteDeploymentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteDeploymentResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteDomainName Request Marshaller /// </summary> public class DeleteDomainNameRequestMarshaller : IMarshaller<IRequest, DeleteDomainNameRequest> , 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((DeleteDomainNameRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteDomainNameRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); request.ResourcePath = "/v2/domainnames/{domainName}"; return request; } private static DeleteDomainNameRequestMarshaller _instance = new DeleteDomainNameRequestMarshaller(); internal static DeleteDomainNameRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteDomainNameRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteDomainName operation /// </summary> public class DeleteDomainNameResponseUnmarshaller : 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) { DeleteDomainNameResponse response = new DeleteDomainNameResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteDomainNameResponseUnmarshaller _instance = new DeleteDomainNameResponseUnmarshaller(); internal static DeleteDomainNameResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteDomainNameResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteIntegration Request Marshaller /// </summary> public class DeleteIntegrationRequestMarshaller : IMarshaller<IRequest, DeleteIntegrationRequest> , 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((DeleteIntegrationRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteIntegrationRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}"; return request; } private static DeleteIntegrationRequestMarshaller _instance = new DeleteIntegrationRequestMarshaller(); internal static DeleteIntegrationRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteIntegrationRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteIntegrationResponse Request Marshaller /// </summary> public class DeleteIntegrationResponseRequestMarshaller : IMarshaller<IRequest, DeleteIntegrationResponseRequest> , 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((DeleteIntegrationResponseRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteIntegrationResponseRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); if (!publicRequest.IsSetIntegrationResponseId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationResponseId set"); request.AddPathResource("{integrationResponseId}", StringUtils.FromString(publicRequest.IntegrationResponseId)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}"; return request; } private static DeleteIntegrationResponseRequestMarshaller _instance = new DeleteIntegrationResponseRequestMarshaller(); internal static DeleteIntegrationResponseRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteIntegrationResponseRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteIntegrationResponse operation /// </summary> public class DeleteIntegrationResponseResponseUnmarshaller : 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) { DeleteIntegrationResponseResponse response = new DeleteIntegrationResponseResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteIntegrationResponseResponseUnmarshaller _instance = new DeleteIntegrationResponseResponseUnmarshaller(); internal static DeleteIntegrationResponseResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteIntegrationResponseResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteIntegration operation /// </summary> public class DeleteIntegrationResponseUnmarshaller : 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) { DeleteIntegrationResponse response = new DeleteIntegrationResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteIntegrationResponseUnmarshaller _instance = new DeleteIntegrationResponseUnmarshaller(); internal static DeleteIntegrationResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteIntegrationResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteModel Request Marshaller /// </summary> public class DeleteModelRequestMarshaller : IMarshaller<IRequest, DeleteModelRequest> , 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((DeleteModelRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteModelRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetModelId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ModelId set"); request.AddPathResource("{modelId}", StringUtils.FromString(publicRequest.ModelId)); request.ResourcePath = "/v2/apis/{apiId}/models/{modelId}"; return request; } private static DeleteModelRequestMarshaller _instance = new DeleteModelRequestMarshaller(); internal static DeleteModelRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteModelRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteModel operation /// </summary> public class DeleteModelResponseUnmarshaller : 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) { DeleteModelResponse response = new DeleteModelResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteModelResponseUnmarshaller _instance = new DeleteModelResponseUnmarshaller(); internal static DeleteModelResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteModelResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteRoute Request Marshaller /// </summary> public class DeleteRouteRequestMarshaller : IMarshaller<IRequest, DeleteRouteRequest> , 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((DeleteRouteRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteRouteRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetRouteId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteId set"); request.AddPathResource("{routeId}", StringUtils.FromString(publicRequest.RouteId)); request.ResourcePath = "/v2/apis/{apiId}/routes/{routeId}"; return request; } private static DeleteRouteRequestMarshaller _instance = new DeleteRouteRequestMarshaller(); internal static DeleteRouteRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteRouteRequestParameter Request Marshaller /// </summary> public class DeleteRouteRequestParameterRequestMarshaller : IMarshaller<IRequest, DeleteRouteRequestParameterRequest> , 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((DeleteRouteRequestParameterRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteRouteRequestParameterRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetRequestParameterKey()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RequestParameterKey set"); request.AddPathResource("{requestParameterKey}", StringUtils.FromString(publicRequest.RequestParameterKey)); if (!publicRequest.IsSetRouteId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteId set"); request.AddPathResource("{routeId}", StringUtils.FromString(publicRequest.RouteId)); request.ResourcePath = "/v2/apis/{apiId}/routes/{routeId}/requestparameters/{requestParameterKey}"; return request; } private static DeleteRouteRequestParameterRequestMarshaller _instance = new DeleteRouteRequestParameterRequestMarshaller(); internal static DeleteRouteRequestParameterRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteRequestParameterRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteRouteRequestParameter operation /// </summary> public class DeleteRouteRequestParameterResponseUnmarshaller : 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) { DeleteRouteRequestParameterResponse response = new DeleteRouteRequestParameterResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteRouteRequestParameterResponseUnmarshaller _instance = new DeleteRouteRequestParameterResponseUnmarshaller(); internal static DeleteRouteRequestParameterResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteRequestParameterResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteRouteResponse Request Marshaller /// </summary> public class DeleteRouteResponseRequestMarshaller : IMarshaller<IRequest, DeleteRouteResponseRequest> , 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((DeleteRouteResponseRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteRouteResponseRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetRouteId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteId set"); request.AddPathResource("{routeId}", StringUtils.FromString(publicRequest.RouteId)); if (!publicRequest.IsSetRouteResponseId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteResponseId set"); request.AddPathResource("{routeResponseId}", StringUtils.FromString(publicRequest.RouteResponseId)); request.ResourcePath = "/v2/apis/{apiId}/routes/{routeId}/routeresponses/{routeResponseId}"; return request; } private static DeleteRouteResponseRequestMarshaller _instance = new DeleteRouteResponseRequestMarshaller(); internal static DeleteRouteResponseRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteResponseRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteRouteResponse operation /// </summary> public class DeleteRouteResponseResponseUnmarshaller : 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) { DeleteRouteResponseResponse response = new DeleteRouteResponseResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteRouteResponseResponseUnmarshaller _instance = new DeleteRouteResponseResponseUnmarshaller(); internal static DeleteRouteResponseResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteResponseResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteRoute operation /// </summary> public class DeleteRouteResponseUnmarshaller : 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) { DeleteRouteResponse response = new DeleteRouteResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteRouteResponseUnmarshaller _instance = new DeleteRouteResponseUnmarshaller(); internal static DeleteRouteResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteRouteSettings Request Marshaller /// </summary> public class DeleteRouteSettingsRequestMarshaller : IMarshaller<IRequest, DeleteRouteSettingsRequest> , 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((DeleteRouteSettingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteRouteSettingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetRouteKey()) throw new AmazonApiGatewayV2Exception("Request object does not have required field RouteKey set"); request.AddPathResource("{routeKey}", StringUtils.FromString(publicRequest.RouteKey)); if (!publicRequest.IsSetStageName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field StageName set"); request.AddPathResource("{stageName}", StringUtils.FromString(publicRequest.StageName)); request.ResourcePath = "/v2/apis/{apiId}/stages/{stageName}/routesettings/{routeKey}"; return request; } private static DeleteRouteSettingsRequestMarshaller _instance = new DeleteRouteSettingsRequestMarshaller(); internal static DeleteRouteSettingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteSettingsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteRouteSettings operation /// </summary> public class DeleteRouteSettingsResponseUnmarshaller : 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) { DeleteRouteSettingsResponse response = new DeleteRouteSettingsResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteRouteSettingsResponseUnmarshaller _instance = new DeleteRouteSettingsResponseUnmarshaller(); internal static DeleteRouteSettingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRouteSettingsResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteStage Request Marshaller /// </summary> public class DeleteStageRequestMarshaller : IMarshaller<IRequest, DeleteStageRequest> , 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((DeleteStageRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteStageRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetStageName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field StageName set"); request.AddPathResource("{stageName}", StringUtils.FromString(publicRequest.StageName)); request.ResourcePath = "/v2/apis/{apiId}/stages/{stageName}"; return request; } private static DeleteStageRequestMarshaller _instance = new DeleteStageRequestMarshaller(); internal static DeleteStageRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteStageRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteStage operation /// </summary> public class DeleteStageResponseUnmarshaller : 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) { DeleteStageResponse response = new DeleteStageResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteStageResponseUnmarshaller _instance = new DeleteStageResponseUnmarshaller(); internal static DeleteStageResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteStageResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DeleteVpcLink Request Marshaller /// </summary> public class DeleteVpcLinkRequestMarshaller : IMarshaller<IRequest, DeleteVpcLinkRequest> , 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((DeleteVpcLinkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteVpcLinkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetVpcLinkId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field VpcLinkId set"); request.AddPathResource("{vpcLinkId}", StringUtils.FromString(publicRequest.VpcLinkId)); request.ResourcePath = "/v2/vpclinks/{vpcLinkId}"; return request; } private static DeleteVpcLinkRequestMarshaller _instance = new DeleteVpcLinkRequestMarshaller(); internal static DeleteVpcLinkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteVpcLinkRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteVpcLink operation /// </summary> public class DeleteVpcLinkResponseUnmarshaller : 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) { DeleteVpcLinkResponse response = new DeleteVpcLinkResponse(); 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteVpcLinkResponseUnmarshaller _instance = new DeleteVpcLinkResponseUnmarshaller(); internal static DeleteVpcLinkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteVpcLinkResponseUnmarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Deployment Object /// </summary> public class DeploymentUnmarshaller : IUnmarshaller<Deployment, XmlUnmarshallerContext>, IUnmarshaller<Deployment, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Deployment IUnmarshaller<Deployment, 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 Deployment Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Deployment unmarshalledObject = new Deployment(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("autoDeployed", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.AutoDeployed = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DeploymentStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Description = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DeploymentUnmarshaller _instance = new DeploymentUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DeploymentUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// DomainNameConfiguration Marshaller /// </summary> public class DomainNameConfigurationMarshaller : IRequestMarshaller<DomainNameConfiguration, 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(DomainNameConfiguration requestObject, JsonMarshallerContext context) { if(requestObject.IsSetApiGatewayDomainName()) { context.Writer.WritePropertyName("apiGatewayDomainName"); context.Writer.Write(requestObject.ApiGatewayDomainName); } if(requestObject.IsSetCertificateArn()) { context.Writer.WritePropertyName("certificateArn"); context.Writer.Write(requestObject.CertificateArn); } if(requestObject.IsSetCertificateName()) { context.Writer.WritePropertyName("certificateName"); context.Writer.Write(requestObject.CertificateName); } if(requestObject.IsSetCertificateUploadDate()) { context.Writer.WritePropertyName("certificateUploadDate"); context.Writer.Write(StringUtils.FromDateTimeToISO8601(requestObject.CertificateUploadDate)); } if(requestObject.IsSetDomainNameStatus()) { context.Writer.WritePropertyName("domainNameStatus"); context.Writer.Write(requestObject.DomainNameStatus); } if(requestObject.IsSetDomainNameStatusMessage()) { context.Writer.WritePropertyName("domainNameStatusMessage"); context.Writer.Write(requestObject.DomainNameStatusMessage); } if(requestObject.IsSetEndpointType()) { context.Writer.WritePropertyName("endpointType"); context.Writer.Write(requestObject.EndpointType); } if(requestObject.IsSetHostedZoneId()) { context.Writer.WritePropertyName("hostedZoneId"); context.Writer.Write(requestObject.HostedZoneId); } if(requestObject.IsSetOwnershipVerificationCertificateArn()) { context.Writer.WritePropertyName("ownershipVerificationCertificateArn"); context.Writer.Write(requestObject.OwnershipVerificationCertificateArn); } if(requestObject.IsSetSecurityPolicy()) { context.Writer.WritePropertyName("securityPolicy"); context.Writer.Write(requestObject.SecurityPolicy); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static DomainNameConfigurationMarshaller Instance = new DomainNameConfigurationMarshaller(); } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DomainNameConfiguration Object /// </summary> public class DomainNameConfigurationUnmarshaller : IUnmarshaller<DomainNameConfiguration, XmlUnmarshallerContext>, IUnmarshaller<DomainNameConfiguration, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> DomainNameConfiguration IUnmarshaller<DomainNameConfiguration, 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 DomainNameConfiguration Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; DomainNameConfiguration unmarshalledObject = new DomainNameConfiguration(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiGatewayDomainName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ApiGatewayDomainName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("certificateArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.CertificateArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("certificateName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.CertificateName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("certificateUploadDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CertificateUploadDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainNameStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DomainNameStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainNameStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DomainNameStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("endpointType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.EndpointType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("hostedZoneId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.HostedZoneId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ownershipVerificationCertificateArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.OwnershipVerificationCertificateArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("securityPolicy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.SecurityPolicy = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DomainNameConfigurationUnmarshaller _instance = new DomainNameConfigurationUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DomainNameConfigurationUnmarshaller Instance { get { return _instance; } } } }
146
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DomainName Object /// </summary> public class DomainNameUnmarshaller : IUnmarshaller<DomainName, XmlUnmarshallerContext>, IUnmarshaller<DomainName, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> DomainName IUnmarshaller<DomainName, 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 DomainName Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; DomainName unmarshalledObject = new DomainName(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiMappingSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ApiMappingSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainNameConfigurations", targetDepth)) { var unmarshaller = new ListUnmarshaller<DomainNameConfiguration, DomainNameConfigurationUnmarshaller>(DomainNameConfigurationUnmarshaller.Instance); unmarshalledObject.DomainNameConfigurations = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("mutualTlsAuthentication", targetDepth)) { var unmarshaller = MutualTlsAuthenticationUnmarshaller.Instance; unmarshalledObject.MutualTlsAuthentication = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainName", 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; } } return unmarshalledObject; } private static DomainNameUnmarshaller _instance = new DomainNameUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DomainNameUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// ExportApi Request Marshaller /// </summary> public class ExportApiRequestMarshaller : IMarshaller<IRequest, ExportApiRequest> , 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((ExportApiRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ExportApiRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetSpecification()) throw new AmazonApiGatewayV2Exception("Request object does not have required field Specification set"); request.AddPathResource("{specification}", StringUtils.FromString(publicRequest.Specification)); if (publicRequest.IsSetExportVersion()) request.Parameters.Add("exportVersion", StringUtils.FromString(publicRequest.ExportVersion)); if (publicRequest.IsSetIncludeExtensions()) request.Parameters.Add("includeExtensions", StringUtils.FromBool(publicRequest.IncludeExtensions)); if (publicRequest.IsSetOutputType()) request.Parameters.Add("outputType", StringUtils.FromString(publicRequest.OutputType)); if (publicRequest.IsSetStageName()) request.Parameters.Add("stageName", StringUtils.FromString(publicRequest.StageName)); request.ResourcePath = "/v2/apis/{apiId}/exports/{specification}"; request.UseQueryString = true; return request; } private static ExportApiRequestMarshaller _instance = new ExportApiRequestMarshaller(); internal static ExportApiRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ExportApiRequestMarshaller Instance { get { return _instance; } } } }
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ExportApi operation /// </summary> public class ExportApiResponseUnmarshaller : 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) { ExportApiResponse response = new ExportApiResponse(); var ms = new MemoryStream(); Amazon.Util.AWSSDKUtils.CopyStream(context.Stream, ms); ms.Seek(0, SeekOrigin.Begin); response.Body = ms; 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ExportApiResponseUnmarshaller _instance = new ExportApiResponseUnmarshaller(); internal static ExportApiResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ExportApiResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetApiMapping Request Marshaller /// </summary> public class GetApiMappingRequestMarshaller : IMarshaller<IRequest, GetApiMappingRequest> , 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((GetApiMappingRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetApiMappingRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiMappingId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiMappingId set"); request.AddPathResource("{apiMappingId}", StringUtils.FromString(publicRequest.ApiMappingId)); if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); request.ResourcePath = "/v2/domainnames/{domainName}/apimappings/{apiMappingId}"; return request; } private static GetApiMappingRequestMarshaller _instance = new GetApiMappingRequestMarshaller(); internal static GetApiMappingRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiMappingRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetApiMapping operation /// </summary> public class GetApiMappingResponseUnmarshaller : 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) { GetApiMappingResponse response = new GetApiMappingResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiMappingId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiMappingKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingKey = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("stage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Stage = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetApiMappingResponseUnmarshaller _instance = new GetApiMappingResponseUnmarshaller(); internal static GetApiMappingResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiMappingResponseUnmarshaller Instance { get { return _instance; } } } }
136
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetApiMappings Request Marshaller /// </summary> public class GetApiMappingsRequestMarshaller : IMarshaller<IRequest, GetApiMappingsRequest> , 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((GetApiMappingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetApiMappingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/domainnames/{domainName}/apimappings"; request.UseQueryString = true; return request; } private static GetApiMappingsRequestMarshaller _instance = new GetApiMappingsRequestMarshaller(); internal static GetApiMappingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiMappingsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetApiMappings operation /// </summary> public class GetApiMappingsResponseUnmarshaller : 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) { GetApiMappingsResponse response = new GetApiMappingsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<ApiMapping, ApiMappingUnmarshaller>(ApiMappingUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetApiMappingsResponseUnmarshaller _instance = new GetApiMappingsResponseUnmarshaller(); internal static GetApiMappingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiMappingsResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetApi Request Marshaller /// </summary> public class GetApiRequestMarshaller : IMarshaller<IRequest, GetApiRequest> , 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((GetApiRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetApiRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); request.ResourcePath = "/v2/apis/{apiId}"; return request; } private static GetApiRequestMarshaller _instance = new GetApiRequestMarshaller(); internal static GetApiRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetApi operation /// </summary> public class GetApiResponseUnmarshaller : 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) { GetApiResponse response = new GetApiResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiEndpoint", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiEndpoint = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("apiKeySelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiKeySelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("corsConfiguration", targetDepth)) { var unmarshaller = CorsUnmarshaller.Instance; response.CorsConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("disableExecuteApiEndpoint", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.DisableExecuteApiEndpoint = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("disableSchemaValidation", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.DisableSchemaValidation = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("importInfo", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.ImportInfo = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("protocolType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ProtocolType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("routeSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RouteSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("version", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Version = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("warnings", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.Warnings = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetApiResponseUnmarshaller _instance = new GetApiResponseUnmarshaller(); internal static GetApiResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApiResponseUnmarshaller Instance { get { return _instance; } } } }
204
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetApis Request Marshaller /// </summary> public class GetApisRequestMarshaller : IMarshaller<IRequest, GetApisRequest> , 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((GetApisRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetApisRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis"; request.UseQueryString = true; return request; } private static GetApisRequestMarshaller _instance = new GetApisRequestMarshaller(); internal static GetApisRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApisRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetApis operation /// </summary> public class GetApisResponseUnmarshaller : 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) { GetApisResponse response = new GetApisResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<Api, ApiUnmarshaller>(ApiUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetApisResponseUnmarshaller _instance = new GetApisResponseUnmarshaller(); internal static GetApisResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetApisResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetAuthorizer Request Marshaller /// </summary> public class GetAuthorizerRequestMarshaller : IMarshaller<IRequest, GetAuthorizerRequest> , 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((GetAuthorizerRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAuthorizerRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetAuthorizerId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field AuthorizerId set"); request.AddPathResource("{authorizerId}", StringUtils.FromString(publicRequest.AuthorizerId)); request.ResourcePath = "/v2/apis/{apiId}/authorizers/{authorizerId}"; return request; } private static GetAuthorizerRequestMarshaller _instance = new GetAuthorizerRequestMarshaller(); internal static GetAuthorizerRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAuthorizerRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAuthorizer operation /// </summary> public class GetAuthorizerResponseUnmarshaller : 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) { GetAuthorizerResponse response = new GetAuthorizerResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("authorizerCredentialsArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerCredentialsArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerPayloadFormatVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerPayloadFormatVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerResultTtlInSeconds", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.AuthorizerResultTtlInSeconds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("authorizerUri", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AuthorizerUri = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("enableSimpleResponses", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.EnableSimpleResponses = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("identitySource", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.IdentitySource = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("identityValidationExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IdentityValidationExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("jwtConfiguration", targetDepth)) { var unmarshaller = JWTConfigurationUnmarshaller.Instance; response.JwtConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAuthorizerResponseUnmarshaller _instance = new GetAuthorizerResponseUnmarshaller(); internal static GetAuthorizerResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAuthorizerResponseUnmarshaller Instance { get { return _instance; } } } }
174
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetAuthorizers Request Marshaller /// </summary> public class GetAuthorizersRequestMarshaller : IMarshaller<IRequest, GetAuthorizersRequest> , 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((GetAuthorizersRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetAuthorizersRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis/{apiId}/authorizers"; request.UseQueryString = true; return request; } private static GetAuthorizersRequestMarshaller _instance = new GetAuthorizersRequestMarshaller(); internal static GetAuthorizersRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAuthorizersRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetAuthorizers operation /// </summary> public class GetAuthorizersResponseUnmarshaller : 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) { GetAuthorizersResponse response = new GetAuthorizersResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<Authorizer, AuthorizerUnmarshaller>(AuthorizerUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetAuthorizersResponseUnmarshaller _instance = new GetAuthorizersResponseUnmarshaller(); internal static GetAuthorizersResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetAuthorizersResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetDeployment Request Marshaller /// </summary> public class GetDeploymentRequestMarshaller : IMarshaller<IRequest, GetDeploymentRequest> , 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((GetDeploymentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetDeploymentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetDeploymentId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DeploymentId set"); request.AddPathResource("{deploymentId}", StringUtils.FromString(publicRequest.DeploymentId)); request.ResourcePath = "/v2/apis/{apiId}/deployments/{deploymentId}"; return request; } private static GetDeploymentRequestMarshaller _instance = new GetDeploymentRequestMarshaller(); internal static GetDeploymentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDeploymentRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetDeployment operation /// </summary> public class GetDeploymentResponseUnmarshaller : 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) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("autoDeployed", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.AutoDeployed = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetDeploymentResponseUnmarshaller _instance = new GetDeploymentResponseUnmarshaller(); internal static GetDeploymentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDeploymentResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetDeployments Request Marshaller /// </summary> public class GetDeploymentsRequestMarshaller : IMarshaller<IRequest, GetDeploymentsRequest> , 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((GetDeploymentsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetDeploymentsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis/{apiId}/deployments"; request.UseQueryString = true; return request; } private static GetDeploymentsRequestMarshaller _instance = new GetDeploymentsRequestMarshaller(); internal static GetDeploymentsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDeploymentsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetDeployments operation /// </summary> public class GetDeploymentsResponseUnmarshaller : 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) { GetDeploymentsResponse response = new GetDeploymentsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<Deployment, DeploymentUnmarshaller>(DeploymentUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetDeploymentsResponseUnmarshaller _instance = new GetDeploymentsResponseUnmarshaller(); internal static GetDeploymentsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDeploymentsResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetDomainName Request Marshaller /// </summary> public class GetDomainNameRequestMarshaller : IMarshaller<IRequest, GetDomainNameRequest> , 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((GetDomainNameRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetDomainNameRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetDomainName()) throw new AmazonApiGatewayV2Exception("Request object does not have required field DomainName set"); request.AddPathResource("{domainName}", StringUtils.FromString(publicRequest.DomainName)); request.ResourcePath = "/v2/domainnames/{domainName}"; return request; } private static GetDomainNameRequestMarshaller _instance = new GetDomainNameRequestMarshaller(); internal static GetDomainNameRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDomainNameRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetDomainName operation /// </summary> public class GetDomainNameResponseUnmarshaller : 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) { GetDomainNameResponse response = new GetDomainNameResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiMappingSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApiMappingSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DomainName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("domainNameConfigurations", targetDepth)) { var unmarshaller = new ListUnmarshaller<DomainNameConfiguration, DomainNameConfigurationUnmarshaller>(DomainNameConfigurationUnmarshaller.Instance); response.DomainNameConfigurations = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("mutualTlsAuthentication", targetDepth)) { var unmarshaller = MutualTlsAuthenticationUnmarshaller.Instance; response.MutualTlsAuthentication = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetDomainNameResponseUnmarshaller _instance = new GetDomainNameResponseUnmarshaller(); internal static GetDomainNameResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDomainNameResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetDomainNames Request Marshaller /// </summary> public class GetDomainNamesRequestMarshaller : IMarshaller<IRequest, GetDomainNamesRequest> , 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((GetDomainNamesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetDomainNamesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/domainnames"; request.UseQueryString = true; return request; } private static GetDomainNamesRequestMarshaller _instance = new GetDomainNamesRequestMarshaller(); internal static GetDomainNamesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDomainNamesRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetDomainNames operation /// </summary> public class GetDomainNamesResponseUnmarshaller : 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) { GetDomainNamesResponse response = new GetDomainNamesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<DomainName, DomainNameUnmarshaller>(DomainNameUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetDomainNamesResponseUnmarshaller _instance = new GetDomainNamesResponseUnmarshaller(); internal static GetDomainNamesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetDomainNamesResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetIntegration Request Marshaller /// </summary> public class GetIntegrationRequestMarshaller : IMarshaller<IRequest, GetIntegrationRequest> , 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((GetIntegrationRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetIntegrationRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}"; return request; } private static GetIntegrationRequestMarshaller _instance = new GetIntegrationRequestMarshaller(); internal static GetIntegrationRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetIntegrationResponse Request Marshaller /// </summary> public class GetIntegrationResponseRequestMarshaller : IMarshaller<IRequest, GetIntegrationResponseRequest> , 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((GetIntegrationResponseRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetIntegrationResponseRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); if (!publicRequest.IsSetIntegrationResponseId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationResponseId set"); request.AddPathResource("{integrationResponseId}", StringUtils.FromString(publicRequest.IntegrationResponseId)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses/{integrationResponseId}"; return request; } private static GetIntegrationResponseRequestMarshaller _instance = new GetIntegrationResponseRequestMarshaller(); internal static GetIntegrationResponseRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationResponseRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetIntegrationResponse operation /// </summary> public class GetIntegrationResponseResponseUnmarshaller : 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) { GetIntegrationResponseResponse response = new GetIntegrationResponseResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("contentHandlingStrategy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentHandlingStrategy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseKey", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseKey = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.ResponseParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseTemplates", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.ResponseTemplates = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("templateSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TemplateSelectionExpression = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetIntegrationResponseResponseUnmarshaller _instance = new GetIntegrationResponseResponseUnmarshaller(); internal static GetIntegrationResponseResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationResponseResponseUnmarshaller Instance { get { return _instance; } } } }
144
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetIntegrationResponses Request Marshaller /// </summary> public class GetIntegrationResponsesRequestMarshaller : IMarshaller<IRequest, GetIntegrationResponsesRequest> , 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((GetIntegrationResponsesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetIntegrationResponsesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetIntegrationId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field IntegrationId set"); request.AddPathResource("{integrationId}", StringUtils.FromString(publicRequest.IntegrationId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis/{apiId}/integrations/{integrationId}/integrationresponses"; request.UseQueryString = true; return request; } private static GetIntegrationResponsesRequestMarshaller _instance = new GetIntegrationResponsesRequestMarshaller(); internal static GetIntegrationResponsesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationResponsesRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetIntegrationResponses operation /// </summary> public class GetIntegrationResponsesResponseUnmarshaller : 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) { GetIntegrationResponsesResponse response = new GetIntegrationResponsesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<IntegrationResponse, IntegrationResponseUnmarshaller>(IntegrationResponseUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetIntegrationResponsesResponseUnmarshaller _instance = new GetIntegrationResponsesResponseUnmarshaller(); internal static GetIntegrationResponsesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationResponsesResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetIntegration operation /// </summary> public class GetIntegrationResponseUnmarshaller : 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) { GetIntegrationResponse response = new GetIntegrationResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiGatewayManaged", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.ApiGatewayManaged = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("connectionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConnectionId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("connectionType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConnectionType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("contentHandlingStrategy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentHandlingStrategy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("credentialsArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CredentialsArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationMethod", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationMethod = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationResponseSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationResponseSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationSubtype", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationSubtype = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("integrationUri", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntegrationUri = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("passthroughBehavior", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PassthroughBehavior = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("payloadFormatVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PayloadFormatVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RequestParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("requestTemplates", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RequestTemplates = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("responseParameters", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, Dictionary<string, string>, StringUnmarshaller, DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>>(StringUnmarshaller.Instance, new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance)); response.ResponseParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("templateSelectionExpression", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TemplateSelectionExpression = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("timeoutInMillis", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.TimeoutInMillis = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tlsConfig", targetDepth)) { var unmarshaller = TlsConfigUnmarshaller.Instance; response.TlsConfig = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetIntegrationResponseUnmarshaller _instance = new GetIntegrationResponseUnmarshaller(); internal static GetIntegrationResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationResponseUnmarshaller Instance { get { return _instance; } } } }
228
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetIntegrations Request Marshaller /// </summary> public class GetIntegrationsRequestMarshaller : IMarshaller<IRequest, GetIntegrationsRequest> , 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((GetIntegrationsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetIntegrationsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis/{apiId}/integrations"; request.UseQueryString = true; return request; } private static GetIntegrationsRequestMarshaller _instance = new GetIntegrationsRequestMarshaller(); internal static GetIntegrationsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetIntegrations operation /// </summary> public class GetIntegrationsResponseUnmarshaller : 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) { GetIntegrationsResponse response = new GetIntegrationsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<Integration, IntegrationUnmarshaller>(IntegrationUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetIntegrationsResponseUnmarshaller _instance = new GetIntegrationsResponseUnmarshaller(); internal static GetIntegrationsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetIntegrationsResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetModel Request Marshaller /// </summary> public class GetModelRequestMarshaller : IMarshaller<IRequest, GetModelRequest> , 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((GetModelRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetModelRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetModelId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ModelId set"); request.AddPathResource("{modelId}", StringUtils.FromString(publicRequest.ModelId)); request.ResourcePath = "/v2/apis/{apiId}/models/{modelId}"; return request; } private static GetModelRequestMarshaller _instance = new GetModelRequestMarshaller(); internal static GetModelRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetModel operation /// </summary> public class GetModelResponseUnmarshaller : 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) { GetModelResponse response = new GetModelResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("contentType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ContentType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("modelId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ModelId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("schema", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Schema = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetModelResponseUnmarshaller _instance = new GetModelResponseUnmarshaller(); internal static GetModelResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelResponseUnmarshaller Instance { get { return _instance; } } } }
138
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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetModels Request Marshaller /// </summary> public class GetModelsRequestMarshaller : IMarshaller<IRequest, GetModelsRequest> , 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((GetModelsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetModelsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromString(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/v2/apis/{apiId}/models"; request.UseQueryString = true; return request; } private static GetModelsRequestMarshaller _instance = new GetModelsRequestMarshaller(); internal static GetModelsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelsRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetModels operation /// </summary> public class GetModelsResponseUnmarshaller : 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) { GetModelsResponse response = new GetModelsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("items", targetDepth)) { var unmarshaller = new ListUnmarshaller<Model, ModelUnmarshaller>(ModelUnmarshaller.Instance); response.Items = 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("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetModelsResponseUnmarshaller _instance = new GetModelsResponseUnmarshaller(); internal static GetModelsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelsResponseUnmarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// GetModelTemplate Request Marshaller /// </summary> public class GetModelTemplateRequestMarshaller : IMarshaller<IRequest, GetModelTemplateRequest> , 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((GetModelTemplateRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetModelTemplateRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.ApiGatewayV2"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-29"; request.HttpMethod = "GET"; if (!publicRequest.IsSetApiId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ApiId set"); request.AddPathResource("{apiId}", StringUtils.FromString(publicRequest.ApiId)); if (!publicRequest.IsSetModelId()) throw new AmazonApiGatewayV2Exception("Request object does not have required field ModelId set"); request.AddPathResource("{modelId}", StringUtils.FromString(publicRequest.ModelId)); request.ResourcePath = "/v2/apis/{apiId}/models/{modelId}/template"; return request; } private static GetModelTemplateRequestMarshaller _instance = new GetModelTemplateRequestMarshaller(); internal static GetModelTemplateRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelTemplateRequestMarshaller 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 apigatewayv2-2018-11-29.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.ApiGatewayV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ApiGatewayV2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetModelTemplate operation /// </summary> public class GetModelTemplateResponseUnmarshaller : 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) { GetModelTemplateResponse response = new GetModelTemplateResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("value", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Value = 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("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonApiGatewayV2Exception(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetModelTemplateResponseUnmarshaller _instance = new GetModelTemplateResponseUnmarshaller(); internal static GetModelTemplateResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetModelTemplateResponseUnmarshaller Instance { get { return _instance; } } } }
114