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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteBackupVaultAccessPolicy Request Marshaller /// </summary> public class DeleteBackupVaultAccessPolicyRequestMarshaller : IMarshaller<IRequest, DeleteBackupVaultAccessPolicyRequest> , 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((DeleteBackupVaultAccessPolicyRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteBackupVaultAccessPolicyRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}/access-policy"; return request; } private static DeleteBackupVaultAccessPolicyRequestMarshaller _instance = new DeleteBackupVaultAccessPolicyRequestMarshaller(); internal static DeleteBackupVaultAccessPolicyRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultAccessPolicyRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteBackupVaultAccessPolicy operation /// </summary> public class DeleteBackupVaultAccessPolicyResponseUnmarshaller : 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) { DeleteBackupVaultAccessPolicyResponse response = new DeleteBackupVaultAccessPolicyResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteBackupVaultAccessPolicyResponseUnmarshaller _instance = new DeleteBackupVaultAccessPolicyResponseUnmarshaller(); internal static DeleteBackupVaultAccessPolicyResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultAccessPolicyResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteBackupVaultLockConfiguration Request Marshaller /// </summary> public class DeleteBackupVaultLockConfigurationRequestMarshaller : IMarshaller<IRequest, DeleteBackupVaultLockConfigurationRequest> , 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((DeleteBackupVaultLockConfigurationRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteBackupVaultLockConfigurationRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}/vault-lock"; return request; } private static DeleteBackupVaultLockConfigurationRequestMarshaller _instance = new DeleteBackupVaultLockConfigurationRequestMarshaller(); internal static DeleteBackupVaultLockConfigurationRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultLockConfigurationRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteBackupVaultLockConfiguration operation /// </summary> public class DeleteBackupVaultLockConfigurationResponseUnmarshaller : 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) { DeleteBackupVaultLockConfigurationResponse response = new DeleteBackupVaultLockConfigurationResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteBackupVaultLockConfigurationResponseUnmarshaller _instance = new DeleteBackupVaultLockConfigurationResponseUnmarshaller(); internal static DeleteBackupVaultLockConfigurationResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultLockConfigurationResponseUnmarshaller Instance { get { return _instance; } } } }
115
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteBackupVaultNotifications Request Marshaller /// </summary> public class DeleteBackupVaultNotificationsRequestMarshaller : IMarshaller<IRequest, DeleteBackupVaultNotificationsRequest> , 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((DeleteBackupVaultNotificationsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteBackupVaultNotificationsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}/notification-configuration"; return request; } private static DeleteBackupVaultNotificationsRequestMarshaller _instance = new DeleteBackupVaultNotificationsRequestMarshaller(); internal static DeleteBackupVaultNotificationsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultNotificationsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteBackupVaultNotifications operation /// </summary> public class DeleteBackupVaultNotificationsResponseUnmarshaller : 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) { DeleteBackupVaultNotificationsResponse response = new DeleteBackupVaultNotificationsResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteBackupVaultNotificationsResponseUnmarshaller _instance = new DeleteBackupVaultNotificationsResponseUnmarshaller(); internal static DeleteBackupVaultNotificationsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultNotificationsResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteBackupVault Request Marshaller /// </summary> public class DeleteBackupVaultRequestMarshaller : IMarshaller<IRequest, DeleteBackupVaultRequest> , 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((DeleteBackupVaultRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteBackupVaultRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}"; return request; } private static DeleteBackupVaultRequestMarshaller _instance = new DeleteBackupVaultRequestMarshaller(); internal static DeleteBackupVaultRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteBackupVault operation /// </summary> public class DeleteBackupVaultResponseUnmarshaller : 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) { DeleteBackupVaultResponse response = new DeleteBackupVaultResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteBackupVaultResponseUnmarshaller _instance = new DeleteBackupVaultResponseUnmarshaller(); internal static DeleteBackupVaultResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteBackupVaultResponseUnmarshaller Instance { get { return _instance; } } } }
115
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteFramework Request Marshaller /// </summary> public class DeleteFrameworkRequestMarshaller : IMarshaller<IRequest, DeleteFrameworkRequest> , 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((DeleteFrameworkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteFrameworkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetFrameworkName()) throw new AmazonBackupException("Request object does not have required field FrameworkName set"); request.AddPathResource("{frameworkName}", StringUtils.FromString(publicRequest.FrameworkName)); request.ResourcePath = "/audit/frameworks/{frameworkName}"; return request; } private static DeleteFrameworkRequestMarshaller _instance = new DeleteFrameworkRequestMarshaller(); internal static DeleteFrameworkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteFrameworkRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteFramework operation /// </summary> public class DeleteFrameworkResponseUnmarshaller : 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) { DeleteFrameworkResponse response = new DeleteFrameworkResponse(); 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteFrameworkResponseUnmarshaller _instance = new DeleteFrameworkResponseUnmarshaller(); internal static DeleteFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
115
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteRecoveryPoint Request Marshaller /// </summary> public class DeleteRecoveryPointRequestMarshaller : IMarshaller<IRequest, DeleteRecoveryPointRequest> , 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((DeleteRecoveryPointRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteRecoveryPointRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (!publicRequest.IsSetRecoveryPointArn()) throw new AmazonBackupException("Request object does not have required field RecoveryPointArn set"); request.AddPathResource("{recoveryPointArn}", StringUtils.FromString(publicRequest.RecoveryPointArn)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}"; return request; } private static DeleteRecoveryPointRequestMarshaller _instance = new DeleteRecoveryPointRequestMarshaller(); internal static DeleteRecoveryPointRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRecoveryPointRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteRecoveryPoint operation /// </summary> public class DeleteRecoveryPointResponseUnmarshaller : 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) { DeleteRecoveryPointResponse response = new DeleteRecoveryPointResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidResourceStateException")) { return InvalidResourceStateExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteRecoveryPointResponseUnmarshaller _instance = new DeleteRecoveryPointResponseUnmarshaller(); internal static DeleteRecoveryPointResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteRecoveryPointResponseUnmarshaller Instance { get { return _instance; } } } }
119
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DeleteReportPlan Request Marshaller /// </summary> public class DeleteReportPlanRequestMarshaller : IMarshaller<IRequest, DeleteReportPlanRequest> , 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((DeleteReportPlanRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DeleteReportPlanRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetReportPlanName()) throw new AmazonBackupException("Request object does not have required field ReportPlanName set"); request.AddPathResource("{reportPlanName}", StringUtils.FromString(publicRequest.ReportPlanName)); request.ResourcePath = "/audit/report-plans/{reportPlanName}"; return request; } private static DeleteReportPlanRequestMarshaller _instance = new DeleteReportPlanRequestMarshaller(); internal static DeleteReportPlanRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteReportPlanRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DeleteReportPlan operation /// </summary> public class DeleteReportPlanResponseUnmarshaller : 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) { DeleteReportPlanResponse response = new DeleteReportPlanResponse(); 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("ConflictException")) { return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DeleteReportPlanResponseUnmarshaller _instance = new DeleteReportPlanResponseUnmarshaller(); internal static DeleteReportPlanResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DeleteReportPlanResponseUnmarshaller Instance { get { return _instance; } } } }
115
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DependencyFailureException Object /// </summary> public class DependencyFailureExceptionUnmarshaller : IErrorResponseUnmarshaller<DependencyFailureException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public DependencyFailureException 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 DependencyFailureException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); DependencyFailureException unmarshalledObject = new DependencyFailureException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Context", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Context = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static DependencyFailureExceptionUnmarshaller _instance = new DependencyFailureExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static DependencyFailureExceptionUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeBackupJob Request Marshaller /// </summary> public class DescribeBackupJobRequestMarshaller : IMarshaller<IRequest, DescribeBackupJobRequest> , 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((DescribeBackupJobRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeBackupJobRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupJobId()) throw new AmazonBackupException("Request object does not have required field BackupJobId set"); request.AddPathResource("{backupJobId}", StringUtils.FromString(publicRequest.BackupJobId)); request.ResourcePath = "/backup-jobs/{backupJobId}"; return request; } private static DescribeBackupJobRequestMarshaller _instance = new DescribeBackupJobRequestMarshaller(); internal static DescribeBackupJobRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeBackupJobRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeBackupJob operation /// </summary> public class DescribeBackupJobResponseUnmarshaller : 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) { DescribeBackupJobResponse response = new DescribeBackupJobResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AccountId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupJobId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupJobId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupOptions", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.BackupOptions = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupSizeInBytes", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.BackupSizeInBytes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BytesTransferred", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.BytesTransferred = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ChildJobsInState", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, long, StringUnmarshaller, LongUnmarshaller>(StringUnmarshaller.Instance, LongUnmarshaller.Instance); response.ChildJobsInState = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CompletionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CompletionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = RecoveryPointCreatorUnmarshaller.Instance; response.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExpectedCompletionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.ExpectedCompletionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IamRoleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IamRoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IsParent", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.IsParent = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NumberOfChildJobs", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.NumberOfChildJobs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ParentJobId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ParentJobId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("PercentDone", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PercentDone = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPointArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RecoveryPointArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StartBy", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.StartBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("State", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.State = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.StatusMessage = 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("DependencyFailureException")) { return DependencyFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeBackupJobResponseUnmarshaller _instance = new DescribeBackupJobResponseUnmarshaller(); internal static DescribeBackupJobResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeBackupJobResponseUnmarshaller Instance { get { return _instance; } } } }
270
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeBackupVault Request Marshaller /// </summary> public class DescribeBackupVaultRequestMarshaller : IMarshaller<IRequest, DescribeBackupVaultRequest> , 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((DescribeBackupVaultRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeBackupVaultRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}"; return request; } private static DescribeBackupVaultRequestMarshaller _instance = new DescribeBackupVaultRequestMarshaller(); internal static DescribeBackupVaultRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeBackupVaultRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeBackupVault operation /// </summary> public class DescribeBackupVaultResponseUnmarshaller : 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) { DescribeBackupVaultResponse response = new DescribeBackupVaultResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatorRequestId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CreatorRequestId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EncryptionKeyArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EncryptionKeyArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LockDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LockDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Locked", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.Locked = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MaxRetentionDays", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.MaxRetentionDays = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MinRetentionDays", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.MinRetentionDays = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NumberOfRecoveryPoints", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.NumberOfRecoveryPoints = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeBackupVaultResponseUnmarshaller _instance = new DescribeBackupVaultResponseUnmarshaller(); internal static DescribeBackupVaultResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeBackupVaultResponseUnmarshaller Instance { get { return _instance; } } } }
176
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeCopyJob Request Marshaller /// </summary> public class DescribeCopyJobRequestMarshaller : IMarshaller<IRequest, DescribeCopyJobRequest> , 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((DescribeCopyJobRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeCopyJobRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetCopyJobId()) throw new AmazonBackupException("Request object does not have required field CopyJobId set"); request.AddPathResource("{copyJobId}", StringUtils.FromString(publicRequest.CopyJobId)); request.ResourcePath = "/copy-jobs/{copyJobId}"; return request; } private static DescribeCopyJobRequestMarshaller _instance = new DescribeCopyJobRequestMarshaller(); internal static DescribeCopyJobRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeCopyJobRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeCopyJob operation /// </summary> public class DescribeCopyJobResponseUnmarshaller : 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) { DescribeCopyJobResponse response = new DescribeCopyJobResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CopyJob", targetDepth)) { var unmarshaller = CopyJobUnmarshaller.Instance; response.CopyJob = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeCopyJobResponseUnmarshaller _instance = new DescribeCopyJobResponseUnmarshaller(); internal static DescribeCopyJobResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeCopyJobResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeFramework Request Marshaller /// </summary> public class DescribeFrameworkRequestMarshaller : IMarshaller<IRequest, DescribeFrameworkRequest> , 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((DescribeFrameworkRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeFrameworkRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetFrameworkName()) throw new AmazonBackupException("Request object does not have required field FrameworkName set"); request.AddPathResource("{frameworkName}", StringUtils.FromString(publicRequest.FrameworkName)); request.ResourcePath = "/audit/frameworks/{frameworkName}"; return request; } private static DescribeFrameworkRequestMarshaller _instance = new DescribeFrameworkRequestMarshaller(); internal static DescribeFrameworkRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeFrameworkRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeFramework operation /// </summary> public class DescribeFrameworkResponseUnmarshaller : 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) { DescribeFrameworkResponse response = new DescribeFrameworkResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CreationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkControls", targetDepth)) { var unmarshaller = new ListUnmarshaller<FrameworkControl, FrameworkControlUnmarshaller>(FrameworkControlUnmarshaller.Instance); response.FrameworkControls = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkDescription", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkDescription = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FrameworkStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IdempotencyToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IdempotencyToken = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeFrameworkResponseUnmarshaller _instance = new DescribeFrameworkResponseUnmarshaller(); internal static DescribeFrameworkResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeFrameworkResponseUnmarshaller Instance { get { return _instance; } } } }
164
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeGlobalSettings Request Marshaller /// </summary> public class DescribeGlobalSettingsRequestMarshaller : IMarshaller<IRequest, DescribeGlobalSettingsRequest> , 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((DescribeGlobalSettingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeGlobalSettingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; request.ResourcePath = "/global-settings"; return request; } private static DescribeGlobalSettingsRequestMarshaller _instance = new DescribeGlobalSettingsRequestMarshaller(); internal static DescribeGlobalSettingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeGlobalSettingsRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeGlobalSettings operation /// </summary> public class DescribeGlobalSettingsResponseUnmarshaller : 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) { DescribeGlobalSettingsResponse response = new DescribeGlobalSettingsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("GlobalSettings", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.GlobalSettings = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastUpdateTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastUpdateTime = 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("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeGlobalSettingsResponseUnmarshaller _instance = new DescribeGlobalSettingsResponseUnmarshaller(); internal static DescribeGlobalSettingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeGlobalSettingsResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeProtectedResource Request Marshaller /// </summary> public class DescribeProtectedResourceRequestMarshaller : IMarshaller<IRequest, DescribeProtectedResourceRequest> , 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((DescribeProtectedResourceRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeProtectedResourceRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetResourceArn()) throw new AmazonBackupException("Request object does not have required field ResourceArn set"); request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn)); request.ResourcePath = "/resources/{resourceArn}"; return request; } private static DescribeProtectedResourceRequestMarshaller _instance = new DescribeProtectedResourceRequestMarshaller(); internal static DescribeProtectedResourceRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeProtectedResourceRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeProtectedResource operation /// </summary> public class DescribeProtectedResourceResponseUnmarshaller : 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) { DescribeProtectedResourceResponse response = new DescribeProtectedResourceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("LastBackupTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastBackupTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceType = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeProtectedResourceResponseUnmarshaller _instance = new DescribeProtectedResourceResponseUnmarshaller(); internal static DescribeProtectedResourceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeProtectedResourceResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeRecoveryPoint Request Marshaller /// </summary> public class DescribeRecoveryPointRequestMarshaller : IMarshaller<IRequest, DescribeRecoveryPointRequest> , 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((DescribeRecoveryPointRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeRecoveryPointRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (!publicRequest.IsSetRecoveryPointArn()) throw new AmazonBackupException("Request object does not have required field RecoveryPointArn set"); request.AddPathResource("{recoveryPointArn}", StringUtils.FromString(publicRequest.RecoveryPointArn)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}"; return request; } private static DescribeRecoveryPointRequestMarshaller _instance = new DescribeRecoveryPointRequestMarshaller(); internal static DescribeRecoveryPointRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRecoveryPointRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeRecoveryPoint operation /// </summary> public class DescribeRecoveryPointResponseUnmarshaller : 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) { DescribeRecoveryPointResponse response = new DescribeRecoveryPointResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupSizeInBytes", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.BackupSizeInBytes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CalculatedLifecycle", targetDepth)) { var unmarshaller = CalculatedLifecycleUnmarshaller.Instance; response.CalculatedLifecycle = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CompletionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CompletionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CompositeMemberIdentifier", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CompositeMemberIdentifier = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedBy", targetDepth)) { var unmarshaller = RecoveryPointCreatorUnmarshaller.Instance; response.CreatedBy = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EncryptionKeyArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EncryptionKeyArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IamRoleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IamRoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IsEncrypted", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.IsEncrypted = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IsParent", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.IsParent = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastRestoreTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastRestoreTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Lifecycle", targetDepth)) { var unmarshaller = LifecycleUnmarshaller.Instance; response.Lifecycle = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ParentRecoveryPointArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ParentRecoveryPointArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPointArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RecoveryPointArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SourceBackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SourceBackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.StatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StorageClass", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.StorageClass = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeRecoveryPointResponseUnmarshaller _instance = new DescribeRecoveryPointResponseUnmarshaller(); internal static DescribeRecoveryPointResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRecoveryPointResponseUnmarshaller Instance { get { return _instance; } } } }
254
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeRegionSettings Request Marshaller /// </summary> public class DescribeRegionSettingsRequestMarshaller : IMarshaller<IRequest, DescribeRegionSettingsRequest> , 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((DescribeRegionSettingsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeRegionSettingsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; request.ResourcePath = "/account-settings"; return request; } private static DescribeRegionSettingsRequestMarshaller _instance = new DescribeRegionSettingsRequestMarshaller(); internal static DescribeRegionSettingsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRegionSettingsRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeRegionSettings operation /// </summary> public class DescribeRegionSettingsResponseUnmarshaller : 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) { DescribeRegionSettingsResponse response = new DescribeRegionSettingsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ResourceTypeManagementPreference", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, bool, StringUnmarshaller, BoolUnmarshaller>(StringUnmarshaller.Instance, BoolUnmarshaller.Instance); response.ResourceTypeManagementPreference = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceTypeOptInPreference", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, bool, StringUnmarshaller, BoolUnmarshaller>(StringUnmarshaller.Instance, BoolUnmarshaller.Instance); response.ResourceTypeOptInPreference = 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("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeRegionSettingsResponseUnmarshaller _instance = new DescribeRegionSettingsResponseUnmarshaller(); internal static DescribeRegionSettingsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRegionSettingsResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeReportJob Request Marshaller /// </summary> public class DescribeReportJobRequestMarshaller : IMarshaller<IRequest, DescribeReportJobRequest> , 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((DescribeReportJobRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeReportJobRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetReportJobId()) throw new AmazonBackupException("Request object does not have required field ReportJobId set"); request.AddPathResource("{reportJobId}", StringUtils.FromString(publicRequest.ReportJobId)); request.ResourcePath = "/audit/report-jobs/{reportJobId}"; return request; } private static DescribeReportJobRequestMarshaller _instance = new DescribeReportJobRequestMarshaller(); internal static DescribeReportJobRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeReportJobRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeReportJob operation /// </summary> public class DescribeReportJobResponseUnmarshaller : 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) { DescribeReportJobResponse response = new DescribeReportJobResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ReportJob", targetDepth)) { var unmarshaller = ReportJobUnmarshaller.Instance; response.ReportJob = 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("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeReportJobResponseUnmarshaller _instance = new DescribeReportJobResponseUnmarshaller(); internal static DescribeReportJobResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeReportJobResponseUnmarshaller Instance { get { return _instance; } } } }
118
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeReportPlan Request Marshaller /// </summary> public class DescribeReportPlanRequestMarshaller : IMarshaller<IRequest, DescribeReportPlanRequest> , 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((DescribeReportPlanRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeReportPlanRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetReportPlanName()) throw new AmazonBackupException("Request object does not have required field ReportPlanName set"); request.AddPathResource("{reportPlanName}", StringUtils.FromString(publicRequest.ReportPlanName)); request.ResourcePath = "/audit/report-plans/{reportPlanName}"; return request; } private static DescribeReportPlanRequestMarshaller _instance = new DescribeReportPlanRequestMarshaller(); internal static DescribeReportPlanRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeReportPlanRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeReportPlan operation /// </summary> public class DescribeReportPlanResponseUnmarshaller : 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) { DescribeReportPlanResponse response = new DescribeReportPlanResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ReportPlan", targetDepth)) { var unmarshaller = ReportPlanUnmarshaller.Instance; response.ReportPlan = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeReportPlanResponseUnmarshaller _instance = new DescribeReportPlanResponseUnmarshaller(); internal static DescribeReportPlanResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeReportPlanResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DescribeRestoreJob Request Marshaller /// </summary> public class DescribeRestoreJobRequestMarshaller : IMarshaller<IRequest, DescribeRestoreJobRequest> , 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((DescribeRestoreJobRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DescribeRestoreJobRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetRestoreJobId()) throw new AmazonBackupException("Request object does not have required field RestoreJobId set"); request.AddPathResource("{restoreJobId}", StringUtils.FromString(publicRequest.RestoreJobId)); request.ResourcePath = "/restore-jobs/{restoreJobId}"; return request; } private static DescribeRestoreJobRequestMarshaller _instance = new DescribeRestoreJobRequestMarshaller(); internal static DescribeRestoreJobRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRestoreJobRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeRestoreJob operation /// </summary> public class DescribeRestoreJobResponseUnmarshaller : 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) { DescribeRestoreJobResponse response = new DescribeRestoreJobResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AccountId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.AccountId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupSizeInBytes", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.BackupSizeInBytes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CompletionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CompletionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatedResourceArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CreatedResourceArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ExpectedCompletionTimeMinutes", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; response.ExpectedCompletionTimeMinutes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IamRoleArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IamRoleArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("PercentDone", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.PercentDone = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPointArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RecoveryPointArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ResourceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ResourceType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RestoreJobId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RestoreJobId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.StatusMessage = 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("DependencyFailureException")) { return DependencyFailureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeRestoreJobResponseUnmarshaller _instance = new DescribeRestoreJobResponseUnmarshaller(); internal static DescribeRestoreJobResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeRestoreJobResponseUnmarshaller Instance { get { return _instance; } } } }
198
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DisassociateRecoveryPointFromParent Request Marshaller /// </summary> public class DisassociateRecoveryPointFromParentRequestMarshaller : IMarshaller<IRequest, DisassociateRecoveryPointFromParentRequest> , 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((DisassociateRecoveryPointFromParentRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DisassociateRecoveryPointFromParentRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "DELETE"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (!publicRequest.IsSetRecoveryPointArn()) throw new AmazonBackupException("Request object does not have required field RecoveryPointArn set"); request.AddPathResource("{recoveryPointArn}", StringUtils.FromString(publicRequest.RecoveryPointArn)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/parentAssociation"; return request; } private static DisassociateRecoveryPointFromParentRequestMarshaller _instance = new DisassociateRecoveryPointFromParentRequestMarshaller(); internal static DisassociateRecoveryPointFromParentRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateRecoveryPointFromParentRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DisassociateRecoveryPointFromParent operation /// </summary> public class DisassociateRecoveryPointFromParentResponseUnmarshaller : 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) { DisassociateRecoveryPointFromParentResponse response = new DisassociateRecoveryPointFromParentResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DisassociateRecoveryPointFromParentResponseUnmarshaller _instance = new DisassociateRecoveryPointFromParentResponseUnmarshaller(); internal static DisassociateRecoveryPointFromParentResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateRecoveryPointFromParentResponseUnmarshaller Instance { get { return _instance; } } } }
115
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// DisassociateRecoveryPoint Request Marshaller /// </summary> public class DisassociateRecoveryPointRequestMarshaller : IMarshaller<IRequest, DisassociateRecoveryPointRequest> , 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((DisassociateRecoveryPointRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(DisassociateRecoveryPointRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "POST"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (!publicRequest.IsSetRecoveryPointArn()) throw new AmazonBackupException("Request object does not have required field RecoveryPointArn set"); request.AddPathResource("{recoveryPointArn}", StringUtils.FromString(publicRequest.RecoveryPointArn)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/disassociate"; return request; } private static DisassociateRecoveryPointRequestMarshaller _instance = new DisassociateRecoveryPointRequestMarshaller(); internal static DisassociateRecoveryPointRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateRecoveryPointRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DisassociateRecoveryPoint operation /// </summary> public class DisassociateRecoveryPointResponseUnmarshaller : 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) { DisassociateRecoveryPointResponse response = new DisassociateRecoveryPointResponse(); 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidResourceStateException")) { return InvalidResourceStateExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DisassociateRecoveryPointResponseUnmarshaller _instance = new DisassociateRecoveryPointResponseUnmarshaller(); internal static DisassociateRecoveryPointResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DisassociateRecoveryPointResponseUnmarshaller Instance { get { return _instance; } } } }
119
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ExportBackupPlanTemplate Request Marshaller /// </summary> public class ExportBackupPlanTemplateRequestMarshaller : IMarshaller<IRequest, ExportBackupPlanTemplateRequest> , 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((ExportBackupPlanTemplateRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ExportBackupPlanTemplateRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanId()) throw new AmazonBackupException("Request object does not have required field BackupPlanId set"); request.AddPathResource("{backupPlanId}", StringUtils.FromString(publicRequest.BackupPlanId)); request.ResourcePath = "/backup/plans/{backupPlanId}/toTemplate/"; return request; } private static ExportBackupPlanTemplateRequestMarshaller _instance = new ExportBackupPlanTemplateRequestMarshaller(); internal static ExportBackupPlanTemplateRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ExportBackupPlanTemplateRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ExportBackupPlanTemplate operation /// </summary> public class ExportBackupPlanTemplateResponseUnmarshaller : 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) { ExportBackupPlanTemplateResponse response = new ExportBackupPlanTemplateResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlanTemplateJson", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupPlanTemplateJson = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ExportBackupPlanTemplateResponseUnmarshaller _instance = new ExportBackupPlanTemplateResponseUnmarshaller(); internal static ExportBackupPlanTemplateResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ExportBackupPlanTemplateResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// FrameworkControl Marshaller /// </summary> public class FrameworkControlMarshaller : IRequestMarshaller<FrameworkControl, 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(FrameworkControl requestObject, JsonMarshallerContext context) { if(requestObject.IsSetControlInputParameters()) { context.Writer.WritePropertyName("ControlInputParameters"); context.Writer.WriteArrayStart(); foreach(var requestObjectControlInputParametersListValue in requestObject.ControlInputParameters) { context.Writer.WriteObjectStart(); var marshaller = ControlInputParameterMarshaller.Instance; marshaller.Marshall(requestObjectControlInputParametersListValue, context); context.Writer.WriteObjectEnd(); } context.Writer.WriteArrayEnd(); } if(requestObject.IsSetControlName()) { context.Writer.WritePropertyName("ControlName"); context.Writer.Write(requestObject.ControlName); } if(requestObject.IsSetControlScope()) { context.Writer.WritePropertyName("ControlScope"); context.Writer.WriteObjectStart(); var marshaller = ControlScopeMarshaller.Instance; marshaller.Marshall(requestObject.ControlScope, context); context.Writer.WriteObjectEnd(); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static FrameworkControlMarshaller Instance = new FrameworkControlMarshaller(); } }
89
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for FrameworkControl Object /// </summary> public class FrameworkControlUnmarshaller : IUnmarshaller<FrameworkControl, XmlUnmarshallerContext>, IUnmarshaller<FrameworkControl, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> FrameworkControl IUnmarshaller<FrameworkControl, 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 FrameworkControl Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; FrameworkControl unmarshalledObject = new FrameworkControl(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ControlInputParameters", targetDepth)) { var unmarshaller = new ListUnmarshaller<ControlInputParameter, ControlInputParameterUnmarshaller>(ControlInputParameterUnmarshaller.Instance); unmarshalledObject.ControlInputParameters = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ControlName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.ControlName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ControlScope", targetDepth)) { var unmarshaller = ControlScopeUnmarshaller.Instance; unmarshalledObject.ControlScope = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static FrameworkControlUnmarshaller _instance = new FrameworkControlUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static FrameworkControlUnmarshaller Instance { get { return _instance; } } } }
104
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Framework Object /// </summary> public class FrameworkUnmarshaller : IUnmarshaller<Framework, XmlUnmarshallerContext>, IUnmarshaller<Framework, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Framework IUnmarshaller<Framework, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public Framework Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Framework unmarshalledObject = new Framework(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CreationTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreationTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.FrameworkArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkDescription", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.FrameworkDescription = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FrameworkName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.FrameworkName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NumberOfControls", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; unmarshalledObject.NumberOfControls = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static FrameworkUnmarshaller _instance = new FrameworkUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static FrameworkUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupPlanFromJSON Request Marshaller /// </summary> public class GetBackupPlanFromJSONRequestMarshaller : IMarshaller<IRequest, GetBackupPlanFromJSONRequest> , 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((GetBackupPlanFromJSONRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupPlanFromJSONRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers["Content-Type"] = "application/json"; request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "POST"; request.ResourcePath = "/backup/template/json/toPlan"; using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { JsonWriter writer = new JsonWriter(stringWriter); writer.WriteObjectStart(); var context = new JsonMarshallerContext(request, writer); if(publicRequest.IsSetBackupPlanTemplateJson()) { context.Writer.WritePropertyName("BackupPlanTemplateJson"); context.Writer.Write(publicRequest.BackupPlanTemplateJson); } writer.WriteObjectEnd(); string snippet = stringWriter.ToString(); request.Content = System.Text.Encoding.UTF8.GetBytes(snippet); } return request; } private static GetBackupPlanFromJSONRequestMarshaller _instance = new GetBackupPlanFromJSONRequestMarshaller(); internal static GetBackupPlanFromJSONRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanFromJSONRequestMarshaller Instance { get { return _instance; } } } }
101
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupPlanFromJSON operation /// </summary> public class GetBackupPlanFromJSONResponseUnmarshaller : 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) { GetBackupPlanFromJSONResponse response = new GetBackupPlanFromJSONResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlan", targetDepth)) { var unmarshaller = BackupPlanUnmarshaller.Instance; response.BackupPlan = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidRequestException")) { return InvalidRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("LimitExceededException")) { return LimitExceededExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupPlanFromJSONResponseUnmarshaller _instance = new GetBackupPlanFromJSONResponseUnmarshaller(); internal static GetBackupPlanFromJSONResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanFromJSONResponseUnmarshaller Instance { get { return _instance; } } } }
126
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupPlanFromTemplate Request Marshaller /// </summary> public class GetBackupPlanFromTemplateRequestMarshaller : IMarshaller<IRequest, GetBackupPlanFromTemplateRequest> , 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((GetBackupPlanFromTemplateRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupPlanFromTemplateRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanTemplateId()) throw new AmazonBackupException("Request object does not have required field BackupPlanTemplateId set"); request.AddPathResource("{templateId}", StringUtils.FromString(publicRequest.BackupPlanTemplateId)); request.ResourcePath = "/backup/template/plans/{templateId}/toPlan"; return request; } private static GetBackupPlanFromTemplateRequestMarshaller _instance = new GetBackupPlanFromTemplateRequestMarshaller(); internal static GetBackupPlanFromTemplateRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanFromTemplateRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupPlanFromTemplate operation /// </summary> public class GetBackupPlanFromTemplateResponseUnmarshaller : 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) { GetBackupPlanFromTemplateResponse response = new GetBackupPlanFromTemplateResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlanDocument", targetDepth)) { var unmarshaller = BackupPlanUnmarshaller.Instance; response.BackupPlanDocument = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupPlanFromTemplateResponseUnmarshaller _instance = new GetBackupPlanFromTemplateResponseUnmarshaller(); internal static GetBackupPlanFromTemplateResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanFromTemplateResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupPlan Request Marshaller /// </summary> public class GetBackupPlanRequestMarshaller : IMarshaller<IRequest, GetBackupPlanRequest> , 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((GetBackupPlanRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupPlanRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanId()) throw new AmazonBackupException("Request object does not have required field BackupPlanId set"); request.AddPathResource("{backupPlanId}", StringUtils.FromString(publicRequest.BackupPlanId)); if (publicRequest.IsSetVersionId()) request.Parameters.Add("versionId", StringUtils.FromString(publicRequest.VersionId)); request.ResourcePath = "/backup/plans/{backupPlanId}/"; request.UseQueryString = true; return request; } private static GetBackupPlanRequestMarshaller _instance = new GetBackupPlanRequestMarshaller(); internal static GetBackupPlanRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupPlan operation /// </summary> public class GetBackupPlanResponseUnmarshaller : 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) { GetBackupPlanResponse response = new GetBackupPlanResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("AdvancedBackupSettings", targetDepth)) { var unmarshaller = new ListUnmarshaller<AdvancedBackupSetting, AdvancedBackupSettingUnmarshaller>(AdvancedBackupSettingUnmarshaller.Instance); response.AdvancedBackupSettings = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupPlan", targetDepth)) { var unmarshaller = BackupPlanUnmarshaller.Instance; response.BackupPlan = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupPlanArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupPlanArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupPlanId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupPlanId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatorRequestId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CreatorRequestId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeletionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.DeletionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastExecutionDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastExecutionDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("VersionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.VersionId = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupPlanResponseUnmarshaller _instance = new GetBackupPlanResponseUnmarshaller(); internal static GetBackupPlanResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupPlanResponseUnmarshaller Instance { get { return _instance; } } } }
170
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupSelection Request Marshaller /// </summary> public class GetBackupSelectionRequestMarshaller : IMarshaller<IRequest, GetBackupSelectionRequest> , 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((GetBackupSelectionRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupSelectionRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanId()) throw new AmazonBackupException("Request object does not have required field BackupPlanId set"); request.AddPathResource("{backupPlanId}", StringUtils.FromString(publicRequest.BackupPlanId)); if (!publicRequest.IsSetSelectionId()) throw new AmazonBackupException("Request object does not have required field SelectionId set"); request.AddPathResource("{selectionId}", StringUtils.FromString(publicRequest.SelectionId)); request.ResourcePath = "/backup/plans/{backupPlanId}/selections/{selectionId}"; return request; } private static GetBackupSelectionRequestMarshaller _instance = new GetBackupSelectionRequestMarshaller(); internal static GetBackupSelectionRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupSelectionRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupSelection operation /// </summary> public class GetBackupSelectionResponseUnmarshaller : 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) { GetBackupSelectionResponse response = new GetBackupSelectionResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlanId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupPlanId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupSelection", targetDepth)) { var unmarshaller = BackupSelectionUnmarshaller.Instance; response.BackupSelection = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreatorRequestId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CreatorRequestId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SelectionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SelectionId = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupSelectionResponseUnmarshaller _instance = new GetBackupSelectionResponseUnmarshaller(); internal static GetBackupSelectionResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupSelectionResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupVaultAccessPolicy Request Marshaller /// </summary> public class GetBackupVaultAccessPolicyRequestMarshaller : IMarshaller<IRequest, GetBackupVaultAccessPolicyRequest> , 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((GetBackupVaultAccessPolicyRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupVaultAccessPolicyRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}/access-policy"; return request; } private static GetBackupVaultAccessPolicyRequestMarshaller _instance = new GetBackupVaultAccessPolicyRequestMarshaller(); internal static GetBackupVaultAccessPolicyRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupVaultAccessPolicyRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupVaultAccessPolicy operation /// </summary> public class GetBackupVaultAccessPolicyResponseUnmarshaller : 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) { GetBackupVaultAccessPolicyResponse response = new GetBackupVaultAccessPolicyResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Policy", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Policy = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupVaultAccessPolicyResponseUnmarshaller _instance = new GetBackupVaultAccessPolicyResponseUnmarshaller(); internal static GetBackupVaultAccessPolicyResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupVaultAccessPolicyResponseUnmarshaller Instance { get { return _instance; } } } }
134
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetBackupVaultNotifications Request Marshaller /// </summary> public class GetBackupVaultNotificationsRequestMarshaller : IMarshaller<IRequest, GetBackupVaultNotificationsRequest> , 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((GetBackupVaultNotificationsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetBackupVaultNotificationsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); request.ResourcePath = "/backup-vaults/{backupVaultName}/notification-configuration"; return request; } private static GetBackupVaultNotificationsRequestMarshaller _instance = new GetBackupVaultNotificationsRequestMarshaller(); internal static GetBackupVaultNotificationsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupVaultNotificationsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetBackupVaultNotifications operation /// </summary> public class GetBackupVaultNotificationsResponseUnmarshaller : 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) { GetBackupVaultNotificationsResponse response = new GetBackupVaultNotificationsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultEvents", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.BackupVaultEvents = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("BackupVaultName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SNSTopicArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SNSTopicArn = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetBackupVaultNotificationsResponseUnmarshaller _instance = new GetBackupVaultNotificationsResponseUnmarshaller(); internal static GetBackupVaultNotificationsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetBackupVaultNotificationsResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetLegalHold Request Marshaller /// </summary> public class GetLegalHoldRequestMarshaller : IMarshaller<IRequest, GetLegalHoldRequest> , 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((GetLegalHoldRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetLegalHoldRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetLegalHoldId()) throw new AmazonBackupException("Request object does not have required field LegalHoldId set"); request.AddPathResource("{legalHoldId}", StringUtils.FromString(publicRequest.LegalHoldId)); request.ResourcePath = "/legal-holds/{legalHoldId}/"; return request; } private static GetLegalHoldRequestMarshaller _instance = new GetLegalHoldRequestMarshaller(); internal static GetLegalHoldRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetLegalHoldRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetLegalHold operation /// </summary> public class GetLegalHoldResponseUnmarshaller : 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) { GetLegalHoldResponse response = new GetLegalHoldResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CancelDescription", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CancelDescription = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CancellationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CancellationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LegalHoldArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LegalHoldArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LegalHoldId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LegalHoldId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPointSelection", targetDepth)) { var unmarshaller = RecoveryPointSelectionUnmarshaller.Instance; response.RecoveryPointSelection = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RetainRecordUntil", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.RetainRecordUntil = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Title", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Title = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetLegalHoldResponseUnmarshaller _instance = new GetLegalHoldResponseUnmarshaller(); internal static GetLegalHoldResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetLegalHoldResponseUnmarshaller Instance { get { return _instance; } } } }
176
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetRecoveryPointRestoreMetadata Request Marshaller /// </summary> public class GetRecoveryPointRestoreMetadataRequestMarshaller : IMarshaller<IRequest, GetRecoveryPointRestoreMetadataRequest> , 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((GetRecoveryPointRestoreMetadataRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetRecoveryPointRestoreMetadataRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (!publicRequest.IsSetRecoveryPointArn()) throw new AmazonBackupException("Request object does not have required field RecoveryPointArn set"); request.AddPathResource("{recoveryPointArn}", StringUtils.FromString(publicRequest.RecoveryPointArn)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/{recoveryPointArn}/restore-metadata"; return request; } private static GetRecoveryPointRestoreMetadataRequestMarshaller _instance = new GetRecoveryPointRestoreMetadataRequestMarshaller(); internal static GetRecoveryPointRestoreMetadataRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetRecoveryPointRestoreMetadataRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetRecoveryPointRestoreMetadata operation /// </summary> public class GetRecoveryPointRestoreMetadataResponseUnmarshaller : 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) { GetRecoveryPointRestoreMetadataResponse response = new GetRecoveryPointRestoreMetadataResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupVaultArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BackupVaultArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPointArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RecoveryPointArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RestoreMetadata", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.RestoreMetadata = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetRecoveryPointRestoreMetadataResponseUnmarshaller _instance = new GetRecoveryPointRestoreMetadataResponseUnmarshaller(); internal static GetRecoveryPointRestoreMetadataResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetRecoveryPointRestoreMetadataResponseUnmarshaller Instance { get { return _instance; } } } }
134
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// GetSupportedResourceTypes Request Marshaller /// </summary> public class GetSupportedResourceTypesRequestMarshaller : IMarshaller<IRequest, GetSupportedResourceTypesRequest> , 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((GetSupportedResourceTypesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(GetSupportedResourceTypesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; request.ResourcePath = "/supported-resource-types"; return request; } private static GetSupportedResourceTypesRequestMarshaller _instance = new GetSupportedResourceTypesRequestMarshaller(); internal static GetSupportedResourceTypesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetSupportedResourceTypesRequestMarshaller Instance { get { return _instance; } } } }
84
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for GetSupportedResourceTypes operation /// </summary> public class GetSupportedResourceTypesResponseUnmarshaller : 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) { GetSupportedResourceTypesResponse response = new GetSupportedResourceTypesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ResourceTypes", targetDepth)) { var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance); response.ResourceTypes = 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("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static GetSupportedResourceTypesResponseUnmarshaller _instance = new GetSupportedResourceTypesResponseUnmarshaller(); internal static GetSupportedResourceTypesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static GetSupportedResourceTypesResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for InvalidParameterValueException Object /// </summary> public class InvalidParameterValueExceptionUnmarshaller : IErrorResponseUnmarshaller<InvalidParameterValueException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public InvalidParameterValueException 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 InvalidParameterValueException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); InvalidParameterValueException unmarshalledObject = new InvalidParameterValueException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Context", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Context = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static InvalidParameterValueExceptionUnmarshaller _instance = new InvalidParameterValueExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InvalidParameterValueExceptionUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for InvalidRequestException Object /// </summary> public class InvalidRequestExceptionUnmarshaller : IErrorResponseUnmarshaller<InvalidRequestException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public InvalidRequestException 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 InvalidRequestException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); InvalidRequestException unmarshalledObject = new InvalidRequestException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Context", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Context = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static InvalidRequestExceptionUnmarshaller _instance = new InvalidRequestExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InvalidRequestExceptionUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for InvalidResourceStateException Object /// </summary> public class InvalidResourceStateExceptionUnmarshaller : IErrorResponseUnmarshaller<InvalidResourceStateException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public InvalidResourceStateException 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 InvalidResourceStateException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); InvalidResourceStateException unmarshalledObject = new InvalidResourceStateException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Context", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Context = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static InvalidResourceStateExceptionUnmarshaller _instance = new InvalidResourceStateExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static InvalidResourceStateExceptionUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for LegalHold Object /// </summary> public class LegalHoldUnmarshaller : IUnmarshaller<LegalHold, XmlUnmarshallerContext>, IUnmarshaller<LegalHold, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> LegalHold IUnmarshaller<LegalHold, 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 LegalHold Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; LegalHold unmarshalledObject = new LegalHold(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CancellationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CancellationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; unmarshalledObject.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LegalHoldArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.LegalHoldArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LegalHoldId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.LegalHoldId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Status = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Title", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Title = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static LegalHoldUnmarshaller _instance = new LegalHoldUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static LegalHoldUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Lifecycle Marshaller /// </summary> public class LifecycleMarshaller : IRequestMarshaller<Lifecycle, 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(Lifecycle requestObject, JsonMarshallerContext context) { if(requestObject.IsSetDeleteAfterDays()) { context.Writer.WritePropertyName("DeleteAfterDays"); context.Writer.Write(requestObject.DeleteAfterDays); } if(requestObject.IsSetMoveToColdStorageAfterDays()) { context.Writer.WritePropertyName("MoveToColdStorageAfterDays"); context.Writer.Write(requestObject.MoveToColdStorageAfterDays); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static LifecycleMarshaller Instance = new LifecycleMarshaller(); } }
68
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for Lifecycle Object /// </summary> public class LifecycleUnmarshaller : IUnmarshaller<Lifecycle, XmlUnmarshallerContext>, IUnmarshaller<Lifecycle, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> Lifecycle IUnmarshaller<Lifecycle, 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 Lifecycle Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; Lifecycle unmarshalledObject = new Lifecycle(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("DeleteAfterDays", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; unmarshalledObject.DeleteAfterDays = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MoveToColdStorageAfterDays", targetDepth)) { var unmarshaller = LongUnmarshaller.Instance; unmarshalledObject.MoveToColdStorageAfterDays = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static LifecycleUnmarshaller _instance = new LifecycleUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static LifecycleUnmarshaller Instance { get { return _instance; } } } }
98
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for LimitExceededException Object /// </summary> public class LimitExceededExceptionUnmarshaller : IErrorResponseUnmarshaller<LimitExceededException, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public LimitExceededException 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 LimitExceededException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse) { context.Read(); LimitExceededException unmarshalledObject = new LimitExceededException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Code", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Code = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Context", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Context = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.Type = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static LimitExceededExceptionUnmarshaller _instance = new LimitExceededExceptionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static LimitExceededExceptionUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupJobs Request Marshaller /// </summary> public class ListBackupJobsRequestMarshaller : IMarshaller<IRequest, ListBackupJobsRequest> , 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((ListBackupJobsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupJobsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetByAccountId()) request.Parameters.Add("accountId", StringUtils.FromString(publicRequest.ByAccountId)); if (publicRequest.IsSetByBackupVaultName()) request.Parameters.Add("backupVaultName", StringUtils.FromString(publicRequest.ByBackupVaultName)); if (publicRequest.IsSetByCompleteAfter()) request.Parameters.Add("completeAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCompleteAfter)); if (publicRequest.IsSetByCompleteBefore()) request.Parameters.Add("completeBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCompleteBefore)); if (publicRequest.IsSetByCreatedAfter()) request.Parameters.Add("createdAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedAfter)); if (publicRequest.IsSetByCreatedBefore()) request.Parameters.Add("createdBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedBefore)); if (publicRequest.IsSetByParentJobId()) request.Parameters.Add("parentJobId", StringUtils.FromString(publicRequest.ByParentJobId)); if (publicRequest.IsSetByResourceArn()) request.Parameters.Add("resourceArn", StringUtils.FromString(publicRequest.ByResourceArn)); if (publicRequest.IsSetByResourceType()) request.Parameters.Add("resourceType", StringUtils.FromString(publicRequest.ByResourceType)); if (publicRequest.IsSetByState()) request.Parameters.Add("state", StringUtils.FromString(publicRequest.ByState)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup-jobs/"; request.UseQueryString = true; return request; } private static ListBackupJobsRequestMarshaller _instance = new ListBackupJobsRequestMarshaller(); internal static ListBackupJobsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupJobsRequestMarshaller Instance { get { return _instance; } } } }
121
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupJobs operation /// </summary> public class ListBackupJobsResponseUnmarshaller : 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) { ListBackupJobsResponse response = new ListBackupJobsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupJobs", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupJob, BackupJobUnmarshaller>(BackupJobUnmarshaller.Instance); response.BackupJobs = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupJobsResponseUnmarshaller _instance = new ListBackupJobsResponseUnmarshaller(); internal static ListBackupJobsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupJobsResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupPlans Request Marshaller /// </summary> public class ListBackupPlansRequestMarshaller : IMarshaller<IRequest, ListBackupPlansRequest> , 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((ListBackupPlansRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupPlansRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetIncludeDeleted()) request.Parameters.Add("includeDeleted", StringUtils.FromBool(publicRequest.IncludeDeleted)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup/plans/"; request.UseQueryString = true; return request; } private static ListBackupPlansRequestMarshaller _instance = new ListBackupPlansRequestMarshaller(); internal static ListBackupPlansRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlansRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupPlans operation /// </summary> public class ListBackupPlansResponseUnmarshaller : 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) { ListBackupPlansResponse response = new ListBackupPlansResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlansList", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupPlansListMember, BackupPlansListMemberUnmarshaller>(BackupPlansListMemberUnmarshaller.Instance); response.BackupPlansList = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupPlansResponseUnmarshaller _instance = new ListBackupPlansResponseUnmarshaller(); internal static ListBackupPlansResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlansResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupPlanTemplates Request Marshaller /// </summary> public class ListBackupPlanTemplatesRequestMarshaller : IMarshaller<IRequest, ListBackupPlanTemplatesRequest> , 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((ListBackupPlanTemplatesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupPlanTemplatesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup/template/plans"; request.UseQueryString = true; return request; } private static ListBackupPlanTemplatesRequestMarshaller _instance = new ListBackupPlanTemplatesRequestMarshaller(); internal static ListBackupPlanTemplatesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlanTemplatesRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupPlanTemplates operation /// </summary> public class ListBackupPlanTemplatesResponseUnmarshaller : 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) { ListBackupPlanTemplatesResponse response = new ListBackupPlanTemplatesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlanTemplatesList", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupPlanTemplatesListMember, BackupPlanTemplatesListMemberUnmarshaller>(BackupPlanTemplatesListMemberUnmarshaller.Instance); response.BackupPlanTemplatesList = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupPlanTemplatesResponseUnmarshaller _instance = new ListBackupPlanTemplatesResponseUnmarshaller(); internal static ListBackupPlanTemplatesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlanTemplatesResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupPlanVersions Request Marshaller /// </summary> public class ListBackupPlanVersionsRequestMarshaller : IMarshaller<IRequest, ListBackupPlanVersionsRequest> , 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((ListBackupPlanVersionsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupPlanVersionsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanId()) throw new AmazonBackupException("Request object does not have required field BackupPlanId set"); request.AddPathResource("{backupPlanId}", StringUtils.FromString(publicRequest.BackupPlanId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup/plans/{backupPlanId}/versions/"; request.UseQueryString = true; return request; } private static ListBackupPlanVersionsRequestMarshaller _instance = new ListBackupPlanVersionsRequestMarshaller(); internal static ListBackupPlanVersionsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlanVersionsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupPlanVersions operation /// </summary> public class ListBackupPlanVersionsResponseUnmarshaller : 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) { ListBackupPlanVersionsResponse response = new ListBackupPlanVersionsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupPlanVersionsList", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupPlansListMember, BackupPlansListMemberUnmarshaller>(BackupPlansListMemberUnmarshaller.Instance); response.BackupPlanVersionsList = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupPlanVersionsResponseUnmarshaller _instance = new ListBackupPlanVersionsResponseUnmarshaller(); internal static ListBackupPlanVersionsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupPlanVersionsResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupSelections Request Marshaller /// </summary> public class ListBackupSelectionsRequestMarshaller : IMarshaller<IRequest, ListBackupSelectionsRequest> , 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((ListBackupSelectionsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupSelectionsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupPlanId()) throw new AmazonBackupException("Request object does not have required field BackupPlanId set"); request.AddPathResource("{backupPlanId}", StringUtils.FromString(publicRequest.BackupPlanId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup/plans/{backupPlanId}/selections/"; request.UseQueryString = true; return request; } private static ListBackupSelectionsRequestMarshaller _instance = new ListBackupSelectionsRequestMarshaller(); internal static ListBackupSelectionsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupSelectionsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupSelections operation /// </summary> public class ListBackupSelectionsResponseUnmarshaller : 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) { ListBackupSelectionsResponse response = new ListBackupSelectionsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupSelectionsList", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupSelectionsListMember, BackupSelectionsListMemberUnmarshaller>(BackupSelectionsListMemberUnmarshaller.Instance); response.BackupSelectionsList = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupSelectionsResponseUnmarshaller _instance = new ListBackupSelectionsResponseUnmarshaller(); internal static ListBackupSelectionsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupSelectionsResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListBackupVaults Request Marshaller /// </summary> public class ListBackupVaultsRequestMarshaller : IMarshaller<IRequest, ListBackupVaultsRequest> , 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((ListBackupVaultsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListBackupVaultsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup-vaults/"; request.UseQueryString = true; return request; } private static ListBackupVaultsRequestMarshaller _instance = new ListBackupVaultsRequestMarshaller(); internal static ListBackupVaultsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupVaultsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListBackupVaults operation /// </summary> public class ListBackupVaultsResponseUnmarshaller : 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) { ListBackupVaultsResponse response = new ListBackupVaultsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("BackupVaultList", targetDepth)) { var unmarshaller = new ListUnmarshaller<BackupVaultListMember, BackupVaultListMemberUnmarshaller>(BackupVaultListMemberUnmarshaller.Instance); response.BackupVaultList = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListBackupVaultsResponseUnmarshaller _instance = new ListBackupVaultsResponseUnmarshaller(); internal static ListBackupVaultsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListBackupVaultsResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListCopyJobs Request Marshaller /// </summary> public class ListCopyJobsRequestMarshaller : IMarshaller<IRequest, ListCopyJobsRequest> , 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((ListCopyJobsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListCopyJobsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetByAccountId()) request.Parameters.Add("accountId", StringUtils.FromString(publicRequest.ByAccountId)); if (publicRequest.IsSetByCompleteAfter()) request.Parameters.Add("completeAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCompleteAfter)); if (publicRequest.IsSetByCompleteBefore()) request.Parameters.Add("completeBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCompleteBefore)); if (publicRequest.IsSetByCreatedAfter()) request.Parameters.Add("createdAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedAfter)); if (publicRequest.IsSetByCreatedBefore()) request.Parameters.Add("createdBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedBefore)); if (publicRequest.IsSetByDestinationVaultArn()) request.Parameters.Add("destinationVaultArn", StringUtils.FromString(publicRequest.ByDestinationVaultArn)); if (publicRequest.IsSetByParentJobId()) request.Parameters.Add("parentJobId", StringUtils.FromString(publicRequest.ByParentJobId)); if (publicRequest.IsSetByResourceArn()) request.Parameters.Add("resourceArn", StringUtils.FromString(publicRequest.ByResourceArn)); if (publicRequest.IsSetByResourceType()) request.Parameters.Add("resourceType", StringUtils.FromString(publicRequest.ByResourceType)); if (publicRequest.IsSetByState()) request.Parameters.Add("state", StringUtils.FromString(publicRequest.ByState)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/copy-jobs/"; request.UseQueryString = true; return request; } private static ListCopyJobsRequestMarshaller _instance = new ListCopyJobsRequestMarshaller(); internal static ListCopyJobsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListCopyJobsRequestMarshaller Instance { get { return _instance; } } } }
121
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListCopyJobs operation /// </summary> public class ListCopyJobsResponseUnmarshaller : 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) { ListCopyJobsResponse response = new ListCopyJobsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CopyJobs", targetDepth)) { var unmarshaller = new ListUnmarshaller<CopyJob, CopyJobUnmarshaller>(CopyJobUnmarshaller.Instance); response.CopyJobs = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListCopyJobsResponseUnmarshaller _instance = new ListCopyJobsResponseUnmarshaller(); internal static ListCopyJobsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListCopyJobsResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListFrameworks Request Marshaller /// </summary> public class ListFrameworksRequestMarshaller : IMarshaller<IRequest, ListFrameworksRequest> , 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((ListFrameworksRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListFrameworksRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("MaxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("NextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/audit/frameworks"; request.UseQueryString = true; return request; } private static ListFrameworksRequestMarshaller _instance = new ListFrameworksRequestMarshaller(); internal static ListFrameworksRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListFrameworksRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListFrameworks operation /// </summary> public class ListFrameworksResponseUnmarshaller : 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) { ListFrameworksResponse response = new ListFrameworksResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Frameworks", targetDepth)) { var unmarshaller = new ListUnmarshaller<Framework, FrameworkUnmarshaller>(FrameworkUnmarshaller.Instance); response.Frameworks = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListFrameworksResponseUnmarshaller _instance = new ListFrameworksResponseUnmarshaller(); internal static ListFrameworksResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListFrameworksResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListLegalHolds Request Marshaller /// </summary> public class ListLegalHoldsRequestMarshaller : IMarshaller<IRequest, ListLegalHoldsRequest> , 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((ListLegalHoldsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListLegalHoldsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/legal-holds/"; request.UseQueryString = true; return request; } private static ListLegalHoldsRequestMarshaller _instance = new ListLegalHoldsRequestMarshaller(); internal static ListLegalHoldsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListLegalHoldsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListLegalHolds operation /// </summary> public class ListLegalHoldsResponseUnmarshaller : 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) { ListLegalHoldsResponse response = new ListLegalHoldsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("LegalHolds", targetDepth)) { var unmarshaller = new ListUnmarshaller<LegalHold, LegalHoldUnmarshaller>(LegalHoldUnmarshaller.Instance); response.LegalHolds = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListLegalHoldsResponseUnmarshaller _instance = new ListLegalHoldsResponseUnmarshaller(); internal static ListLegalHoldsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListLegalHoldsResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListProtectedResources Request Marshaller /// </summary> public class ListProtectedResourcesRequestMarshaller : IMarshaller<IRequest, ListProtectedResourcesRequest> , 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((ListProtectedResourcesRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListProtectedResourcesRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/resources/"; request.UseQueryString = true; return request; } private static ListProtectedResourcesRequestMarshaller _instance = new ListProtectedResourcesRequestMarshaller(); internal static ListProtectedResourcesRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListProtectedResourcesRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListProtectedResources operation /// </summary> public class ListProtectedResourcesResponseUnmarshaller : 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) { ListProtectedResourcesResponse response = new ListProtectedResourcesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Results", targetDepth)) { var unmarshaller = new ListUnmarshaller<ProtectedResource, ProtectedResourceUnmarshaller>(ProtectedResourceUnmarshaller.Instance); response.Results = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListProtectedResourcesResponseUnmarshaller _instance = new ListProtectedResourcesResponseUnmarshaller(); internal static ListProtectedResourcesResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListProtectedResourcesResponseUnmarshaller Instance { get { return _instance; } } } }
120
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListRecoveryPointsByBackupVault Request Marshaller /// </summary> public class ListRecoveryPointsByBackupVaultRequestMarshaller : IMarshaller<IRequest, ListRecoveryPointsByBackupVaultRequest> , 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((ListRecoveryPointsByBackupVaultRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListRecoveryPointsByBackupVaultRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetBackupVaultName()) throw new AmazonBackupException("Request object does not have required field BackupVaultName set"); request.AddPathResource("{backupVaultName}", StringUtils.FromString(publicRequest.BackupVaultName)); if (publicRequest.IsSetByBackupPlanId()) request.Parameters.Add("backupPlanId", StringUtils.FromString(publicRequest.ByBackupPlanId)); if (publicRequest.IsSetByCreatedAfter()) request.Parameters.Add("createdAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedAfter)); if (publicRequest.IsSetByCreatedBefore()) request.Parameters.Add("createdBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreatedBefore)); if (publicRequest.IsSetByParentRecoveryPointArn()) request.Parameters.Add("parentRecoveryPointArn", StringUtils.FromString(publicRequest.ByParentRecoveryPointArn)); if (publicRequest.IsSetByResourceArn()) request.Parameters.Add("resourceArn", StringUtils.FromString(publicRequest.ByResourceArn)); if (publicRequest.IsSetByResourceType()) request.Parameters.Add("resourceType", StringUtils.FromString(publicRequest.ByResourceType)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/backup-vaults/{backupVaultName}/recovery-points/"; request.UseQueryString = true; return request; } private static ListRecoveryPointsByBackupVaultRequestMarshaller _instance = new ListRecoveryPointsByBackupVaultRequestMarshaller(); internal static ListRecoveryPointsByBackupVaultRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByBackupVaultRequestMarshaller Instance { get { return _instance; } } } }
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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListRecoveryPointsByBackupVault operation /// </summary> public class ListRecoveryPointsByBackupVaultResponseUnmarshaller : 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) { ListRecoveryPointsByBackupVaultResponse response = new ListRecoveryPointsByBackupVaultResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPoints", targetDepth)) { var unmarshaller = new ListUnmarshaller<RecoveryPointByBackupVault, RecoveryPointByBackupVaultUnmarshaller>(RecoveryPointByBackupVaultUnmarshaller.Instance); response.RecoveryPoints = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListRecoveryPointsByBackupVaultResponseUnmarshaller _instance = new ListRecoveryPointsByBackupVaultResponseUnmarshaller(); internal static ListRecoveryPointsByBackupVaultResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByBackupVaultResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListRecoveryPointsByLegalHold Request Marshaller /// </summary> public class ListRecoveryPointsByLegalHoldRequestMarshaller : IMarshaller<IRequest, ListRecoveryPointsByLegalHoldRequest> , 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((ListRecoveryPointsByLegalHoldRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListRecoveryPointsByLegalHoldRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetLegalHoldId()) throw new AmazonBackupException("Request object does not have required field LegalHoldId set"); request.AddPathResource("{legalHoldId}", StringUtils.FromString(publicRequest.LegalHoldId)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/legal-holds/{legalHoldId}/recovery-points"; request.UseQueryString = true; return request; } private static ListRecoveryPointsByLegalHoldRequestMarshaller _instance = new ListRecoveryPointsByLegalHoldRequestMarshaller(); internal static ListRecoveryPointsByLegalHoldRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByLegalHoldRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListRecoveryPointsByLegalHold operation /// </summary> public class ListRecoveryPointsByLegalHoldResponseUnmarshaller : 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) { ListRecoveryPointsByLegalHoldResponse response = new ListRecoveryPointsByLegalHoldResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPoints", targetDepth)) { var unmarshaller = new ListUnmarshaller<RecoveryPointMember, RecoveryPointMemberUnmarshaller>(RecoveryPointMemberUnmarshaller.Instance); response.RecoveryPoints = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListRecoveryPointsByLegalHoldResponseUnmarshaller _instance = new ListRecoveryPointsByLegalHoldResponseUnmarshaller(); internal static ListRecoveryPointsByLegalHoldResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByLegalHoldResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListRecoveryPointsByResource Request Marshaller /// </summary> public class ListRecoveryPointsByResourceRequestMarshaller : IMarshaller<IRequest, ListRecoveryPointsByResourceRequest> , 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((ListRecoveryPointsByResourceRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListRecoveryPointsByResourceRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (!publicRequest.IsSetResourceArn()) throw new AmazonBackupException("Request object does not have required field ResourceArn set"); request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("maxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("nextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/resources/{resourceArn}/recovery-points/"; request.UseQueryString = true; return request; } private static ListRecoveryPointsByResourceRequestMarshaller _instance = new ListRecoveryPointsByResourceRequestMarshaller(); internal static ListRecoveryPointsByResourceRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByResourceRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListRecoveryPointsByResource operation /// </summary> public class ListRecoveryPointsByResourceResponseUnmarshaller : 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) { ListRecoveryPointsByResourceResponse response = new ListRecoveryPointsByResourceResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("RecoveryPoints", targetDepth)) { var unmarshaller = new ListUnmarshaller<RecoveryPointByResource, RecoveryPointByResourceUnmarshaller>(RecoveryPointByResourceUnmarshaller.Instance); response.RecoveryPoints = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("MissingParameterValueException")) { return MissingParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListRecoveryPointsByResourceResponseUnmarshaller _instance = new ListRecoveryPointsByResourceResponseUnmarshaller(); internal static ListRecoveryPointsByResourceResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListRecoveryPointsByResourceResponseUnmarshaller Instance { get { return _instance; } } } }
128
aws-sdk-net
aws
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListReportJobs Request Marshaller /// </summary> public class ListReportJobsRequestMarshaller : IMarshaller<IRequest, ListReportJobsRequest> , 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((ListReportJobsRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListReportJobsRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetByCreationAfter()) request.Parameters.Add("CreationAfter", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreationAfter)); if (publicRequest.IsSetByCreationBefore()) request.Parameters.Add("CreationBefore", StringUtils.FromDateTimeToISO8601(publicRequest.ByCreationBefore)); if (publicRequest.IsSetByReportPlanName()) request.Parameters.Add("ReportPlanName", StringUtils.FromString(publicRequest.ByReportPlanName)); if (publicRequest.IsSetByStatus()) request.Parameters.Add("Status", StringUtils.FromString(publicRequest.ByStatus)); if (publicRequest.IsSetMaxResults()) request.Parameters.Add("MaxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("NextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/audit/report-jobs"; request.UseQueryString = true; return request; } private static ListReportJobsRequestMarshaller _instance = new ListReportJobsRequestMarshaller(); internal static ListReportJobsRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListReportJobsRequestMarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListReportJobs operation /// </summary> public class ListReportJobsResponseUnmarshaller : 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) { ListReportJobsResponse response = new ListReportJobsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ReportJobs", targetDepth)) { var unmarshaller = new ListUnmarshaller<ReportJob, ReportJobUnmarshaller>(ReportJobUnmarshaller.Instance); response.ReportJobs = 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("InvalidParameterValueException")) { return InvalidParameterValueExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException")) { return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static ListReportJobsResponseUnmarshaller _instance = new ListReportJobsResponseUnmarshaller(); internal static ListReportJobsResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListReportJobsResponseUnmarshaller 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 backup-2018-11-15.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.Backup.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.Backup.Model.Internal.MarshallTransformations { /// <summary> /// ListReportPlans Request Marshaller /// </summary> public class ListReportPlansRequestMarshaller : IMarshaller<IRequest, ListReportPlansRequest> , 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((ListReportPlansRequest)input); } /// <summary> /// Marshaller the request object to the HTTP request. /// </summary> /// <param name="publicRequest"></param> /// <returns></returns> public IRequest Marshall(ListReportPlansRequest publicRequest) { IRequest request = new DefaultRequest(publicRequest, "Amazon.Backup"); request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-11-15"; request.HttpMethod = "GET"; if (publicRequest.IsSetMaxResults()) request.Parameters.Add("MaxResults", StringUtils.FromInt(publicRequest.MaxResults)); if (publicRequest.IsSetNextToken()) request.Parameters.Add("NextToken", StringUtils.FromString(publicRequest.NextToken)); request.ResourcePath = "/audit/report-plans"; request.UseQueryString = true; return request; } private static ListReportPlansRequestMarshaller _instance = new ListReportPlansRequestMarshaller(); internal static ListReportPlansRequestMarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListReportPlansRequestMarshaller Instance { get { return _instance; } } } }
91