|
| 1 | +/** |
| 2 | + * This file was auto-generated by Fern from our API Definition. |
| 3 | + */ |
| 4 | +package com.auth0.client.mgmt.types; |
| 5 | + |
| 6 | +import com.auth0.client.mgmt.core.ObjectMappers; |
| 7 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 8 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 9 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 10 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 11 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 12 | +import com.fasterxml.jackson.annotation.JsonSetter; |
| 13 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 14 | +import java.util.HashMap; |
| 15 | +import java.util.Map; |
| 16 | +import java.util.Objects; |
| 17 | +import org.jetbrains.annotations.NotNull; |
| 18 | + |
| 19 | +@JsonInclude(JsonInclude.Include.NON_ABSENT) |
| 20 | +@JsonDeserialize(builder = BadRequestSchema.Builder.class) |
| 21 | +public final class BadRequestSchema { |
| 22 | + private final String message; |
| 23 | + |
| 24 | + private final String statusCode; |
| 25 | + |
| 26 | + private final BadRequestSchemaError error; |
| 27 | + |
| 28 | + private final Map<String, Object> additionalProperties; |
| 29 | + |
| 30 | + private BadRequestSchema( |
| 31 | + String message, String statusCode, BadRequestSchemaError error, Map<String, Object> additionalProperties) { |
| 32 | + this.message = message; |
| 33 | + this.statusCode = statusCode; |
| 34 | + this.error = error; |
| 35 | + this.additionalProperties = additionalProperties; |
| 36 | + } |
| 37 | + |
| 38 | + @JsonProperty("message") |
| 39 | + public String getMessage() { |
| 40 | + return message; |
| 41 | + } |
| 42 | + |
| 43 | + @JsonProperty("statusCode") |
| 44 | + public String getStatusCode() { |
| 45 | + return statusCode; |
| 46 | + } |
| 47 | + |
| 48 | + @JsonProperty("error") |
| 49 | + public BadRequestSchemaError getError() { |
| 50 | + return error; |
| 51 | + } |
| 52 | + |
| 53 | + @java.lang.Override |
| 54 | + public boolean equals(Object other) { |
| 55 | + if (this == other) return true; |
| 56 | + return other instanceof BadRequestSchema && equalTo((BadRequestSchema) other); |
| 57 | + } |
| 58 | + |
| 59 | + @JsonAnyGetter |
| 60 | + public Map<String, Object> getAdditionalProperties() { |
| 61 | + return this.additionalProperties; |
| 62 | + } |
| 63 | + |
| 64 | + private boolean equalTo(BadRequestSchema other) { |
| 65 | + return message.equals(other.message) && statusCode.equals(other.statusCode) && error.equals(other.error); |
| 66 | + } |
| 67 | + |
| 68 | + @java.lang.Override |
| 69 | + public int hashCode() { |
| 70 | + return Objects.hash(this.message, this.statusCode, this.error); |
| 71 | + } |
| 72 | + |
| 73 | + @java.lang.Override |
| 74 | + public String toString() { |
| 75 | + return ObjectMappers.stringify(this); |
| 76 | + } |
| 77 | + |
| 78 | + public static MessageStage builder() { |
| 79 | + return new Builder(); |
| 80 | + } |
| 81 | + |
| 82 | + public interface MessageStage { |
| 83 | + StatusCodeStage message(@NotNull String message); |
| 84 | + |
| 85 | + Builder from(BadRequestSchema other); |
| 86 | + } |
| 87 | + |
| 88 | + public interface StatusCodeStage { |
| 89 | + ErrorStage statusCode(@NotNull String statusCode); |
| 90 | + } |
| 91 | + |
| 92 | + public interface ErrorStage { |
| 93 | + _FinalStage error(@NotNull BadRequestSchemaError error); |
| 94 | + } |
| 95 | + |
| 96 | + public interface _FinalStage { |
| 97 | + BadRequestSchema build(); |
| 98 | + |
| 99 | + _FinalStage additionalProperty(String key, Object value); |
| 100 | + |
| 101 | + _FinalStage additionalProperties(Map<String, Object> additionalProperties); |
| 102 | + } |
| 103 | + |
| 104 | + @JsonIgnoreProperties(ignoreUnknown = true) |
| 105 | + public static final class Builder implements MessageStage, StatusCodeStage, ErrorStage, _FinalStage { |
| 106 | + private String message; |
| 107 | + |
| 108 | + private String statusCode; |
| 109 | + |
| 110 | + private BadRequestSchemaError error; |
| 111 | + |
| 112 | + @JsonAnySetter |
| 113 | + private Map<String, Object> additionalProperties = new HashMap<>(); |
| 114 | + |
| 115 | + private Builder() {} |
| 116 | + |
| 117 | + @java.lang.Override |
| 118 | + public Builder from(BadRequestSchema other) { |
| 119 | + message(other.getMessage()); |
| 120 | + statusCode(other.getStatusCode()); |
| 121 | + error(other.getError()); |
| 122 | + return this; |
| 123 | + } |
| 124 | + |
| 125 | + @java.lang.Override |
| 126 | + @JsonSetter("message") |
| 127 | + public StatusCodeStage message(@NotNull String message) { |
| 128 | + this.message = Objects.requireNonNull(message, "message must not be null"); |
| 129 | + return this; |
| 130 | + } |
| 131 | + |
| 132 | + @java.lang.Override |
| 133 | + @JsonSetter("statusCode") |
| 134 | + public ErrorStage statusCode(@NotNull String statusCode) { |
| 135 | + this.statusCode = Objects.requireNonNull(statusCode, "statusCode must not be null"); |
| 136 | + return this; |
| 137 | + } |
| 138 | + |
| 139 | + @java.lang.Override |
| 140 | + @JsonSetter("error") |
| 141 | + public _FinalStage error(@NotNull BadRequestSchemaError error) { |
| 142 | + this.error = Objects.requireNonNull(error, "error must not be null"); |
| 143 | + return this; |
| 144 | + } |
| 145 | + |
| 146 | + @java.lang.Override |
| 147 | + public BadRequestSchema build() { |
| 148 | + return new BadRequestSchema(message, statusCode, error, additionalProperties); |
| 149 | + } |
| 150 | + |
| 151 | + @java.lang.Override |
| 152 | + public Builder additionalProperty(String key, Object value) { |
| 153 | + this.additionalProperties.put(key, value); |
| 154 | + return this; |
| 155 | + } |
| 156 | + |
| 157 | + @java.lang.Override |
| 158 | + public Builder additionalProperties(Map<String, Object> additionalProperties) { |
| 159 | + this.additionalProperties.putAll(additionalProperties); |
| 160 | + return this; |
| 161 | + } |
| 162 | + } |
| 163 | +} |
0 commit comments