PageRenderTime 80ms CodeModel.GetById 40ms RepoModel.GetById 0ms app.codeStats 0ms

/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateRouteResponseResult.java

https://github.com/aws/aws-sdk-java
Java | 389 lines | 154 code | 48 blank | 187 comment | 62 complexity | 98325e589a75094823d2f1dd8f4cabb1 MD5 | raw file
  1. /*
  2. * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
  5. * the License. A copy of the License is located at
  6. *
  7. * http://aws.amazon.com/apache2.0
  8. *
  9. * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  10. * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
  11. * and limitations under the License.
  12. */
  13. package com.amazonaws.services.apigatewayv2.model;
  14. import java.io.Serializable;
  15. import javax.annotation.Generated;
  16. @Generated("com.amazonaws:aws-java-sdk-code-generator")
  17. public class CreateRouteResponseResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
  18. /**
  19. * <p>
  20. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  21. * </p>
  22. */
  23. private String modelSelectionExpression;
  24. /**
  25. * <p>
  26. * Represents the response models of a route response.
  27. * </p>
  28. */
  29. private java.util.Map<String, String> responseModels;
  30. /**
  31. * <p>
  32. * Represents the response parameters of a route response.
  33. * </p>
  34. */
  35. private java.util.Map<String, ParameterConstraints> responseParameters;
  36. /**
  37. * <p>
  38. * Represents the identifier of a route response.
  39. * </p>
  40. */
  41. private String routeResponseId;
  42. /**
  43. * <p>
  44. * Represents the route response key of a route response.
  45. * </p>
  46. */
  47. private String routeResponseKey;
  48. /**
  49. * <p>
  50. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  51. * </p>
  52. *
  53. * @param modelSelectionExpression
  54. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  55. */
  56. public void setModelSelectionExpression(String modelSelectionExpression) {
  57. this.modelSelectionExpression = modelSelectionExpression;
  58. }
  59. /**
  60. * <p>
  61. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  62. * </p>
  63. *
  64. * @return Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  65. */
  66. public String getModelSelectionExpression() {
  67. return this.modelSelectionExpression;
  68. }
  69. /**
  70. * <p>
  71. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  72. * </p>
  73. *
  74. * @param modelSelectionExpression
  75. * Represents the model selection expression of a route response. Supported only for WebSocket APIs.
  76. * @return Returns a reference to this object so that method calls can be chained together.
  77. */
  78. public CreateRouteResponseResult withModelSelectionExpression(String modelSelectionExpression) {
  79. setModelSelectionExpression(modelSelectionExpression);
  80. return this;
  81. }
  82. /**
  83. * <p>
  84. * Represents the response models of a route response.
  85. * </p>
  86. *
  87. * @return Represents the response models of a route response.
  88. */
  89. public java.util.Map<String, String> getResponseModels() {
  90. return responseModels;
  91. }
  92. /**
  93. * <p>
  94. * Represents the response models of a route response.
  95. * </p>
  96. *
  97. * @param responseModels
  98. * Represents the response models of a route response.
  99. */
  100. public void setResponseModels(java.util.Map<String, String> responseModels) {
  101. this.responseModels = responseModels;
  102. }
  103. /**
  104. * <p>
  105. * Represents the response models of a route response.
  106. * </p>
  107. *
  108. * @param responseModels
  109. * Represents the response models of a route response.
  110. * @return Returns a reference to this object so that method calls can be chained together.
  111. */
  112. public CreateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
  113. setResponseModels(responseModels);
  114. return this;
  115. }
  116. /**
  117. * Add a single ResponseModels entry
  118. *
  119. * @see CreateRouteResponseResult#withResponseModels
  120. * @returns a reference to this object so that method calls can be chained together.
  121. */
  122. public CreateRouteResponseResult addResponseModelsEntry(String key, String value) {
  123. if (null == this.responseModels) {
  124. this.responseModels = new java.util.HashMap<String, String>();
  125. }
  126. if (this.responseModels.containsKey(key))
  127. throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
  128. this.responseModels.put(key, value);
  129. return this;
  130. }
  131. /**
  132. * Removes all the entries added into ResponseModels.
  133. *
  134. * @return Returns a reference to this object so that method calls can be chained together.
  135. */
  136. public CreateRouteResponseResult clearResponseModelsEntries() {
  137. this.responseModels = null;
  138. return this;
  139. }
  140. /**
  141. * <p>
  142. * Represents the response parameters of a route response.
  143. * </p>
  144. *
  145. * @return Represents the response parameters of a route response.
  146. */
  147. public java.util.Map<String, ParameterConstraints> getResponseParameters() {
  148. return responseParameters;
  149. }
  150. /**
  151. * <p>
  152. * Represents the response parameters of a route response.
  153. * </p>
  154. *
  155. * @param responseParameters
  156. * Represents the response parameters of a route response.
  157. */
  158. public void setResponseParameters(java.util.Map<String, ParameterConstraints> responseParameters) {
  159. this.responseParameters = responseParameters;
  160. }
  161. /**
  162. * <p>
  163. * Represents the response parameters of a route response.
  164. * </p>
  165. *
  166. * @param responseParameters
  167. * Represents the response parameters of a route response.
  168. * @return Returns a reference to this object so that method calls can be chained together.
  169. */
  170. public CreateRouteResponseResult withResponseParameters(java.util.Map<String, ParameterConstraints> responseParameters) {
  171. setResponseParameters(responseParameters);
  172. return this;
  173. }
  174. /**
  175. * Add a single ResponseParameters entry
  176. *
  177. * @see CreateRouteResponseResult#withResponseParameters
  178. * @returns a reference to this object so that method calls can be chained together.
  179. */
  180. public CreateRouteResponseResult addResponseParametersEntry(String key, ParameterConstraints value) {
  181. if (null == this.responseParameters) {
  182. this.responseParameters = new java.util.HashMap<String, ParameterConstraints>();
  183. }
  184. if (this.responseParameters.containsKey(key))
  185. throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
  186. this.responseParameters.put(key, value);
  187. return this;
  188. }
  189. /**
  190. * Removes all the entries added into ResponseParameters.
  191. *
  192. * @return Returns a reference to this object so that method calls can be chained together.
  193. */
  194. public CreateRouteResponseResult clearResponseParametersEntries() {
  195. this.responseParameters = null;
  196. return this;
  197. }
  198. /**
  199. * <p>
  200. * Represents the identifier of a route response.
  201. * </p>
  202. *
  203. * @param routeResponseId
  204. * Represents the identifier of a route response.
  205. */
  206. public void setRouteResponseId(String routeResponseId) {
  207. this.routeResponseId = routeResponseId;
  208. }
  209. /**
  210. * <p>
  211. * Represents the identifier of a route response.
  212. * </p>
  213. *
  214. * @return Represents the identifier of a route response.
  215. */
  216. public String getRouteResponseId() {
  217. return this.routeResponseId;
  218. }
  219. /**
  220. * <p>
  221. * Represents the identifier of a route response.
  222. * </p>
  223. *
  224. * @param routeResponseId
  225. * Represents the identifier of a route response.
  226. * @return Returns a reference to this object so that method calls can be chained together.
  227. */
  228. public CreateRouteResponseResult withRouteResponseId(String routeResponseId) {
  229. setRouteResponseId(routeResponseId);
  230. return this;
  231. }
  232. /**
  233. * <p>
  234. * Represents the route response key of a route response.
  235. * </p>
  236. *
  237. * @param routeResponseKey
  238. * Represents the route response key of a route response.
  239. */
  240. public void setRouteResponseKey(String routeResponseKey) {
  241. this.routeResponseKey = routeResponseKey;
  242. }
  243. /**
  244. * <p>
  245. * Represents the route response key of a route response.
  246. * </p>
  247. *
  248. * @return Represents the route response key of a route response.
  249. */
  250. public String getRouteResponseKey() {
  251. return this.routeResponseKey;
  252. }
  253. /**
  254. * <p>
  255. * Represents the route response key of a route response.
  256. * </p>
  257. *
  258. * @param routeResponseKey
  259. * Represents the route response key of a route response.
  260. * @return Returns a reference to this object so that method calls can be chained together.
  261. */
  262. public CreateRouteResponseResult withRouteResponseKey(String routeResponseKey) {
  263. setRouteResponseKey(routeResponseKey);
  264. return this;
  265. }
  266. /**
  267. * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
  268. * redacted from this string using a placeholder value.
  269. *
  270. * @return A string representation of this object.
  271. *
  272. * @see java.lang.Object#toString()
  273. */
  274. @Override
  275. public String toString() {
  276. StringBuilder sb = new StringBuilder();
  277. sb.append("{");
  278. if (getModelSelectionExpression() != null)
  279. sb.append("ModelSelectionExpression: ").append(getModelSelectionExpression()).append(",");
  280. if (getResponseModels() != null)
  281. sb.append("ResponseModels: ").append(getResponseModels()).append(",");
  282. if (getResponseParameters() != null)
  283. sb.append("ResponseParameters: ").append(getResponseParameters()).append(",");
  284. if (getRouteResponseId() != null)
  285. sb.append("RouteResponseId: ").append(getRouteResponseId()).append(",");
  286. if (getRouteResponseKey() != null)
  287. sb.append("RouteResponseKey: ").append(getRouteResponseKey());
  288. sb.append("}");
  289. return sb.toString();
  290. }
  291. @Override
  292. public boolean equals(Object obj) {
  293. if (this == obj)
  294. return true;
  295. if (obj == null)
  296. return false;
  297. if (obj instanceof CreateRouteResponseResult == false)
  298. return false;
  299. CreateRouteResponseResult other = (CreateRouteResponseResult) obj;
  300. if (other.getModelSelectionExpression() == null ^ this.getModelSelectionExpression() == null)
  301. return false;
  302. if (other.getModelSelectionExpression() != null && other.getModelSelectionExpression().equals(this.getModelSelectionExpression()) == false)
  303. return false;
  304. if (other.getResponseModels() == null ^ this.getResponseModels() == null)
  305. return false;
  306. if (other.getResponseModels() != null && other.getResponseModels().equals(this.getResponseModels()) == false)
  307. return false;
  308. if (other.getResponseParameters() == null ^ this.getResponseParameters() == null)
  309. return false;
  310. if (other.getResponseParameters() != null && other.getResponseParameters().equals(this.getResponseParameters()) == false)
  311. return false;
  312. if (other.getRouteResponseId() == null ^ this.getRouteResponseId() == null)
  313. return false;
  314. if (other.getRouteResponseId() != null && other.getRouteResponseId().equals(this.getRouteResponseId()) == false)
  315. return false;
  316. if (other.getRouteResponseKey() == null ^ this.getRouteResponseKey() == null)
  317. return false;
  318. if (other.getRouteResponseKey() != null && other.getRouteResponseKey().equals(this.getRouteResponseKey()) == false)
  319. return false;
  320. return true;
  321. }
  322. @Override
  323. public int hashCode() {
  324. final int prime = 31;
  325. int hashCode = 1;
  326. hashCode = prime * hashCode + ((getModelSelectionExpression() == null) ? 0 : getModelSelectionExpression().hashCode());
  327. hashCode = prime * hashCode + ((getResponseModels() == null) ? 0 : getResponseModels().hashCode());
  328. hashCode = prime * hashCode + ((getResponseParameters() == null) ? 0 : getResponseParameters().hashCode());
  329. hashCode = prime * hashCode + ((getRouteResponseId() == null) ? 0 : getRouteResponseId().hashCode());
  330. hashCode = prime * hashCode + ((getRouteResponseKey() == null) ? 0 : getRouteResponseKey().hashCode());
  331. return hashCode;
  332. }
  333. @Override
  334. public CreateRouteResponseResult clone() {
  335. try {
  336. return (CreateRouteResponseResult) super.clone();
  337. } catch (CloneNotSupportedException e) {
  338. throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
  339. }
  340. }
  341. }