/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/UpdateApiKeyRequest.java

https://gitlab.com/github-cloud-corp/aws-sdk-java · Java · 235 lines · 95 code · 24 blank · 116 comment · 31 complexity · 339c394f3e7e144c481417c78036ee7c MD5 · raw file

  1. /*
  2. * Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"). You may not
  5. * use this file except in compliance with the License. A copy of the License is
  6. * located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed on
  11. * 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. package com.amazonaws.services.apigateway.model;
  16. import java.io.Serializable;
  17. import com.amazonaws.AmazonWebServiceRequest;
  18. /**
  19. * <p>
  20. * A request to change information about an <a>ApiKey</a> resource.
  21. * </p>
  22. */
  23. public class UpdateApiKeyRequest extends AmazonWebServiceRequest implements
  24. Serializable, Cloneable {
  25. /**
  26. * <p>
  27. * The identifier of the <a>ApiKey</a> resource to be updated.
  28. * </p>
  29. */
  30. private String apiKey;
  31. /**
  32. * <p>
  33. * A list of operations describing the updates to apply to the specified
  34. * resource. The patches are applied in the order specified in the list.
  35. * </p>
  36. */
  37. private java.util.List<PatchOperation> patchOperations;
  38. /**
  39. * <p>
  40. * The identifier of the <a>ApiKey</a> resource to be updated.
  41. * </p>
  42. *
  43. * @param apiKey
  44. * The identifier of the <a>ApiKey</a> resource to be updated.
  45. */
  46. public void setApiKey(String apiKey) {
  47. this.apiKey = apiKey;
  48. }
  49. /**
  50. * <p>
  51. * The identifier of the <a>ApiKey</a> resource to be updated.
  52. * </p>
  53. *
  54. * @return The identifier of the <a>ApiKey</a> resource to be updated.
  55. */
  56. public String getApiKey() {
  57. return this.apiKey;
  58. }
  59. /**
  60. * <p>
  61. * The identifier of the <a>ApiKey</a> resource to be updated.
  62. * </p>
  63. *
  64. * @param apiKey
  65. * The identifier of the <a>ApiKey</a> resource to be updated.
  66. * @return Returns a reference to this object so that method calls can be
  67. * chained together.
  68. */
  69. public UpdateApiKeyRequest withApiKey(String apiKey) {
  70. setApiKey(apiKey);
  71. return this;
  72. }
  73. /**
  74. * <p>
  75. * A list of operations describing the updates to apply to the specified
  76. * resource. The patches are applied in the order specified in the list.
  77. * </p>
  78. *
  79. * @return A list of operations describing the updates to apply to the
  80. * specified resource. The patches are applied in the order
  81. * specified in the list.
  82. */
  83. public java.util.List<PatchOperation> getPatchOperations() {
  84. return patchOperations;
  85. }
  86. /**
  87. * <p>
  88. * A list of operations describing the updates to apply to the specified
  89. * resource. The patches are applied in the order specified in the list.
  90. * </p>
  91. *
  92. * @param patchOperations
  93. * A list of operations describing the updates to apply to the
  94. * specified resource. The patches are applied in the order specified
  95. * in the list.
  96. */
  97. public void setPatchOperations(
  98. java.util.Collection<PatchOperation> patchOperations) {
  99. if (patchOperations == null) {
  100. this.patchOperations = null;
  101. return;
  102. }
  103. this.patchOperations = new java.util.ArrayList<PatchOperation>(
  104. patchOperations);
  105. }
  106. /**
  107. * <p>
  108. * A list of operations describing the updates to apply to the specified
  109. * resource. The patches are applied in the order specified in the list.
  110. * </p>
  111. * <p>
  112. * <b>NOTE:</b> This method appends the values to the existing list (if
  113. * any). Use {@link #setPatchOperations(java.util.Collection)} or
  114. * {@link #withPatchOperations(java.util.Collection)} if you want to
  115. * override the existing values.
  116. * </p>
  117. *
  118. * @param patchOperations
  119. * A list of operations describing the updates to apply to the
  120. * specified resource. The patches are applied in the order specified
  121. * in the list.
  122. * @return Returns a reference to this object so that method calls can be
  123. * chained together.
  124. */
  125. public UpdateApiKeyRequest withPatchOperations(
  126. PatchOperation... patchOperations) {
  127. if (this.patchOperations == null) {
  128. setPatchOperations(new java.util.ArrayList<PatchOperation>(
  129. patchOperations.length));
  130. }
  131. for (PatchOperation ele : patchOperations) {
  132. this.patchOperations.add(ele);
  133. }
  134. return this;
  135. }
  136. /**
  137. * <p>
  138. * A list of operations describing the updates to apply to the specified
  139. * resource. The patches are applied in the order specified in the list.
  140. * </p>
  141. *
  142. * @param patchOperations
  143. * A list of operations describing the updates to apply to the
  144. * specified resource. The patches are applied in the order specified
  145. * in the list.
  146. * @return Returns a reference to this object so that method calls can be
  147. * chained together.
  148. */
  149. public UpdateApiKeyRequest withPatchOperations(
  150. java.util.Collection<PatchOperation> patchOperations) {
  151. setPatchOperations(patchOperations);
  152. return this;
  153. }
  154. /**
  155. * Returns a string representation of this object; useful for testing and
  156. * debugging.
  157. *
  158. * @return A string representation of this object.
  159. *
  160. * @see java.lang.Object#toString()
  161. */
  162. @Override
  163. public String toString() {
  164. StringBuilder sb = new StringBuilder();
  165. sb.append("{");
  166. if (getApiKey() != null)
  167. sb.append("ApiKey: " + getApiKey() + ",");
  168. if (getPatchOperations() != null)
  169. sb.append("PatchOperations: " + getPatchOperations());
  170. sb.append("}");
  171. return sb.toString();
  172. }
  173. @Override
  174. public boolean equals(Object obj) {
  175. if (this == obj)
  176. return true;
  177. if (obj == null)
  178. return false;
  179. if (obj instanceof UpdateApiKeyRequest == false)
  180. return false;
  181. UpdateApiKeyRequest other = (UpdateApiKeyRequest) obj;
  182. if (other.getApiKey() == null ^ this.getApiKey() == null)
  183. return false;
  184. if (other.getApiKey() != null
  185. && other.getApiKey().equals(this.getApiKey()) == false)
  186. return false;
  187. if (other.getPatchOperations() == null
  188. ^ this.getPatchOperations() == null)
  189. return false;
  190. if (other.getPatchOperations() != null
  191. && other.getPatchOperations().equals(this.getPatchOperations()) == false)
  192. return false;
  193. return true;
  194. }
  195. @Override
  196. public int hashCode() {
  197. final int prime = 31;
  198. int hashCode = 1;
  199. hashCode = prime * hashCode
  200. + ((getApiKey() == null) ? 0 : getApiKey().hashCode());
  201. hashCode = prime
  202. * hashCode
  203. + ((getPatchOperations() == null) ? 0 : getPatchOperations()
  204. .hashCode());
  205. return hashCode;
  206. }
  207. @Override
  208. public UpdateApiKeyRequest clone() {
  209. return (UpdateApiKeyRequest) super.clone();
  210. }
  211. }