PageRenderTime 23ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/sdk/src/Services/ElastiCache/Generated/Model/Internal/MarshallTransformations/CreateReplicationGroupRequestMarshaller.cs

https://gitlab.com/vectorci/aws-sdk-net
C# | 185 lines | 151 code | 4 blank | 30 comment | 26 complexity | c967182e814b409b271d877dced49441 MD5 | raw file
  1. /*
  2. * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. /*
  16. * Do not modify this file. This file is generated from the elasticache-2015-02-02.normal.json service model.
  17. */
  18. using System;
  19. using System.Collections.Generic;
  20. using System.Globalization;
  21. using System.IO;
  22. using System.Text;
  23. using System.Xml.Serialization;
  24. using Amazon.ElastiCache.Model;
  25. using Amazon.Runtime;
  26. using Amazon.Runtime.Internal;
  27. using Amazon.Runtime.Internal.Transform;
  28. using Amazon.Runtime.Internal.Util;
  29. namespace Amazon.ElastiCache.Model.Internal.MarshallTransformations
  30. {
  31. /// <summary>
  32. /// CreateReplicationGroup Request Marshaller
  33. /// </summary>
  34. public class CreateReplicationGroupRequestMarshaller : IMarshaller<IRequest, CreateReplicationGroupRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
  35. {
  36. /// <summary>
  37. /// Marshaller the request object to the HTTP request.
  38. /// </summary>
  39. /// <param name="input"></param>
  40. /// <returns></returns>
  41. public IRequest Marshall(AmazonWebServiceRequest input)
  42. {
  43. return this.Marshall((CreateReplicationGroupRequest)input);
  44. }
  45. /// <summary>
  46. /// Marshaller the request object to the HTTP request.
  47. /// </summary>
  48. /// <param name="publicRequest"></param>
  49. /// <returns></returns>
  50. public IRequest Marshall(CreateReplicationGroupRequest publicRequest)
  51. {
  52. IRequest request = new DefaultRequest(publicRequest, "Amazon.ElastiCache");
  53. request.Parameters.Add("Action", "CreateReplicationGroup");
  54. request.Parameters.Add("Version", "2015-02-02");
  55. if(publicRequest != null)
  56. {
  57. if(publicRequest.IsSetAutomaticFailoverEnabled())
  58. {
  59. request.Parameters.Add("AutomaticFailoverEnabled", StringUtils.FromBool(publicRequest.AutomaticFailoverEnabled));
  60. }
  61. if(publicRequest.IsSetAutoMinorVersionUpgrade())
  62. {
  63. request.Parameters.Add("AutoMinorVersionUpgrade", StringUtils.FromBool(publicRequest.AutoMinorVersionUpgrade));
  64. }
  65. if(publicRequest.IsSetCacheNodeType())
  66. {
  67. request.Parameters.Add("CacheNodeType", StringUtils.FromString(publicRequest.CacheNodeType));
  68. }
  69. if(publicRequest.IsSetCacheParameterGroupName())
  70. {
  71. request.Parameters.Add("CacheParameterGroupName", StringUtils.FromString(publicRequest.CacheParameterGroupName));
  72. }
  73. if(publicRequest.IsSetCacheSecurityGroupNames())
  74. {
  75. int publicRequestlistValueIndex = 1;
  76. foreach(var publicRequestlistValue in publicRequest.CacheSecurityGroupNames)
  77. {
  78. request.Parameters.Add("CacheSecurityGroupNames" + "." + "member" + "." + publicRequestlistValueIndex, StringUtils.FromString(publicRequestlistValue));
  79. publicRequestlistValueIndex++;
  80. }
  81. }
  82. if(publicRequest.IsSetCacheSubnetGroupName())
  83. {
  84. request.Parameters.Add("CacheSubnetGroupName", StringUtils.FromString(publicRequest.CacheSubnetGroupName));
  85. }
  86. if(publicRequest.IsSetEngine())
  87. {
  88. request.Parameters.Add("Engine", StringUtils.FromString(publicRequest.Engine));
  89. }
  90. if(publicRequest.IsSetEngineVersion())
  91. {
  92. request.Parameters.Add("EngineVersion", StringUtils.FromString(publicRequest.EngineVersion));
  93. }
  94. if(publicRequest.IsSetNotificationTopicArn())
  95. {
  96. request.Parameters.Add("NotificationTopicArn", StringUtils.FromString(publicRequest.NotificationTopicArn));
  97. }
  98. if(publicRequest.IsSetNumCacheClusters())
  99. {
  100. request.Parameters.Add("NumCacheClusters", StringUtils.FromInt(publicRequest.NumCacheClusters));
  101. }
  102. if(publicRequest.IsSetPort())
  103. {
  104. request.Parameters.Add("Port", StringUtils.FromInt(publicRequest.Port));
  105. }
  106. if(publicRequest.IsSetPreferredCacheClusterAZs())
  107. {
  108. int publicRequestlistValueIndex = 1;
  109. foreach(var publicRequestlistValue in publicRequest.PreferredCacheClusterAZs)
  110. {
  111. request.Parameters.Add("PreferredCacheClusterAZs" + "." + "member" + "." + publicRequestlistValueIndex, StringUtils.FromString(publicRequestlistValue));
  112. publicRequestlistValueIndex++;
  113. }
  114. }
  115. if(publicRequest.IsSetPreferredMaintenanceWindow())
  116. {
  117. request.Parameters.Add("PreferredMaintenanceWindow", StringUtils.FromString(publicRequest.PreferredMaintenanceWindow));
  118. }
  119. if(publicRequest.IsSetPrimaryClusterId())
  120. {
  121. request.Parameters.Add("PrimaryClusterId", StringUtils.FromString(publicRequest.PrimaryClusterId));
  122. }
  123. if(publicRequest.IsSetReplicationGroupDescription())
  124. {
  125. request.Parameters.Add("ReplicationGroupDescription", StringUtils.FromString(publicRequest.ReplicationGroupDescription));
  126. }
  127. if(publicRequest.IsSetReplicationGroupId())
  128. {
  129. request.Parameters.Add("ReplicationGroupId", StringUtils.FromString(publicRequest.ReplicationGroupId));
  130. }
  131. if(publicRequest.IsSetSecurityGroupIds())
  132. {
  133. int publicRequestlistValueIndex = 1;
  134. foreach(var publicRequestlistValue in publicRequest.SecurityGroupIds)
  135. {
  136. request.Parameters.Add("SecurityGroupIds" + "." + "member" + "." + publicRequestlistValueIndex, StringUtils.FromString(publicRequestlistValue));
  137. publicRequestlistValueIndex++;
  138. }
  139. }
  140. if(publicRequest.IsSetSnapshotArns())
  141. {
  142. int publicRequestlistValueIndex = 1;
  143. foreach(var publicRequestlistValue in publicRequest.SnapshotArns)
  144. {
  145. request.Parameters.Add("SnapshotArns" + "." + "member" + "." + publicRequestlistValueIndex, StringUtils.FromString(publicRequestlistValue));
  146. publicRequestlistValueIndex++;
  147. }
  148. }
  149. if(publicRequest.IsSetSnapshotName())
  150. {
  151. request.Parameters.Add("SnapshotName", StringUtils.FromString(publicRequest.SnapshotName));
  152. }
  153. if(publicRequest.IsSetSnapshotRetentionLimit())
  154. {
  155. request.Parameters.Add("SnapshotRetentionLimit", StringUtils.FromInt(publicRequest.SnapshotRetentionLimit));
  156. }
  157. if(publicRequest.IsSetSnapshotWindow())
  158. {
  159. request.Parameters.Add("SnapshotWindow", StringUtils.FromString(publicRequest.SnapshotWindow));
  160. }
  161. if(publicRequest.IsSetTags())
  162. {
  163. int publicRequestlistValueIndex = 1;
  164. foreach(var publicRequestlistValue in publicRequest.Tags)
  165. {
  166. if(publicRequestlistValue.IsSetKey())
  167. {
  168. request.Parameters.Add("Tags" + "." + "member" + "." + publicRequestlistValueIndex + "." + "Key", StringUtils.FromString(publicRequestlistValue.Key));
  169. }
  170. if(publicRequestlistValue.IsSetValue())
  171. {
  172. request.Parameters.Add("Tags" + "." + "member" + "." + publicRequestlistValueIndex + "." + "Value", StringUtils.FromString(publicRequestlistValue.Value));
  173. }
  174. publicRequestlistValueIndex++;
  175. }
  176. }
  177. }
  178. return request;
  179. }
  180. }
  181. }