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.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 ListReportPlans operation
/// </summary>
public class ListReportPlansResponseUnmarshaller : 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)
{
ListReportPlansResponse response = new ListReportPlansResponse();
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("ReportPlans", targetDepth))
{
var unmarshaller = new ListUnmarshaller<ReportPlan, ReportPlanUnmarshaller>(ReportPlanUnmarshaller.Instance);
response.ReportPlans = 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 ListReportPlansResponseUnmarshaller _instance = new ListReportPlansResponseUnmarshaller();
internal static ListReportPlansResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListReportPlansResponseUnmarshaller 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>
/// ListRestoreJobs Request Marshaller
/// </summary>
public class ListRestoreJobsRequestMarshaller : IMarshaller<IRequest, ListRestoreJobsRequest> , 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((ListRestoreJobsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListRestoreJobsRequest 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.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 = "/restore-jobs/";
request.UseQueryString = true;
return request;
}
private static ListRestoreJobsRequestMarshaller _instance = new ListRestoreJobsRequestMarshaller();
internal static ListRestoreJobsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListRestoreJobsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 109 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 ListRestoreJobs operation
/// </summary>
public class ListRestoreJobsResponseUnmarshaller : 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)
{
ListRestoreJobsResponse response = new ListRestoreJobsResponse();
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("RestoreJobs", targetDepth))
{
var unmarshaller = new ListUnmarshaller<RestoreJobsListMember, RestoreJobsListMemberUnmarshaller>(RestoreJobsListMemberUnmarshaller.Instance);
response.RestoreJobs = 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 ListRestoreJobsResponseUnmarshaller _instance = new ListRestoreJobsResponseUnmarshaller();
internal static ListRestoreJobsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListRestoreJobsResponseUnmarshaller 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>
/// ListTags Request Marshaller
/// </summary>
public class ListTagsRequestMarshaller : IMarshaller<IRequest, ListTagsRequest> , 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((ListTagsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(ListTagsRequest 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 = "/tags/{resourceArn}/";
request.UseQueryString = true;
return request;
}
private static ListTagsRequestMarshaller _instance = new ListTagsRequestMarshaller();
internal static ListTagsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListTagsRequestMarshaller 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 ListTags operation
/// </summary>
public class ListTagsResponseUnmarshaller : 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)
{
ListTagsResponse response = new ListTagsResponse();
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("Tags", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
response.Tags = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("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 ListTagsResponseUnmarshaller _instance = new ListTagsResponseUnmarshaller();
internal static ListTagsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static ListTagsResponseUnmarshaller 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.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 MissingParameterValueException Object
/// </summary>
public class MissingParameterValueExceptionUnmarshaller : IErrorResponseUnmarshaller<MissingParameterValueException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public MissingParameterValueException 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 MissingParameterValueException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
MissingParameterValueException unmarshalledObject = new MissingParameterValueException(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 MissingParameterValueExceptionUnmarshaller _instance = new MissingParameterValueExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static MissingParameterValueExceptionUnmarshaller 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 ProtectedResource Object
/// </summary>
public class ProtectedResourceUnmarshaller : IUnmarshaller<ProtectedResource, XmlUnmarshallerContext>, IUnmarshaller<ProtectedResource, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ProtectedResource IUnmarshaller<ProtectedResource, 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 ProtectedResource Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ProtectedResource unmarshalledObject = new ProtectedResource();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("LastBackupTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LastBackupTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceType = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ProtectedResourceUnmarshaller _instance = new ProtectedResourceUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ProtectedResourceUnmarshaller 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.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>
/// PutBackupVaultAccessPolicy Request Marshaller
/// </summary>
public class PutBackupVaultAccessPolicyRequestMarshaller : IMarshaller<IRequest, PutBackupVaultAccessPolicyRequest> , 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((PutBackupVaultAccessPolicyRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(PutBackupVaultAccessPolicyRequest 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 = "PUT";
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";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetPolicy())
{
context.Writer.WritePropertyName("Policy");
context.Writer.Write(publicRequest.Policy);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static PutBackupVaultAccessPolicyRequestMarshaller _instance = new PutBackupVaultAccessPolicyRequestMarshaller();
internal static PutBackupVaultAccessPolicyRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultAccessPolicyRequestMarshaller 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 PutBackupVaultAccessPolicy operation
/// </summary>
public class PutBackupVaultAccessPolicyResponseUnmarshaller : 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)
{
PutBackupVaultAccessPolicyResponse response = new PutBackupVaultAccessPolicyResponse();
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 PutBackupVaultAccessPolicyResponseUnmarshaller _instance = new PutBackupVaultAccessPolicyResponseUnmarshaller();
internal static PutBackupVaultAccessPolicyResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultAccessPolicyResponseUnmarshaller 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>
/// PutBackupVaultLockConfiguration Request Marshaller
/// </summary>
public class PutBackupVaultLockConfigurationRequestMarshaller : IMarshaller<IRequest, PutBackupVaultLockConfigurationRequest> , 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((PutBackupVaultLockConfigurationRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(PutBackupVaultLockConfigurationRequest 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 = "PUT";
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";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetChangeableForDays())
{
context.Writer.WritePropertyName("ChangeableForDays");
context.Writer.Write(publicRequest.ChangeableForDays);
}
if(publicRequest.IsSetMaxRetentionDays())
{
context.Writer.WritePropertyName("MaxRetentionDays");
context.Writer.Write(publicRequest.MaxRetentionDays);
}
if(publicRequest.IsSetMinRetentionDays())
{
context.Writer.WritePropertyName("MinRetentionDays");
context.Writer.Write(publicRequest.MinRetentionDays);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static PutBackupVaultLockConfigurationRequestMarshaller _instance = new PutBackupVaultLockConfigurationRequestMarshaller();
internal static PutBackupVaultLockConfigurationRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultLockConfigurationRequestMarshaller 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.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 PutBackupVaultLockConfiguration operation
/// </summary>
public class PutBackupVaultLockConfigurationResponseUnmarshaller : 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)
{
PutBackupVaultLockConfigurationResponse response = new PutBackupVaultLockConfigurationResponse();
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 PutBackupVaultLockConfigurationResponseUnmarshaller _instance = new PutBackupVaultLockConfigurationResponseUnmarshaller();
internal static PutBackupVaultLockConfigurationResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultLockConfigurationResponseUnmarshaller 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>
/// PutBackupVaultNotifications Request Marshaller
/// </summary>
public class PutBackupVaultNotificationsRequestMarshaller : IMarshaller<IRequest, PutBackupVaultNotificationsRequest> , 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((PutBackupVaultNotificationsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(PutBackupVaultNotificationsRequest 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 = "PUT";
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";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBackupVaultEvents())
{
context.Writer.WritePropertyName("BackupVaultEvents");
context.Writer.WriteArrayStart();
foreach(var publicRequestBackupVaultEventsListValue in publicRequest.BackupVaultEvents)
{
context.Writer.Write(publicRequestBackupVaultEventsListValue);
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetSNSTopicArn())
{
context.Writer.WritePropertyName("SNSTopicArn");
context.Writer.Write(publicRequest.SNSTopicArn);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static PutBackupVaultNotificationsRequestMarshaller _instance = new PutBackupVaultNotificationsRequestMarshaller();
internal static PutBackupVaultNotificationsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultNotificationsRequestMarshaller 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 PutBackupVaultNotifications operation
/// </summary>
public class PutBackupVaultNotificationsResponseUnmarshaller : 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)
{
PutBackupVaultNotificationsResponse response = new PutBackupVaultNotificationsResponse();
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 PutBackupVaultNotificationsResponseUnmarshaller _instance = new PutBackupVaultNotificationsResponseUnmarshaller();
internal static PutBackupVaultNotificationsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static PutBackupVaultNotificationsResponseUnmarshaller 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.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 RecoveryPointByBackupVault Object
/// </summary>
public class RecoveryPointByBackupVaultUnmarshaller : IUnmarshaller<RecoveryPointByBackupVault, XmlUnmarshallerContext>, IUnmarshaller<RecoveryPointByBackupVault, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RecoveryPointByBackupVault IUnmarshaller<RecoveryPointByBackupVault, 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 RecoveryPointByBackupVault Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RecoveryPointByBackupVault unmarshalledObject = new RecoveryPointByBackupVault();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("BackupSizeInBytes", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
unmarshalledObject.BackupSizeInBytes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupVaultArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupVaultArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupVaultName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupVaultName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CalculatedLifecycle", targetDepth))
{
var unmarshaller = CalculatedLifecycleUnmarshaller.Instance;
unmarshalledObject.CalculatedLifecycle = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CompletionDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CompletionDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CompositeMemberIdentifier", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CompositeMemberIdentifier = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreatedBy", targetDepth))
{
var unmarshaller = RecoveryPointCreatorUnmarshaller.Instance;
unmarshalledObject.CreatedBy = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreationDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("EncryptionKeyArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.EncryptionKeyArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IamRoleArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.IamRoleArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IsEncrypted", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.IsEncrypted = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IsParent", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.IsParent = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("LastRestoreTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LastRestoreTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Lifecycle", targetDepth))
{
var unmarshaller = LifecycleUnmarshaller.Instance;
unmarshalledObject.Lifecycle = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ParentRecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ParentRecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SourceBackupVaultArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.SourceBackupVaultArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("StatusMessage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusMessage = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RecoveryPointByBackupVaultUnmarshaller _instance = new RecoveryPointByBackupVaultUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RecoveryPointByBackupVaultUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 218 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 RecoveryPointByResource Object
/// </summary>
public class RecoveryPointByResourceUnmarshaller : IUnmarshaller<RecoveryPointByResource, XmlUnmarshallerContext>, IUnmarshaller<RecoveryPointByResource, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RecoveryPointByResource IUnmarshaller<RecoveryPointByResource, 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 RecoveryPointByResource Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RecoveryPointByResource unmarshalledObject = new RecoveryPointByResource();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("BackupSizeBytes", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
unmarshalledObject.BackupSizeBytes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupVaultName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupVaultName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreationDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("EncryptionKeyArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.EncryptionKeyArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IsParent", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
unmarshalledObject.IsParent = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ParentRecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ParentRecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("StatusMessage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusMessage = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RecoveryPointByResourceUnmarshaller _instance = new RecoveryPointByResourceUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RecoveryPointByResourceUnmarshaller 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.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 RecoveryPointCreator Object
/// </summary>
public class RecoveryPointCreatorUnmarshaller : IUnmarshaller<RecoveryPointCreator, XmlUnmarshallerContext>, IUnmarshaller<RecoveryPointCreator, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RecoveryPointCreator IUnmarshaller<RecoveryPointCreator, 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 RecoveryPointCreator Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RecoveryPointCreator unmarshalledObject = new RecoveryPointCreator();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("BackupPlanArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupPlanArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupPlanId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupPlanId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupPlanVersion", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupPlanVersion = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupRuleId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupRuleId = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RecoveryPointCreatorUnmarshaller _instance = new RecoveryPointCreatorUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RecoveryPointCreatorUnmarshaller 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 RecoveryPointMember Object
/// </summary>
public class RecoveryPointMemberUnmarshaller : IUnmarshaller<RecoveryPointMember, XmlUnmarshallerContext>, IUnmarshaller<RecoveryPointMember, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RecoveryPointMember IUnmarshaller<RecoveryPointMember, 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 RecoveryPointMember Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RecoveryPointMember unmarshalledObject = new RecoveryPointMember();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("BackupVaultName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.BackupVaultName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceType = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RecoveryPointMemberUnmarshaller _instance = new RecoveryPointMemberUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RecoveryPointMemberUnmarshaller 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.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>
/// RecoveryPointSelection Marshaller
/// </summary>
public class RecoveryPointSelectionMarshaller : IRequestMarshaller<RecoveryPointSelection, 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(RecoveryPointSelection requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetDateRange())
{
context.Writer.WritePropertyName("DateRange");
context.Writer.WriteObjectStart();
var marshaller = DateRangeMarshaller.Instance;
marshaller.Marshall(requestObject.DateRange, context);
context.Writer.WriteObjectEnd();
}
if(requestObject.IsSetResourceIdentifiers())
{
context.Writer.WritePropertyName("ResourceIdentifiers");
context.Writer.WriteArrayStart();
foreach(var requestObjectResourceIdentifiersListValue in requestObject.ResourceIdentifiers)
{
context.Writer.Write(requestObjectResourceIdentifiersListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetVaultNames())
{
context.Writer.WritePropertyName("VaultNames");
context.Writer.WriteArrayStart();
foreach(var requestObjectVaultNamesListValue in requestObject.VaultNames)
{
context.Writer.Write(requestObjectVaultNamesListValue);
}
context.Writer.WriteArrayEnd();
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static RecoveryPointSelectionMarshaller Instance = new RecoveryPointSelectionMarshaller();
}
} | 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 RecoveryPointSelection Object
/// </summary>
public class RecoveryPointSelectionUnmarshaller : IUnmarshaller<RecoveryPointSelection, XmlUnmarshallerContext>, IUnmarshaller<RecoveryPointSelection, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RecoveryPointSelection IUnmarshaller<RecoveryPointSelection, 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 RecoveryPointSelection Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RecoveryPointSelection unmarshalledObject = new RecoveryPointSelection();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("DateRange", targetDepth))
{
var unmarshaller = DateRangeUnmarshaller.Instance;
unmarshalledObject.DateRange = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceIdentifiers", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.ResourceIdentifiers = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("VaultNames", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.VaultNames = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RecoveryPointSelectionUnmarshaller _instance = new RecoveryPointSelectionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RecoveryPointSelectionUnmarshaller 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.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>
/// ReportDeliveryChannel Marshaller
/// </summary>
public class ReportDeliveryChannelMarshaller : IRequestMarshaller<ReportDeliveryChannel, 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(ReportDeliveryChannel requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetFormats())
{
context.Writer.WritePropertyName("Formats");
context.Writer.WriteArrayStart();
foreach(var requestObjectFormatsListValue in requestObject.Formats)
{
context.Writer.Write(requestObjectFormatsListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetS3BucketName())
{
context.Writer.WritePropertyName("S3BucketName");
context.Writer.Write(requestObject.S3BucketName);
}
if(requestObject.IsSetS3KeyPrefix())
{
context.Writer.WritePropertyName("S3KeyPrefix");
context.Writer.Write(requestObject.S3KeyPrefix);
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static ReportDeliveryChannelMarshaller Instance = new ReportDeliveryChannelMarshaller();
}
} | 79 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 ReportDeliveryChannel Object
/// </summary>
public class ReportDeliveryChannelUnmarshaller : IUnmarshaller<ReportDeliveryChannel, XmlUnmarshallerContext>, IUnmarshaller<ReportDeliveryChannel, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ReportDeliveryChannel IUnmarshaller<ReportDeliveryChannel, 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 ReportDeliveryChannel Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ReportDeliveryChannel unmarshalledObject = new ReportDeliveryChannel();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Formats", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.Formats = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("S3BucketName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.S3BucketName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("S3KeyPrefix", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.S3KeyPrefix = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ReportDeliveryChannelUnmarshaller _instance = new ReportDeliveryChannelUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ReportDeliveryChannelUnmarshaller 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 ReportDestination Object
/// </summary>
public class ReportDestinationUnmarshaller : IUnmarshaller<ReportDestination, XmlUnmarshallerContext>, IUnmarshaller<ReportDestination, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ReportDestination IUnmarshaller<ReportDestination, 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 ReportDestination Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ReportDestination unmarshalledObject = new ReportDestination();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("S3BucketName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.S3BucketName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("S3Keys", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.S3Keys = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ReportDestinationUnmarshaller _instance = new ReportDestinationUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ReportDestinationUnmarshaller 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 ReportJob Object
/// </summary>
public class ReportJobUnmarshaller : IUnmarshaller<ReportJob, XmlUnmarshallerContext>, IUnmarshaller<ReportJob, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ReportJob IUnmarshaller<ReportJob, 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 ReportJob Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ReportJob unmarshalledObject = new ReportJob();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("CompletionTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CompletionTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreationTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportDestination", targetDepth))
{
var unmarshaller = ReportDestinationUnmarshaller.Instance;
unmarshalledObject.ReportDestination = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportJobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportPlanArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportPlanArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportTemplate", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportTemplate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("StatusMessage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusMessage = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ReportJobUnmarshaller _instance = new ReportJobUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ReportJobUnmarshaller 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.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 ReportPlan Object
/// </summary>
public class ReportPlanUnmarshaller : IUnmarshaller<ReportPlan, XmlUnmarshallerContext>, IUnmarshaller<ReportPlan, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ReportPlan IUnmarshaller<ReportPlan, 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 ReportPlan Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ReportPlan unmarshalledObject = new ReportPlan();
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("LastAttemptedExecutionTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LastAttemptedExecutionTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("LastSuccessfulExecutionTime", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.LastSuccessfulExecutionTime = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportDeliveryChannel", targetDepth))
{
var unmarshaller = ReportDeliveryChannelUnmarshaller.Instance;
unmarshalledObject.ReportDeliveryChannel = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportPlanArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportPlanArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportPlanDescription", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportPlanDescription = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportPlanName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportPlanName = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportSetting", targetDepth))
{
var unmarshaller = ReportSettingUnmarshaller.Instance;
unmarshalledObject.ReportSetting = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ReportPlanUnmarshaller _instance = new ReportPlanUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ReportPlanUnmarshaller 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>
/// ReportSetting Marshaller
/// </summary>
public class ReportSettingMarshaller : IRequestMarshaller<ReportSetting, 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(ReportSetting requestObject, JsonMarshallerContext context)
{
if(requestObject.IsSetAccounts())
{
context.Writer.WritePropertyName("Accounts");
context.Writer.WriteArrayStart();
foreach(var requestObjectAccountsListValue in requestObject.Accounts)
{
context.Writer.Write(requestObjectAccountsListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetFrameworkArns())
{
context.Writer.WritePropertyName("FrameworkArns");
context.Writer.WriteArrayStart();
foreach(var requestObjectFrameworkArnsListValue in requestObject.FrameworkArns)
{
context.Writer.Write(requestObjectFrameworkArnsListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetNumberOfFrameworks())
{
context.Writer.WritePropertyName("NumberOfFrameworks");
context.Writer.Write(requestObject.NumberOfFrameworks);
}
if(requestObject.IsSetOrganizationUnits())
{
context.Writer.WritePropertyName("OrganizationUnits");
context.Writer.WriteArrayStart();
foreach(var requestObjectOrganizationUnitsListValue in requestObject.OrganizationUnits)
{
context.Writer.Write(requestObjectOrganizationUnitsListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetRegions())
{
context.Writer.WritePropertyName("Regions");
context.Writer.WriteArrayStart();
foreach(var requestObjectRegionsListValue in requestObject.Regions)
{
context.Writer.Write(requestObjectRegionsListValue);
}
context.Writer.WriteArrayEnd();
}
if(requestObject.IsSetReportTemplate())
{
context.Writer.WritePropertyName("ReportTemplate");
context.Writer.Write(requestObject.ReportTemplate);
}
}
/// <summary>
/// Singleton Marshaller.
/// </summary>
public readonly static ReportSettingMarshaller Instance = new ReportSettingMarshaller();
}
} | 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 ReportSetting Object
/// </summary>
public class ReportSettingUnmarshaller : IUnmarshaller<ReportSetting, XmlUnmarshallerContext>, IUnmarshaller<ReportSetting, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
ReportSetting IUnmarshaller<ReportSetting, 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 ReportSetting Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
ReportSetting unmarshalledObject = new ReportSetting();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Accounts", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.Accounts = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("FrameworkArns", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.FrameworkArns = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("NumberOfFrameworks", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.NumberOfFrameworks = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("OrganizationUnits", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.OrganizationUnits = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Regions", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
unmarshalledObject.Regions = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportTemplate", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ReportTemplate = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static ReportSettingUnmarshaller _instance = new ReportSettingUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ReportSettingUnmarshaller 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.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 ResourceNotFoundException Object
/// </summary>
public class ResourceNotFoundExceptionUnmarshaller : IErrorResponseUnmarshaller<ResourceNotFoundException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public ResourceNotFoundException 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 ResourceNotFoundException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
ResourceNotFoundException unmarshalledObject = new ResourceNotFoundException(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 ResourceNotFoundExceptionUnmarshaller _instance = new ResourceNotFoundExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ResourceNotFoundExceptionUnmarshaller 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 RestoreJobsListMember Object
/// </summary>
public class RestoreJobsListMemberUnmarshaller : IUnmarshaller<RestoreJobsListMember, XmlUnmarshallerContext>, IUnmarshaller<RestoreJobsListMember, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
RestoreJobsListMember IUnmarshaller<RestoreJobsListMember, 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 RestoreJobsListMember Unmarshall(JsonUnmarshallerContext context)
{
context.Read();
if (context.CurrentTokenType == JsonToken.Null)
return null;
RestoreJobsListMember unmarshalledObject = new RestoreJobsListMember();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("AccountId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.AccountId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("BackupSizeInBytes", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
unmarshalledObject.BackupSizeInBytes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CompletionDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CompletionDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreatedResourceArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.CreatedResourceArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
unmarshalledObject.CreationDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ExpectedCompletionTimeMinutes", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
unmarshalledObject.ExpectedCompletionTimeMinutes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IamRoleArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.IamRoleArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("PercentDone", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.PercentDone = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RecoveryPointArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ResourceType", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ResourceType = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RestoreJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.RestoreJobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Status", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.Status = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("StatusMessage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.StatusMessage = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
private static RestoreJobsListMemberUnmarshaller _instance = new RestoreJobsListMemberUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static RestoreJobsListMemberUnmarshaller 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.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 ServiceUnavailableException Object
/// </summary>
public class ServiceUnavailableExceptionUnmarshaller : IErrorResponseUnmarshaller<ServiceUnavailableException, JsonUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public ServiceUnavailableException 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 ServiceUnavailableException Unmarshall(JsonUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse errorResponse)
{
context.Read();
ServiceUnavailableException unmarshalledObject = new ServiceUnavailableException(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 ServiceUnavailableExceptionUnmarshaller _instance = new ServiceUnavailableExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static ServiceUnavailableExceptionUnmarshaller 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>
/// StartBackupJob Request Marshaller
/// </summary>
public class StartBackupJobRequestMarshaller : IMarshaller<IRequest, StartBackupJobRequest> , 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((StartBackupJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartBackupJobRequest 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 = "PUT";
request.ResourcePath = "/backup-jobs";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBackupOptions())
{
context.Writer.WritePropertyName("BackupOptions");
context.Writer.WriteObjectStart();
foreach (var publicRequestBackupOptionsKvp in publicRequest.BackupOptions)
{
context.Writer.WritePropertyName(publicRequestBackupOptionsKvp.Key);
var publicRequestBackupOptionsValue = publicRequestBackupOptionsKvp.Value;
context.Writer.Write(publicRequestBackupOptionsValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetBackupVaultName())
{
context.Writer.WritePropertyName("BackupVaultName");
context.Writer.Write(publicRequest.BackupVaultName);
}
if(publicRequest.IsSetCompleteWindowMinutes())
{
context.Writer.WritePropertyName("CompleteWindowMinutes");
context.Writer.Write(publicRequest.CompleteWindowMinutes);
}
if(publicRequest.IsSetIamRoleArn())
{
context.Writer.WritePropertyName("IamRoleArn");
context.Writer.Write(publicRequest.IamRoleArn);
}
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
if(publicRequest.IsSetLifecycle())
{
context.Writer.WritePropertyName("Lifecycle");
context.Writer.WriteObjectStart();
var marshaller = LifecycleMarshaller.Instance;
marshaller.Marshall(publicRequest.Lifecycle, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetRecoveryPointTags())
{
context.Writer.WritePropertyName("RecoveryPointTags");
context.Writer.WriteObjectStart();
foreach (var publicRequestRecoveryPointTagsKvp in publicRequest.RecoveryPointTags)
{
context.Writer.WritePropertyName(publicRequestRecoveryPointTagsKvp.Key);
var publicRequestRecoveryPointTagsValue = publicRequestRecoveryPointTagsKvp.Value;
context.Writer.Write(publicRequestRecoveryPointTagsValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetResourceArn())
{
context.Writer.WritePropertyName("ResourceArn");
context.Writer.Write(publicRequest.ResourceArn);
}
if(publicRequest.IsSetStartWindowMinutes())
{
context.Writer.WritePropertyName("StartWindowMinutes");
context.Writer.Write(publicRequest.StartWindowMinutes);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartBackupJobRequestMarshaller _instance = new StartBackupJobRequestMarshaller();
internal static StartBackupJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartBackupJobRequestMarshaller 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.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 StartBackupJob operation
/// </summary>
public class StartBackupJobResponseUnmarshaller : 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)
{
StartBackupJobResponse response = new StartBackupJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("BackupJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.BackupJobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
response.CreationDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IsParent", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
response.IsParent = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.RecoveryPointArn = 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("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 StartBackupJobResponseUnmarshaller _instance = new StartBackupJobResponseUnmarshaller();
internal static StartBackupJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartBackupJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 148 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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>
/// StartCopyJob Request Marshaller
/// </summary>
public class StartCopyJobRequestMarshaller : IMarshaller<IRequest, StartCopyJobRequest> , 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((StartCopyJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartCopyJobRequest 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 = "PUT";
request.ResourcePath = "/copy-jobs";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetDestinationBackupVaultArn())
{
context.Writer.WritePropertyName("DestinationBackupVaultArn");
context.Writer.Write(publicRequest.DestinationBackupVaultArn);
}
if(publicRequest.IsSetIamRoleArn())
{
context.Writer.WritePropertyName("IamRoleArn");
context.Writer.Write(publicRequest.IamRoleArn);
}
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
if(publicRequest.IsSetLifecycle())
{
context.Writer.WritePropertyName("Lifecycle");
context.Writer.WriteObjectStart();
var marshaller = LifecycleMarshaller.Instance;
marshaller.Marshall(publicRequest.Lifecycle, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetRecoveryPointArn())
{
context.Writer.WritePropertyName("RecoveryPointArn");
context.Writer.Write(publicRequest.RecoveryPointArn);
}
if(publicRequest.IsSetSourceBackupVaultName())
{
context.Writer.WritePropertyName("SourceBackupVaultName");
context.Writer.Write(publicRequest.SourceBackupVaultName);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartCopyJobRequestMarshaller _instance = new StartCopyJobRequestMarshaller();
internal static StartCopyJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartCopyJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 136 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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 StartCopyJob operation
/// </summary>
public class StartCopyJobResponseUnmarshaller : 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)
{
StartCopyJobResponse response = new StartCopyJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("CopyJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.CopyJobId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("CreationDate", targetDepth))
{
var unmarshaller = DateTimeUnmarshaller.Instance;
response.CreationDate = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("IsParent", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
response.IsParent = 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("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 StartCopyJobResponseUnmarshaller _instance = new StartCopyJobResponseUnmarshaller();
internal static StartCopyJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartCopyJobResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 142 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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>
/// StartReportJob Request Marshaller
/// </summary>
public class StartReportJobRequestMarshaller : IMarshaller<IRequest, StartReportJobRequest> , 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((StartReportJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartReportJobRequest 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.IsSetReportPlanName())
throw new AmazonBackupException("Request object does not have required field ReportPlanName set");
request.AddPathResource("{reportPlanName}", StringUtils.FromString(publicRequest.ReportPlanName));
request.ResourcePath = "/audit/report-jobs/{reportPlanName}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
else if(!(publicRequest.IsSetIdempotencyToken()))
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(Guid.NewGuid().ToString());
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartReportJobRequestMarshaller _instance = new StartReportJobRequestMarshaller();
internal static StartReportJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartReportJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 109 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 StartReportJob operation
/// </summary>
public class StartReportJobResponseUnmarshaller : 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)
{
StartReportJobResponse response = new StartReportJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("ReportJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ReportJobId = 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 StartReportJobResponseUnmarshaller _instance = new StartReportJobResponseUnmarshaller();
internal static StartReportJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartReportJobResponseUnmarshaller 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>
/// StartRestoreJob Request Marshaller
/// </summary>
public class StartRestoreJobRequestMarshaller : IMarshaller<IRequest, StartRestoreJobRequest> , 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((StartRestoreJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StartRestoreJobRequest 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 = "PUT";
request.ResourcePath = "/restore-jobs";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetCopySourceTagsToRestoredResource())
{
context.Writer.WritePropertyName("CopySourceTagsToRestoredResource");
context.Writer.Write(publicRequest.CopySourceTagsToRestoredResource);
}
if(publicRequest.IsSetIamRoleArn())
{
context.Writer.WritePropertyName("IamRoleArn");
context.Writer.Write(publicRequest.IamRoleArn);
}
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
if(publicRequest.IsSetMetadata())
{
context.Writer.WritePropertyName("Metadata");
context.Writer.WriteObjectStart();
foreach (var publicRequestMetadataKvp in publicRequest.Metadata)
{
context.Writer.WritePropertyName(publicRequestMetadataKvp.Key);
var publicRequestMetadataValue = publicRequestMetadataKvp.Value;
context.Writer.Write(publicRequestMetadataValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetRecoveryPointArn())
{
context.Writer.WritePropertyName("RecoveryPointArn");
context.Writer.Write(publicRequest.RecoveryPointArn);
}
if(publicRequest.IsSetResourceType())
{
context.Writer.WritePropertyName("ResourceType");
context.Writer.Write(publicRequest.ResourceType);
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static StartRestoreJobRequestMarshaller _instance = new StartRestoreJobRequestMarshaller();
internal static StartRestoreJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartRestoreJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 139 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 StartRestoreJob operation
/// </summary>
public class StartRestoreJobResponseUnmarshaller : 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)
{
StartRestoreJobResponse response = new StartRestoreJobResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("RestoreJobId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.RestoreJobId = 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("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 StartRestoreJobResponseUnmarshaller _instance = new StartRestoreJobResponseUnmarshaller();
internal static StartRestoreJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StartRestoreJobResponseUnmarshaller 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>
/// StopBackupJob Request Marshaller
/// </summary>
public class StopBackupJobRequestMarshaller : IMarshaller<IRequest, StopBackupJobRequest> , 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((StopBackupJobRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(StopBackupJobRequest 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.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 StopBackupJobRequestMarshaller _instance = new StopBackupJobRequestMarshaller();
internal static StopBackupJobRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StopBackupJobRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 88 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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 StopBackupJob operation
/// </summary>
public class StopBackupJobResponseUnmarshaller : 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)
{
StopBackupJobResponse response = new StopBackupJobResponse();
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 StopBackupJobResponseUnmarshaller _instance = new StopBackupJobResponseUnmarshaller();
internal static StopBackupJobResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static StopBackupJobResponseUnmarshaller 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>
/// TagResource Request Marshaller
/// </summary>
public class TagResourceRequestMarshaller : IMarshaller<IRequest, TagResourceRequest> , 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((TagResourceRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(TagResourceRequest 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.IsSetResourceArn())
throw new AmazonBackupException("Request object does not have required field ResourceArn set");
request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn));
request.ResourcePath = "/tags/{resourceArn}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetTags())
{
context.Writer.WritePropertyName("Tags");
context.Writer.WriteObjectStart();
foreach (var publicRequestTagsKvp in publicRequest.Tags)
{
context.Writer.WritePropertyName(publicRequestTagsKvp.Key);
var publicRequestTagsValue = publicRequestTagsKvp.Value;
context.Writer.Write(publicRequestTagsValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static TagResourceRequestMarshaller _instance = new TagResourceRequestMarshaller();
internal static TagResourceRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static TagResourceRequestMarshaller 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 TagResource operation
/// </summary>
public class TagResourceResponseUnmarshaller : 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)
{
TagResourceResponse response = new TagResourceResponse();
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("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("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 TagResourceResponseUnmarshaller _instance = new TagResourceResponseUnmarshaller();
internal static TagResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static TagResourceResponseUnmarshaller 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>
/// UntagResource Request Marshaller
/// </summary>
public class UntagResourceRequestMarshaller : IMarshaller<IRequest, UntagResourceRequest> , 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((UntagResourceRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UntagResourceRequest 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.IsSetResourceArn())
throw new AmazonBackupException("Request object does not have required field ResourceArn set");
request.AddPathResource("{resourceArn}", StringUtils.FromString(publicRequest.ResourceArn));
request.ResourcePath = "/untag/{resourceArn}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetTagKeyList())
{
context.Writer.WritePropertyName("TagKeyList");
context.Writer.WriteArrayStart();
foreach(var publicRequestTagKeyListListValue in publicRequest.TagKeyList)
{
context.Writer.Write(publicRequestTagKeyListListValue);
}
context.Writer.WriteArrayEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UntagResourceRequestMarshaller _instance = new UntagResourceRequestMarshaller();
internal static UntagResourceRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UntagResourceRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 109 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 UntagResource operation
/// </summary>
public class UntagResourceResponseUnmarshaller : 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)
{
UntagResourceResponse response = new UntagResourceResponse();
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 UntagResourceResponseUnmarshaller _instance = new UntagResourceResponseUnmarshaller();
internal static UntagResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UntagResourceResponseUnmarshaller 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>
/// UpdateBackupPlan Request Marshaller
/// </summary>
public class UpdateBackupPlanRequestMarshaller : IMarshaller<IRequest, UpdateBackupPlanRequest> , 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((UpdateBackupPlanRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateBackupPlanRequest 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.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}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetBackupPlan())
{
context.Writer.WritePropertyName("BackupPlan");
context.Writer.WriteObjectStart();
var marshaller = BackupPlanInputMarshaller.Instance;
marshaller.Marshall(publicRequest.BackupPlan, context);
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateBackupPlanRequestMarshaller _instance = new UpdateBackupPlanRequestMarshaller();
internal static UpdateBackupPlanRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateBackupPlanRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 109 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 UpdateBackupPlan operation
/// </summary>
public class UpdateBackupPlanResponseUnmarshaller : 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)
{
UpdateBackupPlanResponse response = new UpdateBackupPlanResponse();
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("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("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 UpdateBackupPlanResponseUnmarshaller _instance = new UpdateBackupPlanResponseUnmarshaller();
internal static UpdateBackupPlanResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateBackupPlanResponseUnmarshaller 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>
/// UpdateFramework Request Marshaller
/// </summary>
public class UpdateFrameworkRequestMarshaller : IMarshaller<IRequest, UpdateFrameworkRequest> , 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((UpdateFrameworkRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateFrameworkRequest 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 = "PUT";
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}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetFrameworkControls())
{
context.Writer.WritePropertyName("FrameworkControls");
context.Writer.WriteArrayStart();
foreach(var publicRequestFrameworkControlsListValue in publicRequest.FrameworkControls)
{
context.Writer.WriteObjectStart();
var marshaller = FrameworkControlMarshaller.Instance;
marshaller.Marshall(publicRequestFrameworkControlsListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetFrameworkDescription())
{
context.Writer.WritePropertyName("FrameworkDescription");
context.Writer.Write(publicRequest.FrameworkDescription);
}
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
else if(!(publicRequest.IsSetIdempotencyToken()))
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(Guid.NewGuid().ToString());
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateFrameworkRequestMarshaller _instance = new UpdateFrameworkRequestMarshaller();
internal static UpdateFrameworkRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateFrameworkRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 131 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 UpdateFramework operation
/// </summary>
public class UpdateFrameworkResponseUnmarshaller : 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)
{
UpdateFrameworkResponse response = new UpdateFrameworkResponse();
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("FrameworkArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.FrameworkArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("FrameworkName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.FrameworkName = 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("AlreadyExistsException"))
{
return AlreadyExistsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("ConflictException"))
{
return ConflictExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterValueException"))
{
return InvalidParameterValueExceptionUnmarshaller.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("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 UpdateFrameworkResponseUnmarshaller _instance = new UpdateFrameworkResponseUnmarshaller();
internal static UpdateFrameworkResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateFrameworkResponseUnmarshaller 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>
/// UpdateGlobalSettings Request Marshaller
/// </summary>
public class UpdateGlobalSettingsRequestMarshaller : IMarshaller<IRequest, UpdateGlobalSettingsRequest> , 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((UpdateGlobalSettingsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateGlobalSettingsRequest 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 = "PUT";
request.ResourcePath = "/global-settings";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetGlobalSettings())
{
context.Writer.WritePropertyName("GlobalSettings");
context.Writer.WriteObjectStart();
foreach (var publicRequestGlobalSettingsKvp in publicRequest.GlobalSettings)
{
context.Writer.WritePropertyName(publicRequestGlobalSettingsKvp.Key);
var publicRequestGlobalSettingsValue = publicRequestGlobalSettingsKvp.Value;
context.Writer.Write(publicRequestGlobalSettingsValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateGlobalSettingsRequestMarshaller _instance = new UpdateGlobalSettingsRequestMarshaller();
internal static UpdateGlobalSettingsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateGlobalSettingsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 109 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 UpdateGlobalSettings operation
/// </summary>
public class UpdateGlobalSettingsResponseUnmarshaller : 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)
{
UpdateGlobalSettingsResponse response = new UpdateGlobalSettingsResponse();
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("ServiceUnavailableException"))
{
return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonBackupException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UpdateGlobalSettingsResponseUnmarshaller _instance = new UpdateGlobalSettingsResponseUnmarshaller();
internal static UpdateGlobalSettingsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateGlobalSettingsResponseUnmarshaller 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>
/// UpdateRecoveryPointLifecycle Request Marshaller
/// </summary>
public class UpdateRecoveryPointLifecycleRequestMarshaller : IMarshaller<IRequest, UpdateRecoveryPointLifecycleRequest> , 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((UpdateRecoveryPointLifecycleRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateRecoveryPointLifecycleRequest 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}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetLifecycle())
{
context.Writer.WritePropertyName("Lifecycle");
context.Writer.WriteObjectStart();
var marshaller = LifecycleMarshaller.Instance;
marshaller.Marshall(publicRequest.Lifecycle, context);
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateRecoveryPointLifecycleRequestMarshaller _instance = new UpdateRecoveryPointLifecycleRequestMarshaller();
internal static UpdateRecoveryPointLifecycleRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateRecoveryPointLifecycleRequestMarshaller 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 UpdateRecoveryPointLifecycle operation
/// </summary>
public class UpdateRecoveryPointLifecycleResponseUnmarshaller : 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)
{
UpdateRecoveryPointLifecycleResponse response = new UpdateRecoveryPointLifecycleResponse();
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("CalculatedLifecycle", targetDepth))
{
var unmarshaller = CalculatedLifecycleUnmarshaller.Instance;
response.CalculatedLifecycle = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Lifecycle", targetDepth))
{
var unmarshaller = LifecycleUnmarshaller.Instance;
response.Lifecycle = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RecoveryPointArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.RecoveryPointArn = 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("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 UpdateRecoveryPointLifecycleResponseUnmarshaller _instance = new UpdateRecoveryPointLifecycleResponseUnmarshaller();
internal static UpdateRecoveryPointLifecycleResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateRecoveryPointLifecycleResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 144 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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>
/// UpdateRegionSettings Request Marshaller
/// </summary>
public class UpdateRegionSettingsRequestMarshaller : IMarshaller<IRequest, UpdateRegionSettingsRequest> , 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((UpdateRegionSettingsRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateRegionSettingsRequest 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 = "PUT";
request.ResourcePath = "/account-settings";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetResourceTypeManagementPreference())
{
context.Writer.WritePropertyName("ResourceTypeManagementPreference");
context.Writer.WriteObjectStart();
foreach (var publicRequestResourceTypeManagementPreferenceKvp in publicRequest.ResourceTypeManagementPreference)
{
context.Writer.WritePropertyName(publicRequestResourceTypeManagementPreferenceKvp.Key);
var publicRequestResourceTypeManagementPreferenceValue = publicRequestResourceTypeManagementPreferenceKvp.Value;
context.Writer.Write(publicRequestResourceTypeManagementPreferenceValue);
}
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetResourceTypeOptInPreference())
{
context.Writer.WritePropertyName("ResourceTypeOptInPreference");
context.Writer.WriteObjectStart();
foreach (var publicRequestResourceTypeOptInPreferenceKvp in publicRequest.ResourceTypeOptInPreference)
{
context.Writer.WritePropertyName(publicRequestResourceTypeOptInPreferenceKvp.Key);
var publicRequestResourceTypeOptInPreferenceValue = publicRequestResourceTypeOptInPreferenceKvp.Value;
context.Writer.Write(publicRequestResourceTypeOptInPreferenceValue);
}
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateRegionSettingsRequestMarshaller _instance = new UpdateRegionSettingsRequestMarshaller();
internal static UpdateRegionSettingsRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateRegionSettingsRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 123 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 UpdateRegionSettings operation
/// </summary>
public class UpdateRegionSettingsResponseUnmarshaller : 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)
{
UpdateRegionSettingsResponse response = new UpdateRegionSettingsResponse();
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 UpdateRegionSettingsResponseUnmarshaller _instance = new UpdateRegionSettingsResponseUnmarshaller();
internal static UpdateRegionSettingsResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateRegionSettingsResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 107 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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>
/// UpdateReportPlan Request Marshaller
/// </summary>
public class UpdateReportPlanRequestMarshaller : IMarshaller<IRequest, UpdateReportPlanRequest> , 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((UpdateReportPlanRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(UpdateReportPlanRequest 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 = "PUT";
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}";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetIdempotencyToken())
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(publicRequest.IdempotencyToken);
}
else if(!(publicRequest.IsSetIdempotencyToken()))
{
context.Writer.WritePropertyName("IdempotencyToken");
context.Writer.Write(Guid.NewGuid().ToString());
}
if(publicRequest.IsSetReportDeliveryChannel())
{
context.Writer.WritePropertyName("ReportDeliveryChannel");
context.Writer.WriteObjectStart();
var marshaller = ReportDeliveryChannelMarshaller.Instance;
marshaller.Marshall(publicRequest.ReportDeliveryChannel, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetReportPlanDescription())
{
context.Writer.WritePropertyName("ReportPlanDescription");
context.Writer.Write(publicRequest.ReportPlanDescription);
}
if(publicRequest.IsSetReportSetting())
{
context.Writer.WritePropertyName("ReportSetting");
context.Writer.WriteObjectStart();
var marshaller = ReportSettingMarshaller.Instance;
marshaller.Marshall(publicRequest.ReportSetting, context);
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static UpdateReportPlanRequestMarshaller _instance = new UpdateReportPlanRequestMarshaller();
internal static UpdateReportPlanRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateReportPlanRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 137 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the 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 UpdateReportPlan operation
/// </summary>
public class UpdateReportPlanResponseUnmarshaller : 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)
{
UpdateReportPlanResponse response = new UpdateReportPlanResponse();
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("ReportPlanArn", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ReportPlanArn = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ReportPlanName", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ReportPlanName = 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("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 UpdateReportPlanResponseUnmarshaller _instance = new UpdateReportPlanResponseUnmarshaller();
internal static UpdateReportPlanResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UpdateReportPlanResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 138 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginators for the Backup service
///</summary>
public class BackupPaginatorFactory : IBackupPaginatorFactory
{
private readonly IAmazonBackup client;
internal BackupPaginatorFactory(IAmazonBackup client)
{
this.client = client;
}
/// <summary>
/// Paginator for ListBackupJobs operation
///</summary>
public IListBackupJobsPaginator ListBackupJobs(ListBackupJobsRequest request)
{
return new ListBackupJobsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListBackupPlans operation
///</summary>
public IListBackupPlansPaginator ListBackupPlans(ListBackupPlansRequest request)
{
return new ListBackupPlansPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListBackupPlanTemplates operation
///</summary>
public IListBackupPlanTemplatesPaginator ListBackupPlanTemplates(ListBackupPlanTemplatesRequest request)
{
return new ListBackupPlanTemplatesPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListBackupPlanVersions operation
///</summary>
public IListBackupPlanVersionsPaginator ListBackupPlanVersions(ListBackupPlanVersionsRequest request)
{
return new ListBackupPlanVersionsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListBackupSelections operation
///</summary>
public IListBackupSelectionsPaginator ListBackupSelections(ListBackupSelectionsRequest request)
{
return new ListBackupSelectionsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListBackupVaults operation
///</summary>
public IListBackupVaultsPaginator ListBackupVaults(ListBackupVaultsRequest request)
{
return new ListBackupVaultsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListCopyJobs operation
///</summary>
public IListCopyJobsPaginator ListCopyJobs(ListCopyJobsRequest request)
{
return new ListCopyJobsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListFrameworks operation
///</summary>
public IListFrameworksPaginator ListFrameworks(ListFrameworksRequest request)
{
return new ListFrameworksPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListLegalHolds operation
///</summary>
public IListLegalHoldsPaginator ListLegalHolds(ListLegalHoldsRequest request)
{
return new ListLegalHoldsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListProtectedResources operation
///</summary>
public IListProtectedResourcesPaginator ListProtectedResources(ListProtectedResourcesRequest request)
{
return new ListProtectedResourcesPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListRecoveryPointsByBackupVault operation
///</summary>
public IListRecoveryPointsByBackupVaultPaginator ListRecoveryPointsByBackupVault(ListRecoveryPointsByBackupVaultRequest request)
{
return new ListRecoveryPointsByBackupVaultPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListRecoveryPointsByLegalHold operation
///</summary>
public IListRecoveryPointsByLegalHoldPaginator ListRecoveryPointsByLegalHold(ListRecoveryPointsByLegalHoldRequest request)
{
return new ListRecoveryPointsByLegalHoldPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListRecoveryPointsByResource operation
///</summary>
public IListRecoveryPointsByResourcePaginator ListRecoveryPointsByResource(ListRecoveryPointsByResourceRequest request)
{
return new ListRecoveryPointsByResourcePaginator(this.client, request);
}
/// <summary>
/// Paginator for ListReportJobs operation
///</summary>
public IListReportJobsPaginator ListReportJobs(ListReportJobsRequest request)
{
return new ListReportJobsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListReportPlans operation
///</summary>
public IListReportPlansPaginator ListReportPlans(ListReportPlansRequest request)
{
return new ListReportPlansPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListRestoreJobs operation
///</summary>
public IListRestoreJobsPaginator ListRestoreJobs(ListRestoreJobsRequest request)
{
return new ListRestoreJobsPaginator(this.client, request);
}
/// <summary>
/// Paginator for ListTags operation
///</summary>
public IListTagsPaginator ListTags(ListTagsRequest request)
{
return new ListTagsPaginator(this.client, request);
}
}
} | 174 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginators for the Backup service
///</summary>
public interface IBackupPaginatorFactory
{
/// <summary>
/// Paginator for ListBackupJobs operation
///</summary>
IListBackupJobsPaginator ListBackupJobs(ListBackupJobsRequest request);
/// <summary>
/// Paginator for ListBackupPlans operation
///</summary>
IListBackupPlansPaginator ListBackupPlans(ListBackupPlansRequest request);
/// <summary>
/// Paginator for ListBackupPlanTemplates operation
///</summary>
IListBackupPlanTemplatesPaginator ListBackupPlanTemplates(ListBackupPlanTemplatesRequest request);
/// <summary>
/// Paginator for ListBackupPlanVersions operation
///</summary>
IListBackupPlanVersionsPaginator ListBackupPlanVersions(ListBackupPlanVersionsRequest request);
/// <summary>
/// Paginator for ListBackupSelections operation
///</summary>
IListBackupSelectionsPaginator ListBackupSelections(ListBackupSelectionsRequest request);
/// <summary>
/// Paginator for ListBackupVaults operation
///</summary>
IListBackupVaultsPaginator ListBackupVaults(ListBackupVaultsRequest request);
/// <summary>
/// Paginator for ListCopyJobs operation
///</summary>
IListCopyJobsPaginator ListCopyJobs(ListCopyJobsRequest request);
/// <summary>
/// Paginator for ListFrameworks operation
///</summary>
IListFrameworksPaginator ListFrameworks(ListFrameworksRequest request);
/// <summary>
/// Paginator for ListLegalHolds operation
///</summary>
IListLegalHoldsPaginator ListLegalHolds(ListLegalHoldsRequest request);
/// <summary>
/// Paginator for ListProtectedResources operation
///</summary>
IListProtectedResourcesPaginator ListProtectedResources(ListProtectedResourcesRequest request);
/// <summary>
/// Paginator for ListRecoveryPointsByBackupVault operation
///</summary>
IListRecoveryPointsByBackupVaultPaginator ListRecoveryPointsByBackupVault(ListRecoveryPointsByBackupVaultRequest request);
/// <summary>
/// Paginator for ListRecoveryPointsByLegalHold operation
///</summary>
IListRecoveryPointsByLegalHoldPaginator ListRecoveryPointsByLegalHold(ListRecoveryPointsByLegalHoldRequest request);
/// <summary>
/// Paginator for ListRecoveryPointsByResource operation
///</summary>
IListRecoveryPointsByResourcePaginator ListRecoveryPointsByResource(ListRecoveryPointsByResourceRequest request);
/// <summary>
/// Paginator for ListReportJobs operation
///</summary>
IListReportJobsPaginator ListReportJobs(ListReportJobsRequest request);
/// <summary>
/// Paginator for ListReportPlans operation
///</summary>
IListReportPlansPaginator ListReportPlans(ListReportPlansRequest request);
/// <summary>
/// Paginator for ListRestoreJobs operation
///</summary>
IListRestoreJobsPaginator ListRestoreJobs(ListRestoreJobsRequest request);
/// <summary>
/// Paginator for ListTags operation
///</summary>
IListTagsPaginator ListTags(ListTagsRequest request);
}
} | 113 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupJobs operation
///</summary>
public interface IListBackupJobsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupJobsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupJobs
/// </summary>
IPaginatedEnumerable<BackupJob> BackupJobs { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupPlans operation
///</summary>
public interface IListBackupPlansPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupPlansResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupPlansList
/// </summary>
IPaginatedEnumerable<BackupPlansListMember> BackupPlansList { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupPlanTemplates operation
///</summary>
public interface IListBackupPlanTemplatesPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupPlanTemplatesResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupPlanTemplatesList
/// </summary>
IPaginatedEnumerable<BackupPlanTemplatesListMember> BackupPlanTemplatesList { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupPlanVersions operation
///</summary>
public interface IListBackupPlanVersionsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupPlanVersionsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupPlanVersionsList
/// </summary>
IPaginatedEnumerable<BackupPlansListMember> BackupPlanVersionsList { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupSelections operation
///</summary>
public interface IListBackupSelectionsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupSelectionsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupSelectionsList
/// </summary>
IPaginatedEnumerable<BackupSelectionsListMember> BackupSelectionsList { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListBackupVaults operation
///</summary>
public interface IListBackupVaultsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListBackupVaultsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the BackupVaultList
/// </summary>
IPaginatedEnumerable<BackupVaultListMember> BackupVaultList { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListCopyJobs operation
///</summary>
public interface IListCopyJobsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListCopyJobsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the CopyJobs
/// </summary>
IPaginatedEnumerable<CopyJob> CopyJobs { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListFrameworks operation
///</summary>
public interface IListFrameworksPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListFrameworksResponse> Responses { get; }
}
} | 33 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListLegalHolds operation
///</summary>
public interface IListLegalHoldsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListLegalHoldsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the LegalHolds
/// </summary>
IPaginatedEnumerable<LegalHold> LegalHolds { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListProtectedResources operation
///</summary>
public interface IListProtectedResourcesPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListProtectedResourcesResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the Results
/// </summary>
IPaginatedEnumerable<ProtectedResource> Results { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListRecoveryPointsByBackupVault operation
///</summary>
public interface IListRecoveryPointsByBackupVaultPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListRecoveryPointsByBackupVaultResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
IPaginatedEnumerable<RecoveryPointByBackupVault> RecoveryPoints { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListRecoveryPointsByLegalHold operation
///</summary>
public interface IListRecoveryPointsByLegalHoldPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListRecoveryPointsByLegalHoldResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
IPaginatedEnumerable<RecoveryPointMember> RecoveryPoints { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListRecoveryPointsByResource operation
///</summary>
public interface IListRecoveryPointsByResourcePaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListRecoveryPointsByResourceResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
IPaginatedEnumerable<RecoveryPointByResource> RecoveryPoints { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListReportJobs operation
///</summary>
public interface IListReportJobsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListReportJobsResponse> Responses { get; }
}
} | 33 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListReportPlans operation
///</summary>
public interface IListReportPlansPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListReportPlansResponse> Responses { get; }
}
} | 33 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListRestoreJobs operation
///</summary>
public interface IListRestoreJobsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListRestoreJobsResponse> Responses { get; }
/// <summary>
/// Enumerable containing all of the RestoreJobs
/// </summary>
IPaginatedEnumerable<RestoreJobsListMember> RestoreJobs { get; }
}
} | 38 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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 Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Paginator for the ListTags operation
///</summary>
public interface IListTagsPaginator
{
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
IPaginatedEnumerable<ListTagsResponse> Responses { get; }
}
} | 33 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupJobs paginators.
/// </summary>
internal sealed partial class ListBackupJobsPaginator : IPaginator<ListBackupJobsResponse>, IListBackupJobsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupJobsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupJobsResponse> Responses => new PaginatedResponse<ListBackupJobsResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupJobs
/// </summary>
public IPaginatedEnumerable<BackupJob> BackupJobs =>
new PaginatedResultKeyResponse<ListBackupJobsResponse, BackupJob>(this, (i) => i.BackupJobs);
internal ListBackupJobsPaginator(IAmazonBackup client, ListBackupJobsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupJobsResponse> IPaginator<ListBackupJobsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupJobsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupJobs(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupJobsResponse> IPaginator<ListBackupJobsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupJobsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupJobsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupPlans paginators.
/// </summary>
internal sealed partial class ListBackupPlansPaginator : IPaginator<ListBackupPlansResponse>, IListBackupPlansPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupPlansRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupPlansResponse> Responses => new PaginatedResponse<ListBackupPlansResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupPlansList
/// </summary>
public IPaginatedEnumerable<BackupPlansListMember> BackupPlansList =>
new PaginatedResultKeyResponse<ListBackupPlansResponse, BackupPlansListMember>(this, (i) => i.BackupPlansList);
internal ListBackupPlansPaginator(IAmazonBackup client, ListBackupPlansRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupPlansResponse> IPaginator<ListBackupPlansResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlansResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupPlans(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupPlansResponse> IPaginator<ListBackupPlansResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlansResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupPlansAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupPlanTemplates paginators.
/// </summary>
internal sealed partial class ListBackupPlanTemplatesPaginator : IPaginator<ListBackupPlanTemplatesResponse>, IListBackupPlanTemplatesPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupPlanTemplatesRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupPlanTemplatesResponse> Responses => new PaginatedResponse<ListBackupPlanTemplatesResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupPlanTemplatesList
/// </summary>
public IPaginatedEnumerable<BackupPlanTemplatesListMember> BackupPlanTemplatesList =>
new PaginatedResultKeyResponse<ListBackupPlanTemplatesResponse, BackupPlanTemplatesListMember>(this, (i) => i.BackupPlanTemplatesList);
internal ListBackupPlanTemplatesPaginator(IAmazonBackup client, ListBackupPlanTemplatesRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupPlanTemplatesResponse> IPaginator<ListBackupPlanTemplatesResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlanTemplatesResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupPlanTemplates(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupPlanTemplatesResponse> IPaginator<ListBackupPlanTemplatesResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlanTemplatesResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupPlanTemplatesAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupPlanVersions paginators.
/// </summary>
internal sealed partial class ListBackupPlanVersionsPaginator : IPaginator<ListBackupPlanVersionsResponse>, IListBackupPlanVersionsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupPlanVersionsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupPlanVersionsResponse> Responses => new PaginatedResponse<ListBackupPlanVersionsResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupPlanVersionsList
/// </summary>
public IPaginatedEnumerable<BackupPlansListMember> BackupPlanVersionsList =>
new PaginatedResultKeyResponse<ListBackupPlanVersionsResponse, BackupPlansListMember>(this, (i) => i.BackupPlanVersionsList);
internal ListBackupPlanVersionsPaginator(IAmazonBackup client, ListBackupPlanVersionsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupPlanVersionsResponse> IPaginator<ListBackupPlanVersionsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlanVersionsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupPlanVersions(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupPlanVersionsResponse> IPaginator<ListBackupPlanVersionsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupPlanVersionsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupPlanVersionsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupSelections paginators.
/// </summary>
internal sealed partial class ListBackupSelectionsPaginator : IPaginator<ListBackupSelectionsResponse>, IListBackupSelectionsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupSelectionsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupSelectionsResponse> Responses => new PaginatedResponse<ListBackupSelectionsResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupSelectionsList
/// </summary>
public IPaginatedEnumerable<BackupSelectionsListMember> BackupSelectionsList =>
new PaginatedResultKeyResponse<ListBackupSelectionsResponse, BackupSelectionsListMember>(this, (i) => i.BackupSelectionsList);
internal ListBackupSelectionsPaginator(IAmazonBackup client, ListBackupSelectionsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupSelectionsResponse> IPaginator<ListBackupSelectionsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupSelectionsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupSelections(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupSelectionsResponse> IPaginator<ListBackupSelectionsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupSelectionsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupSelectionsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListBackupVaults paginators.
/// </summary>
internal sealed partial class ListBackupVaultsPaginator : IPaginator<ListBackupVaultsResponse>, IListBackupVaultsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListBackupVaultsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListBackupVaultsResponse> Responses => new PaginatedResponse<ListBackupVaultsResponse>(this);
/// <summary>
/// Enumerable containing all of the BackupVaultList
/// </summary>
public IPaginatedEnumerable<BackupVaultListMember> BackupVaultList =>
new PaginatedResultKeyResponse<ListBackupVaultsResponse, BackupVaultListMember>(this, (i) => i.BackupVaultList);
internal ListBackupVaultsPaginator(IAmazonBackup client, ListBackupVaultsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListBackupVaultsResponse> IPaginator<ListBackupVaultsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupVaultsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListBackupVaults(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListBackupVaultsResponse> IPaginator<ListBackupVaultsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListBackupVaultsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListBackupVaultsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListCopyJobs paginators.
/// </summary>
internal sealed partial class ListCopyJobsPaginator : IPaginator<ListCopyJobsResponse>, IListCopyJobsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListCopyJobsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListCopyJobsResponse> Responses => new PaginatedResponse<ListCopyJobsResponse>(this);
/// <summary>
/// Enumerable containing all of the CopyJobs
/// </summary>
public IPaginatedEnumerable<CopyJob> CopyJobs =>
new PaginatedResultKeyResponse<ListCopyJobsResponse, CopyJob>(this, (i) => i.CopyJobs);
internal ListCopyJobsPaginator(IAmazonBackup client, ListCopyJobsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListCopyJobsResponse> IPaginator<ListCopyJobsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListCopyJobsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListCopyJobs(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListCopyJobsResponse> IPaginator<ListCopyJobsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListCopyJobsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListCopyJobsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListFrameworks paginators.
/// </summary>
internal sealed partial class ListFrameworksPaginator : IPaginator<ListFrameworksResponse>, IListFrameworksPaginator
{
private readonly IAmazonBackup _client;
private readonly ListFrameworksRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListFrameworksResponse> Responses => new PaginatedResponse<ListFrameworksResponse>(this);
internal ListFrameworksPaginator(IAmazonBackup client, ListFrameworksRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListFrameworksResponse> IPaginator<ListFrameworksResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListFrameworksResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListFrameworks(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListFrameworksResponse> IPaginator<ListFrameworksResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListFrameworksResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListFrameworksAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 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.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListLegalHolds paginators.
/// </summary>
internal sealed partial class ListLegalHoldsPaginator : IPaginator<ListLegalHoldsResponse>, IListLegalHoldsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListLegalHoldsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListLegalHoldsResponse> Responses => new PaginatedResponse<ListLegalHoldsResponse>(this);
/// <summary>
/// Enumerable containing all of the LegalHolds
/// </summary>
public IPaginatedEnumerable<LegalHold> LegalHolds =>
new PaginatedResultKeyResponse<ListLegalHoldsResponse, LegalHold>(this, (i) => i.LegalHolds);
internal ListLegalHoldsPaginator(IAmazonBackup client, ListLegalHoldsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListLegalHoldsResponse> IPaginator<ListLegalHoldsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListLegalHoldsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListLegalHolds(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListLegalHoldsResponse> IPaginator<ListLegalHoldsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListLegalHoldsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListLegalHoldsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListProtectedResources paginators.
/// </summary>
internal sealed partial class ListProtectedResourcesPaginator : IPaginator<ListProtectedResourcesResponse>, IListProtectedResourcesPaginator
{
private readonly IAmazonBackup _client;
private readonly ListProtectedResourcesRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListProtectedResourcesResponse> Responses => new PaginatedResponse<ListProtectedResourcesResponse>(this);
/// <summary>
/// Enumerable containing all of the Results
/// </summary>
public IPaginatedEnumerable<ProtectedResource> Results =>
new PaginatedResultKeyResponse<ListProtectedResourcesResponse, ProtectedResource>(this, (i) => i.Results);
internal ListProtectedResourcesPaginator(IAmazonBackup client, ListProtectedResourcesRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListProtectedResourcesResponse> IPaginator<ListProtectedResourcesResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListProtectedResourcesResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListProtectedResources(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListProtectedResourcesResponse> IPaginator<ListProtectedResourcesResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListProtectedResourcesResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListProtectedResourcesAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListRecoveryPointsByBackupVault paginators.
/// </summary>
internal sealed partial class ListRecoveryPointsByBackupVaultPaginator : IPaginator<ListRecoveryPointsByBackupVaultResponse>, IListRecoveryPointsByBackupVaultPaginator
{
private readonly IAmazonBackup _client;
private readonly ListRecoveryPointsByBackupVaultRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListRecoveryPointsByBackupVaultResponse> Responses => new PaginatedResponse<ListRecoveryPointsByBackupVaultResponse>(this);
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
public IPaginatedEnumerable<RecoveryPointByBackupVault> RecoveryPoints =>
new PaginatedResultKeyResponse<ListRecoveryPointsByBackupVaultResponse, RecoveryPointByBackupVault>(this, (i) => i.RecoveryPoints);
internal ListRecoveryPointsByBackupVaultPaginator(IAmazonBackup client, ListRecoveryPointsByBackupVaultRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListRecoveryPointsByBackupVaultResponse> IPaginator<ListRecoveryPointsByBackupVaultResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByBackupVaultResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListRecoveryPointsByBackupVault(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListRecoveryPointsByBackupVaultResponse> IPaginator<ListRecoveryPointsByBackupVaultResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByBackupVaultResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListRecoveryPointsByBackupVaultAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListRecoveryPointsByLegalHold paginators.
/// </summary>
internal sealed partial class ListRecoveryPointsByLegalHoldPaginator : IPaginator<ListRecoveryPointsByLegalHoldResponse>, IListRecoveryPointsByLegalHoldPaginator
{
private readonly IAmazonBackup _client;
private readonly ListRecoveryPointsByLegalHoldRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListRecoveryPointsByLegalHoldResponse> Responses => new PaginatedResponse<ListRecoveryPointsByLegalHoldResponse>(this);
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
public IPaginatedEnumerable<RecoveryPointMember> RecoveryPoints =>
new PaginatedResultKeyResponse<ListRecoveryPointsByLegalHoldResponse, RecoveryPointMember>(this, (i) => i.RecoveryPoints);
internal ListRecoveryPointsByLegalHoldPaginator(IAmazonBackup client, ListRecoveryPointsByLegalHoldRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListRecoveryPointsByLegalHoldResponse> IPaginator<ListRecoveryPointsByLegalHoldResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByLegalHoldResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListRecoveryPointsByLegalHold(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListRecoveryPointsByLegalHoldResponse> IPaginator<ListRecoveryPointsByLegalHoldResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByLegalHoldResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListRecoveryPointsByLegalHoldAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListRecoveryPointsByResource paginators.
/// </summary>
internal sealed partial class ListRecoveryPointsByResourcePaginator : IPaginator<ListRecoveryPointsByResourceResponse>, IListRecoveryPointsByResourcePaginator
{
private readonly IAmazonBackup _client;
private readonly ListRecoveryPointsByResourceRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListRecoveryPointsByResourceResponse> Responses => new PaginatedResponse<ListRecoveryPointsByResourceResponse>(this);
/// <summary>
/// Enumerable containing all of the RecoveryPoints
/// </summary>
public IPaginatedEnumerable<RecoveryPointByResource> RecoveryPoints =>
new PaginatedResultKeyResponse<ListRecoveryPointsByResourceResponse, RecoveryPointByResource>(this, (i) => i.RecoveryPoints);
internal ListRecoveryPointsByResourcePaginator(IAmazonBackup client, ListRecoveryPointsByResourceRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListRecoveryPointsByResourceResponse> IPaginator<ListRecoveryPointsByResourceResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByResourceResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListRecoveryPointsByResource(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListRecoveryPointsByResourceResponse> IPaginator<ListRecoveryPointsByResourceResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRecoveryPointsByResourceResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListRecoveryPointsByResourceAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListReportJobs paginators.
/// </summary>
internal sealed partial class ListReportJobsPaginator : IPaginator<ListReportJobsResponse>, IListReportJobsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListReportJobsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListReportJobsResponse> Responses => new PaginatedResponse<ListReportJobsResponse>(this);
internal ListReportJobsPaginator(IAmazonBackup client, ListReportJobsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListReportJobsResponse> IPaginator<ListReportJobsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListReportJobsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListReportJobs(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListReportJobsResponse> IPaginator<ListReportJobsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListReportJobsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListReportJobsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 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.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListReportPlans paginators.
/// </summary>
internal sealed partial class ListReportPlansPaginator : IPaginator<ListReportPlansResponse>, IListReportPlansPaginator
{
private readonly IAmazonBackup _client;
private readonly ListReportPlansRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListReportPlansResponse> Responses => new PaginatedResponse<ListReportPlansResponse>(this);
internal ListReportPlansPaginator(IAmazonBackup client, ListReportPlansRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListReportPlansResponse> IPaginator<ListReportPlansResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListReportPlansResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListReportPlans(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListReportPlansResponse> IPaginator<ListReportPlansResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListReportPlansResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListReportPlansAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 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.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListRestoreJobs paginators.
/// </summary>
internal sealed partial class ListRestoreJobsPaginator : IPaginator<ListRestoreJobsResponse>, IListRestoreJobsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListRestoreJobsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListRestoreJobsResponse> Responses => new PaginatedResponse<ListRestoreJobsResponse>(this);
/// <summary>
/// Enumerable containing all of the RestoreJobs
/// </summary>
public IPaginatedEnumerable<RestoreJobsListMember> RestoreJobs =>
new PaginatedResultKeyResponse<ListRestoreJobsResponse, RestoreJobsListMember>(this, (i) => i.RestoreJobs);
internal ListRestoreJobsPaginator(IAmazonBackup client, ListRestoreJobsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListRestoreJobsResponse> IPaginator<ListRestoreJobsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRestoreJobsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListRestoreJobs(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListRestoreJobsResponse> IPaginator<ListRestoreJobsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListRestoreJobsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListRestoreJobsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 97 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-2018-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using Amazon.Runtime;
namespace Amazon.Backup.Model
{
/// <summary>
/// Base class for ListTags paginators.
/// </summary>
internal sealed partial class ListTagsPaginator : IPaginator<ListTagsResponse>, IListTagsPaginator
{
private readonly IAmazonBackup _client;
private readonly ListTagsRequest _request;
private int _isPaginatorInUse = 0;
/// <summary>
/// Enumerable containing all full responses for the operation
/// </summary>
public IPaginatedEnumerable<ListTagsResponse> Responses => new PaginatedResponse<ListTagsResponse>(this);
internal ListTagsPaginator(IAmazonBackup client, ListTagsRequest request)
{
this._client = client;
this._request = request;
}
#if BCL
IEnumerable<ListTagsResponse> IPaginator<ListTagsResponse>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListTagsResponse response;
do
{
_request.NextToken = nextToken;
response = _client.ListTags(_request);
nextToken = response.NextToken;
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
#if AWS_ASYNC_ENUMERABLES_API
async IAsyncEnumerable<ListTagsResponse> IPaginator<ListTagsResponse>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance.");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
var nextToken = _request.NextToken;
ListTagsResponse response;
do
{
_request.NextToken = nextToken;
response = await _client.ListTagsAsync(_request, cancellationToken).ConfigureAwait(false);
nextToken = response.NextToken;
cancellationToken.ThrowIfCancellationRequested();
yield return response;
}
while (!string.IsNullOrEmpty(nextToken));
}
#endif
}
} | 91 |
aws-sdk-net | aws | C# | using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.Backup")]
#if BCL35
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Backup. AWS Backup is a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services in the cloud as well as on-premises.")]
#elif BCL45
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (4.5) - AWS Backup. AWS Backup is a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services in the cloud as well as on-premises.")]
#elif NETSTANDARD20
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 2.0) - AWS Backup. AWS Backup is a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services in the cloud as well as on-premises.")]
#elif NETCOREAPP3_1
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (.NET Core 3.1) - AWS Backup. AWS Backup is a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services in the cloud as well as on-premises.")]
#else
#error Unknown platform constant - unable to set correct AssemblyDescription
#endif
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.104.15")]
[assembly: System.CLSCompliant(true)]
#if BCL
[assembly: System.Security.AllowPartiallyTrustedCallers]
#endif | 51 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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-gateway-2021-01-01.normal.json service model.
*/
using System;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Util.Internal;
using Amazon.BackupGateway.Internal;
namespace Amazon.BackupGateway
{
/// <summary>
/// Configuration for accessing Amazon BackupGateway service
/// </summary>
[AWSSignerType("v4")]
public partial class AmazonBackupGatewayConfig : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("3.7.101.110");
private string _userAgent = UserAgentString;
/// <summary>
/// Default constructor
/// </summary>
public AmazonBackupGatewayConfig()
: base(new Amazon.Runtime.Internal.DefaultConfigurationProvider(AmazonBackupGatewayDefaultConfiguration.GetAllConfigurations()))
{
this.AuthenticationServiceName = "backup-gateway";
this.EndpointProvider = new AmazonBackupGatewayEndpointProvider();
}
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return "backup-gateway";
}
}
/// <summary>
/// Gets the ServiceVersion property.
/// </summary>
public override string ServiceVersion
{
get
{
return "2021-01-01";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
}
} | 83 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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-gateway-2021-01-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Amazon.Runtime;
namespace Amazon.BackupGateway
{
/// <summary>
/// Configuration for accessing Amazon BackupGateway service
/// </summary>
public static class AmazonBackupGatewayDefaultConfiguration
{
/// <summary>
/// Collection of all <see cref="DefaultConfiguration"/>s supported by
/// BackupGateway
/// </summary>
public static ReadOnlyCollection<IDefaultConfiguration> GetAllConfigurations()
{
return new ReadOnlyCollection<IDefaultConfiguration>(new List<IDefaultConfiguration>
{
Standard,
InRegion,
CrossRegion,
Mobile,
Auto,
Legacy
});
}
/// <summary>
/// <p>The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration Standard {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Standard,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:03.1
ConnectTimeout = TimeSpan.FromMilliseconds(3100L),
// 0:00:03.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(3100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration InRegion {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.InRegion,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:01.1
ConnectTimeout = TimeSpan.FromMilliseconds(1100L),
// 0:00:01.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(1100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration CrossRegion {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.CrossRegion,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:03.1
ConnectTimeout = TimeSpan.FromMilliseconds(3100L),
// 0:00:03.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(3100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration Mobile {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Mobile,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:30
ConnectTimeout = TimeSpan.FromMilliseconds(30000L),
// 0:00:30
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(30000L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.</p><p>Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">EC2 Instance Metadata service</a>, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application</p>
/// </summary>
public static IDefaultConfiguration Auto {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Auto,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:01.1
ConnectTimeout = TimeSpan.FromMilliseconds(1100L),
// 0:00:01.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(1100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode</p>
/// </summary>
public static IDefaultConfiguration Legacy {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Legacy,
RetryMode = RequestRetryMode.Legacy,
StsRegionalEndpoints = StsRegionalEndpointsValue.Legacy,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Legacy,
ConnectTimeout = null,
TlsNegotiationTimeout = null,
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
}
} | 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-gateway-2021-01-01.normal.json service model.
*/
using Amazon.Runtime;
using Amazon.Runtime.Endpoints;
namespace Amazon.BackupGateway.Endpoints
{
/// <summary>
/// Contains parameters used for resolving BackupGateway endpoints
/// Parameters can be sourced from client config and service operations
/// Used by internal BackupGatewayEndpointProvider and BackupGatewayEndpointResolver
/// Can be used by custom EndpointProvider, see ClientConfig.EndpointProvider
/// </summary>
public class BackupGatewayEndpointParameters : EndpointParameters
{
/// <summary>
/// BackupGatewayEndpointParameters constructor
/// </summary>
public BackupGatewayEndpointParameters()
{
UseDualStack = false;
UseFIPS = false;
}
/// <summary>
/// Region parameter
/// </summary>
public string Region
{
get { return (string)this["Region"]; }
set { this["Region"] = value; }
}
/// <summary>
/// UseDualStack parameter
/// </summary>
public bool? UseDualStack
{
get { return (bool?)this["UseDualStack"]; }
set { this["UseDualStack"] = value; }
}
/// <summary>
/// UseFIPS parameter
/// </summary>
public bool? UseFIPS
{
get { return (bool?)this["UseFIPS"]; }
set { this["UseFIPS"] = value; }
}
/// <summary>
/// Endpoint parameter
/// </summary>
public string Endpoint
{
get { return (string)this["Endpoint"]; }
set { this["Endpoint"] = value; }
}
}
} | 78 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the backup-gateway-2021-01-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using Amazon.Runtime;
namespace Amazon.BackupGateway
{
///<summary>
/// Common exception for the BackupGateway service.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class AmazonBackupGatewayException : AmazonServiceException
{
/// <summary>
/// Construct instance of AmazonBackupGatewayException
/// </summary>
/// <param name="message"></param>
public AmazonBackupGatewayException(string message)
: base(message)
{
}
/// <summary>
/// Construct instance of AmazonBackupGatewayException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public AmazonBackupGatewayException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Construct instance of AmazonBackupGatewayException
/// </summary>
/// <param name="innerException"></param>
public AmazonBackupGatewayException(Exception innerException)
: base(innerException.Message, innerException)
{
}
/// <summary>
/// Construct instance of AmazonBackupGatewayException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AmazonBackupGatewayException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode)
{
}
/// <summary>
/// Construct instance of AmazonBackupGatewayException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AmazonBackupGatewayException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode)
{
}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the AmazonBackupGatewayException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected AmazonBackupGatewayException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}
#endif
}
} | 105 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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-gateway-2021-01-01.normal.json service model.
*/
using System;
using Amazon.Runtime;
namespace Amazon.BackupGateway
{
/// <summary>
/// Constants used for properties of type GatewayType.
/// </summary>
public class GatewayType : ConstantClass
{
/// <summary>
/// Constant BACKUP_VM for GatewayType
/// </summary>
public static readonly GatewayType BACKUP_VM = new GatewayType("BACKUP_VM");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public GatewayType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static GatewayType FindValue(string value)
{
return FindValue<GatewayType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator GatewayType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type HypervisorState.
/// </summary>
public class HypervisorState : ConstantClass
{
/// <summary>
/// Constant ERROR for HypervisorState
/// </summary>
public static readonly HypervisorState ERROR = new HypervisorState("ERROR");
/// <summary>
/// Constant OFFLINE for HypervisorState
/// </summary>
public static readonly HypervisorState OFFLINE = new HypervisorState("OFFLINE");
/// <summary>
/// Constant ONLINE for HypervisorState
/// </summary>
public static readonly HypervisorState ONLINE = new HypervisorState("ONLINE");
/// <summary>
/// Constant PENDING for HypervisorState
/// </summary>
public static readonly HypervisorState PENDING = new HypervisorState("PENDING");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public HypervisorState(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static HypervisorState FindValue(string value)
{
return FindValue<HypervisorState>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator HypervisorState(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type SyncMetadataStatus.
/// </summary>
public class SyncMetadataStatus : ConstantClass
{
/// <summary>
/// Constant CREATED for SyncMetadataStatus
/// </summary>
public static readonly SyncMetadataStatus CREATED = new SyncMetadataStatus("CREATED");
/// <summary>
/// Constant FAILED for SyncMetadataStatus
/// </summary>
public static readonly SyncMetadataStatus FAILED = new SyncMetadataStatus("FAILED");
/// <summary>
/// Constant PARTIALLY_FAILED for SyncMetadataStatus
/// </summary>
public static readonly SyncMetadataStatus PARTIALLY_FAILED = new SyncMetadataStatus("PARTIALLY_FAILED");
/// <summary>
/// Constant RUNNING for SyncMetadataStatus
/// </summary>
public static readonly SyncMetadataStatus RUNNING = new SyncMetadataStatus("RUNNING");
/// <summary>
/// Constant SUCCEEDED for SyncMetadataStatus
/// </summary>
public static readonly SyncMetadataStatus SUCCEEDED = new SyncMetadataStatus("SUCCEEDED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public SyncMetadataStatus(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static SyncMetadataStatus FindValue(string value)
{
return FindValue<SyncMetadataStatus>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator SyncMetadataStatus(string value)
{
return FindValue(value);
}
}
} | 192 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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-gateway-2021-01-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Runtime;
using Amazon.Runtime.Endpoints;
using static Amazon.Runtime.Internal.Endpoints.StandardLibrary.Fn;
namespace Amazon.BackupGateway.Internal
{
/// <summary>
/// Amazon BackupGateway endpoint provider.
/// Resolves endpoint for given set of BackupGatewayEndpointParameters.
/// Can throw AmazonClientException if endpoint resolution is unsuccessful.
/// </summary>
public class AmazonBackupGatewayEndpointProvider : IEndpointProvider
{
/// <summary>
/// Resolve endpoint for BackupGatewayEndpointParameters
/// </summary>
public Endpoint ResolveEndpoint(EndpointParameters parameters)
{
if (parameters == null)
throw new ArgumentNullException("parameters");
if (parameters["Region"] == null)
throw new AmazonClientException("Region parameter must be set for endpoint resolution");
if (parameters["UseDualStack"] == null)
throw new AmazonClientException("UseDualStack parameter must be set for endpoint resolution");
if (parameters["UseFIPS"] == null)
throw new AmazonClientException("UseFIPS parameter must be set for endpoint resolution");
var refs = new Dictionary<string, object>()
{
["Region"] = parameters["Region"],
["UseDualStack"] = parameters["UseDualStack"],
["UseFIPS"] = parameters["UseFIPS"],
["Endpoint"] = parameters["Endpoint"],
};
if ((refs["PartitionResult"] = Partition((string)refs["Region"])) != null)
{
if (IsSet(refs["Endpoint"]))
{
if (Equals(refs["UseFIPS"], true))
{
throw new AmazonClientException("Invalid Configuration: FIPS and custom endpoint are not supported");
}
if (Equals(refs["UseDualStack"], true))
{
throw new AmazonClientException("Invalid Configuration: Dualstack and custom endpoint are not supported");
}
return new Endpoint((string)refs["Endpoint"], InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
if (Equals(refs["UseFIPS"], true) && Equals(refs["UseDualStack"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsFIPS")) && Equals(true, GetAttr(refs["PartitionResult"], "supportsDualStack")))
{
return new Endpoint(Interpolate(@"https://backup-gateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("FIPS and DualStack are enabled, but this partition does not support one or both");
}
if (Equals(refs["UseFIPS"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsFIPS")))
{
return new Endpoint(Interpolate(@"https://backup-gateway-fips.{Region}.{PartitionResult#dnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("FIPS is enabled but this partition does not support FIPS");
}
if (Equals(refs["UseDualStack"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsDualStack")))
{
return new Endpoint(Interpolate(@"https://backup-gateway.{Region}.{PartitionResult#dualStackDnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("DualStack is enabled but this partition does not support DualStack");
}
return new Endpoint(Interpolate(@"https://backup-gateway.{Region}.{PartitionResult#dnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("Cannot resolve endpoint");
}
}
} | 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-gateway-2021-01-01.normal.json service model.
*/
using System;
using Amazon.BackupGateway.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Endpoints;
using Amazon.Util;
using Amazon.BackupGateway.Endpoints;
#pragma warning disable 1591
namespace Amazon.BackupGateway.Internal
{
/// <summary>
/// Amazon BackupGateway endpoint resolver.
/// Custom PipelineHandler responsible for resolving endpoint and setting authentication parameters for BackupGateway service requests.
/// Collects values for BackupGatewayEndpointParameters and then tries to resolve endpoint by calling
/// ResolveEndpoint method on GlobalEndpoints.Provider if present, otherwise uses BackupGatewayEndpointProvider.
/// Responsible for setting authentication and http headers provided by resolved endpoint.
/// </summary>
public class AmazonBackupGatewayEndpointResolver : BaseEndpointResolver
{
protected override void ServiceSpecificHandler(IExecutionContext executionContext, EndpointParameters parameters)
{
InjectHostPrefix(executionContext.RequestContext);
}
protected override EndpointParameters MapEndpointsParameters(IRequestContext requestContext)
{
var config = (AmazonBackupGatewayConfig)requestContext.ClientConfig;
var result = new BackupGatewayEndpointParameters();
result.Region = config.RegionEndpoint?.SystemName;
result.UseDualStack = config.UseDualstackEndpoint;
result.UseFIPS = config.UseFIPSEndpoint;
result.Endpoint = config.ServiceURL;
// The region needs to be determined from the ServiceURL if not set.
var regionEndpoint = config.RegionEndpoint;
if (regionEndpoint == null && !string.IsNullOrEmpty(config.ServiceURL))
{
var regionName = AWSSDKUtils.DetermineRegion(config.ServiceURL);
result.Region = RegionEndpoint.GetBySystemName(regionName).SystemName;
}
// To support legacy endpoint overridding rules in the endpoints.json
if (result.Region == "us-east-1-regional")
{
result.Region = "us-east-1";
}
// Use AlternateEndpoint region override if set
if (requestContext.Request.AlternateEndpoint != null)
{
result.Region = requestContext.Request.AlternateEndpoint.SystemName;
}
// Assign staticContextParams and contextParam per operation
return result;
}
}
} | 83 |
aws-sdk-net | aws | C# | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See 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-gateway-2021-01-01.normal.json service model.
*/
using Amazon.Runtime.Internal;
namespace Amazon.BackupGateway.Internal
{
/// <summary>
/// Service metadata for Amazon BackupGateway service
/// </summary>
public partial class AmazonBackupGatewayMetadata : IServiceMetadata
{
/// <summary>
/// Gets the value of the Service Id.
/// </summary>
public string ServiceId
{
get
{
return "Backup Gateway";
}
}
/// <summary>
/// Gets the dictionary that gives mapping of renamed operations
/// </summary>
public System.Collections.Generic.IDictionary<string, string> OperationNameMapping
{
get
{
return new System.Collections.Generic.Dictionary<string, string>(0)
{
};
}
}
}
} | 55 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.