|
| 1 | +/* |
| 2 | + * Copyright 2010-2023 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 | +package com.amazonaws.services.iot.model; |
| 17 | + |
| 18 | +import java.io.Serializable; |
| 19 | + |
| 20 | +/** |
| 21 | + * <p> |
| 22 | + * An object that specifies the TLS configuration for a domain. |
| 23 | + * </p> |
| 24 | + */ |
| 25 | +public class TlsConfig implements Serializable { |
| 26 | + /** |
| 27 | + * <p> |
| 28 | + * The security policy for a domain configuration. For more information, see |
| 29 | + * <a href= |
| 30 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 31 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core developer |
| 32 | + * guide</i>. |
| 33 | + * </p> |
| 34 | + * <p> |
| 35 | + * <b>Constraints:</b><br/> |
| 36 | + * <b>Length: </b> - 128<br/> |
| 37 | + * <b>Pattern: </b>[\s\S]*<br/> |
| 38 | + */ |
| 39 | + private String securityPolicy; |
| 40 | + |
| 41 | + /** |
| 42 | + * <p> |
| 43 | + * The security policy for a domain configuration. For more information, see |
| 44 | + * <a href= |
| 45 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 46 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core developer |
| 47 | + * guide</i>. |
| 48 | + * </p> |
| 49 | + * <p> |
| 50 | + * <b>Constraints:</b><br/> |
| 51 | + * <b>Length: </b> - 128<br/> |
| 52 | + * <b>Pattern: </b>[\s\S]*<br/> |
| 53 | + * |
| 54 | + * @return <p> |
| 55 | + * The security policy for a domain configuration. For more |
| 56 | + * information, see <a href= |
| 57 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 58 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core |
| 59 | + * developer guide</i>. |
| 60 | + * </p> |
| 61 | + */ |
| 62 | + public String getSecurityPolicy() { |
| 63 | + return securityPolicy; |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * <p> |
| 68 | + * The security policy for a domain configuration. For more information, see |
| 69 | + * <a href= |
| 70 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 71 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core developer |
| 72 | + * guide</i>. |
| 73 | + * </p> |
| 74 | + * <p> |
| 75 | + * <b>Constraints:</b><br/> |
| 76 | + * <b>Length: </b> - 128<br/> |
| 77 | + * <b>Pattern: </b>[\s\S]*<br/> |
| 78 | + * |
| 79 | + * @param securityPolicy <p> |
| 80 | + * The security policy for a domain configuration. For more |
| 81 | + * information, see <a href= |
| 82 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 83 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core |
| 84 | + * developer guide</i>. |
| 85 | + * </p> |
| 86 | + */ |
| 87 | + public void setSecurityPolicy(String securityPolicy) { |
| 88 | + this.securityPolicy = securityPolicy; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * <p> |
| 93 | + * The security policy for a domain configuration. For more information, see |
| 94 | + * <a href= |
| 95 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 96 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core developer |
| 97 | + * guide</i>. |
| 98 | + * </p> |
| 99 | + * <p> |
| 100 | + * Returns a reference to this object so that method calls can be chained |
| 101 | + * together. |
| 102 | + * <p> |
| 103 | + * <b>Constraints:</b><br/> |
| 104 | + * <b>Length: </b> - 128<br/> |
| 105 | + * <b>Pattern: </b>[\s\S]*<br/> |
| 106 | + * |
| 107 | + * @param securityPolicy <p> |
| 108 | + * The security policy for a domain configuration. For more |
| 109 | + * information, see <a href= |
| 110 | + * "https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html#tls-policy-table" |
| 111 | + * >Security policies </a> in the <i>Amazon Web Services IoT Core |
| 112 | + * developer guide</i>. |
| 113 | + * </p> |
| 114 | + * @return A reference to this updated object so that method calls can be |
| 115 | + * chained together. |
| 116 | + */ |
| 117 | + public TlsConfig withSecurityPolicy(String securityPolicy) { |
| 118 | + this.securityPolicy = securityPolicy; |
| 119 | + return this; |
| 120 | + } |
| 121 | + |
| 122 | + /** |
| 123 | + * Returns a string representation of this object; useful for testing and |
| 124 | + * debugging. |
| 125 | + * |
| 126 | + * @return A string representation of this object. |
| 127 | + * @see java.lang.Object#toString() |
| 128 | + */ |
| 129 | + @Override |
| 130 | + public String toString() { |
| 131 | + StringBuilder sb = new StringBuilder(); |
| 132 | + sb.append("{"); |
| 133 | + if (getSecurityPolicy() != null) |
| 134 | + sb.append("securityPolicy: " + getSecurityPolicy()); |
| 135 | + sb.append("}"); |
| 136 | + return sb.toString(); |
| 137 | + } |
| 138 | + |
| 139 | + @Override |
| 140 | + public int hashCode() { |
| 141 | + final int prime = 31; |
| 142 | + int hashCode = 1; |
| 143 | + |
| 144 | + hashCode = prime * hashCode |
| 145 | + + ((getSecurityPolicy() == null) ? 0 : getSecurityPolicy().hashCode()); |
| 146 | + return hashCode; |
| 147 | + } |
| 148 | + |
| 149 | + @Override |
| 150 | + public boolean equals(Object obj) { |
| 151 | + if (this == obj) |
| 152 | + return true; |
| 153 | + if (obj == null) |
| 154 | + return false; |
| 155 | + |
| 156 | + if (obj instanceof TlsConfig == false) |
| 157 | + return false; |
| 158 | + TlsConfig other = (TlsConfig) obj; |
| 159 | + |
| 160 | + if (other.getSecurityPolicy() == null ^ this.getSecurityPolicy() == null) |
| 161 | + return false; |
| 162 | + if (other.getSecurityPolicy() != null |
| 163 | + && other.getSecurityPolicy().equals(this.getSecurityPolicy()) == false) |
| 164 | + return false; |
| 165 | + return true; |
| 166 | + } |
| 167 | +} |
0 commit comments