|
| 1 | +/* |
| 2 | + * Transfer webhooks |
| 3 | + * |
| 4 | + * The version of the OpenAPI document: 4 |
| 5 | + * |
| 6 | + * |
| 7 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 8 | + * https://openapi-generator.tech |
| 9 | + * Do not edit the class manually. |
| 10 | + */ |
| 11 | + |
| 12 | +package com.adyen.model.transferwebhooks; |
| 13 | + |
| 14 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 15 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 16 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 17 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 18 | +import com.fasterxml.jackson.annotation.JsonValue; |
| 19 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 20 | +import java.util.*; |
| 21 | +import java.util.Arrays; |
| 22 | +import java.util.logging.Logger; |
| 23 | + |
| 24 | +/** NetworkReason */ |
| 25 | +@JsonPropertyOrder({ |
| 26 | + NetworkReason.JSON_PROPERTY_CODE, |
| 27 | + NetworkReason.JSON_PROPERTY_DESCRIPTION, |
| 28 | + NetworkReason.JSON_PROPERTY_NAMESPACE |
| 29 | +}) |
| 30 | +public class NetworkReason { |
| 31 | + public static final String JSON_PROPERTY_CODE = "code"; |
| 32 | + private String code; |
| 33 | + |
| 34 | + public static final String JSON_PROPERTY_DESCRIPTION = "description"; |
| 35 | + private String description; |
| 36 | + |
| 37 | + /** |
| 38 | + * The namespace that corresponds to the reason code. Possible values: * **ukFpsRejectionCode** * |
| 39 | + * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * **iso8583ResponseCode** |
| 40 | + */ |
| 41 | + public enum NamespaceEnum { |
| 42 | + ISO8583RESPONSECODE(String.valueOf("iso8583ResponseCode")), |
| 43 | + |
| 44 | + UKFPSREJECTIONCODE(String.valueOf("ukFpsRejectionCode")), |
| 45 | + |
| 46 | + UKFPSRETURNREASONCODE(String.valueOf("ukFpsReturnReasonCode")), |
| 47 | + |
| 48 | + USACHRETURNREASONCODE(String.valueOf("usAchReturnReasonCode")); |
| 49 | + |
| 50 | + private static final Logger LOG = Logger.getLogger(NamespaceEnum.class.getName()); |
| 51 | + |
| 52 | + private String value; |
| 53 | + |
| 54 | + NamespaceEnum(String value) { |
| 55 | + this.value = value; |
| 56 | + } |
| 57 | + |
| 58 | + @JsonValue |
| 59 | + public String getValue() { |
| 60 | + return value; |
| 61 | + } |
| 62 | + |
| 63 | + @Override |
| 64 | + public String toString() { |
| 65 | + return String.valueOf(value); |
| 66 | + } |
| 67 | + |
| 68 | + @JsonCreator |
| 69 | + public static NamespaceEnum fromValue(String value) { |
| 70 | + for (NamespaceEnum b : NamespaceEnum.values()) { |
| 71 | + if (b.value.equals(value)) { |
| 72 | + return b; |
| 73 | + } |
| 74 | + } |
| 75 | + // handling unexpected value |
| 76 | + LOG.warning( |
| 77 | + "NamespaceEnum: unexpected enum value '" |
| 78 | + + value |
| 79 | + + "' - Supported values are " |
| 80 | + + Arrays.toString(NamespaceEnum.values())); |
| 81 | + return null; |
| 82 | + } |
| 83 | + } |
| 84 | + |
| 85 | + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; |
| 86 | + private NamespaceEnum namespace; |
| 87 | + |
| 88 | + public NetworkReason() {} |
| 89 | + |
| 90 | + /** |
| 91 | + * The reason code provided by the network. |
| 92 | + * |
| 93 | + * @param code The reason code provided by the network. |
| 94 | + * @return the current {@code NetworkReason} instance, allowing for method chaining |
| 95 | + */ |
| 96 | + public NetworkReason code(String code) { |
| 97 | + this.code = code; |
| 98 | + return this; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * The reason code provided by the network. |
| 103 | + * |
| 104 | + * @return code The reason code provided by the network. |
| 105 | + */ |
| 106 | + @JsonProperty(JSON_PROPERTY_CODE) |
| 107 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 108 | + public String getCode() { |
| 109 | + return code; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * The reason code provided by the network. |
| 114 | + * |
| 115 | + * @param code The reason code provided by the network. |
| 116 | + */ |
| 117 | + @JsonProperty(JSON_PROPERTY_CODE) |
| 118 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 119 | + public void setCode(String code) { |
| 120 | + this.code = code; |
| 121 | + } |
| 122 | + |
| 123 | + /** |
| 124 | + * The description of the reason code. |
| 125 | + * |
| 126 | + * @param description The description of the reason code. |
| 127 | + * @return the current {@code NetworkReason} instance, allowing for method chaining |
| 128 | + */ |
| 129 | + public NetworkReason description(String description) { |
| 130 | + this.description = description; |
| 131 | + return this; |
| 132 | + } |
| 133 | + |
| 134 | + /** |
| 135 | + * The description of the reason code. |
| 136 | + * |
| 137 | + * @return description The description of the reason code. |
| 138 | + */ |
| 139 | + @JsonProperty(JSON_PROPERTY_DESCRIPTION) |
| 140 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 141 | + public String getDescription() { |
| 142 | + return description; |
| 143 | + } |
| 144 | + |
| 145 | + /** |
| 146 | + * The description of the reason code. |
| 147 | + * |
| 148 | + * @param description The description of the reason code. |
| 149 | + */ |
| 150 | + @JsonProperty(JSON_PROPERTY_DESCRIPTION) |
| 151 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 152 | + public void setDescription(String description) { |
| 153 | + this.description = description; |
| 154 | + } |
| 155 | + |
| 156 | + /** |
| 157 | + * The namespace that corresponds to the reason code. Possible values: * **ukFpsRejectionCode** * |
| 158 | + * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * **iso8583ResponseCode** |
| 159 | + * |
| 160 | + * @param namespace The namespace that corresponds to the reason code. Possible values: * |
| 161 | + * **ukFpsRejectionCode** * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * |
| 162 | + * **iso8583ResponseCode** |
| 163 | + * @return the current {@code NetworkReason} instance, allowing for method chaining |
| 164 | + */ |
| 165 | + public NetworkReason namespace(NamespaceEnum namespace) { |
| 166 | + this.namespace = namespace; |
| 167 | + return this; |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * The namespace that corresponds to the reason code. Possible values: * **ukFpsRejectionCode** * |
| 172 | + * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * **iso8583ResponseCode** |
| 173 | + * |
| 174 | + * @return namespace The namespace that corresponds to the reason code. Possible values: * |
| 175 | + * **ukFpsRejectionCode** * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * |
| 176 | + * **iso8583ResponseCode** |
| 177 | + */ |
| 178 | + @JsonProperty(JSON_PROPERTY_NAMESPACE) |
| 179 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 180 | + public NamespaceEnum getNamespace() { |
| 181 | + return namespace; |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * The namespace that corresponds to the reason code. Possible values: * **ukFpsRejectionCode** * |
| 186 | + * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * **iso8583ResponseCode** |
| 187 | + * |
| 188 | + * @param namespace The namespace that corresponds to the reason code. Possible values: * |
| 189 | + * **ukFpsRejectionCode** * **ukFpsReturnReasonCode** * **usAchReturnReasonCode** * |
| 190 | + * **iso8583ResponseCode** |
| 191 | + */ |
| 192 | + @JsonProperty(JSON_PROPERTY_NAMESPACE) |
| 193 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 194 | + public void setNamespace(NamespaceEnum namespace) { |
| 195 | + this.namespace = namespace; |
| 196 | + } |
| 197 | + |
| 198 | + /** Return true if this NetworkReason object is equal to o. */ |
| 199 | + @Override |
| 200 | + public boolean equals(Object o) { |
| 201 | + if (this == o) { |
| 202 | + return true; |
| 203 | + } |
| 204 | + if (o == null || getClass() != o.getClass()) { |
| 205 | + return false; |
| 206 | + } |
| 207 | + NetworkReason networkReason = (NetworkReason) o; |
| 208 | + return Objects.equals(this.code, networkReason.code) |
| 209 | + && Objects.equals(this.description, networkReason.description) |
| 210 | + && Objects.equals(this.namespace, networkReason.namespace); |
| 211 | + } |
| 212 | + |
| 213 | + @Override |
| 214 | + public int hashCode() { |
| 215 | + return Objects.hash(code, description, namespace); |
| 216 | + } |
| 217 | + |
| 218 | + @Override |
| 219 | + public String toString() { |
| 220 | + StringBuilder sb = new StringBuilder(); |
| 221 | + sb.append("class NetworkReason {\n"); |
| 222 | + sb.append(" code: ").append(toIndentedString(code)).append("\n"); |
| 223 | + sb.append(" description: ").append(toIndentedString(description)).append("\n"); |
| 224 | + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); |
| 225 | + sb.append("}"); |
| 226 | + return sb.toString(); |
| 227 | + } |
| 228 | + |
| 229 | + /** |
| 230 | + * Convert the given object to string with each line indented by 4 spaces (except the first line). |
| 231 | + */ |
| 232 | + private String toIndentedString(Object o) { |
| 233 | + if (o == null) { |
| 234 | + return "null"; |
| 235 | + } |
| 236 | + return o.toString().replace("\n", "\n "); |
| 237 | + } |
| 238 | + |
| 239 | + /** |
| 240 | + * Create an instance of NetworkReason given an JSON string |
| 241 | + * |
| 242 | + * @param jsonString JSON string |
| 243 | + * @return An instance of NetworkReason |
| 244 | + * @throws JsonProcessingException if the JSON string is invalid with respect to NetworkReason |
| 245 | + */ |
| 246 | + public static NetworkReason fromJson(String jsonString) throws JsonProcessingException { |
| 247 | + return JSON.getMapper().readValue(jsonString, NetworkReason.class); |
| 248 | + } |
| 249 | + |
| 250 | + /** |
| 251 | + * Convert an instance of NetworkReason to an JSON string |
| 252 | + * |
| 253 | + * @return JSON string |
| 254 | + */ |
| 255 | + public String toJson() throws JsonProcessingException { |
| 256 | + return JSON.getMapper().writeValueAsString(this); |
| 257 | + } |
| 258 | +} |
0 commit comments