|
| 1 | +/* |
| 2 | + * Copyright 2022 Thunderberry. |
| 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 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package nl.altindag.validation.model; |
| 18 | + |
| 19 | +import java.util.HashMap; |
| 20 | +import java.util.LinkedHashMap; |
| 21 | +import java.util.Map; |
| 22 | +import jakarta.annotation.Generated; |
| 23 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 24 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 25 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 26 | +import com.fasterxml.jackson.annotation.JsonIgnore; |
| 27 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 28 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 29 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 30 | +import com.fasterxml.jackson.annotation.JsonValue; |
| 31 | +import jakarta.validation.Valid; |
| 32 | + |
| 33 | +@JsonInclude(JsonInclude.Include.NON_NULL) |
| 34 | +@JsonPropertyOrder({ |
| 35 | + "status" |
| 36 | +}) |
| 37 | +@Generated("jsonschema2pojo") |
| 38 | +public class AdvancedSecurity { |
| 39 | + |
| 40 | + @JsonProperty("status") |
| 41 | + private AdvancedSecurity.Status status; |
| 42 | + @JsonIgnore |
| 43 | + @Valid |
| 44 | + private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>(); |
| 45 | + |
| 46 | + /** |
| 47 | + * No args constructor for use in serialization |
| 48 | + * |
| 49 | + */ |
| 50 | + public AdvancedSecurity() { |
| 51 | + } |
| 52 | + |
| 53 | + public AdvancedSecurity(Status status) { |
| 54 | + super(); |
| 55 | + this.status = status; |
| 56 | + } |
| 57 | + |
| 58 | + @JsonProperty("status") |
| 59 | + public AdvancedSecurity.Status getStatus() { |
| 60 | + return status; |
| 61 | + } |
| 62 | + |
| 63 | + @JsonProperty("status") |
| 64 | + public void setStatus(Status status) { |
| 65 | + this.status = status; |
| 66 | + } |
| 67 | + |
| 68 | + @JsonAnyGetter |
| 69 | + public Map<String, Object> getAdditionalProperties() { |
| 70 | + return this.additionalProperties; |
| 71 | + } |
| 72 | + |
| 73 | + @JsonAnySetter |
| 74 | + public void setAdditionalProperty(String name, Object value) { |
| 75 | + this.additionalProperties.put(name, value); |
| 76 | + } |
| 77 | + |
| 78 | + @Generated("jsonschema2pojo") |
| 79 | + public enum Status { |
| 80 | + |
| 81 | + ENABLED("enabled"), |
| 82 | + DISABLED("disabled"); |
| 83 | + private final String value; |
| 84 | + private final static Map<String, Status> CONSTANTS = new HashMap<String, Status>(); |
| 85 | + |
| 86 | + static { |
| 87 | + for (Status c: values()) { |
| 88 | + CONSTANTS.put(c.value, c); |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + Status(String value) { |
| 93 | + this.value = value; |
| 94 | + } |
| 95 | + |
| 96 | + @Override |
| 97 | + public String toString() { |
| 98 | + return this.value; |
| 99 | + } |
| 100 | + |
| 101 | + @JsonValue |
| 102 | + public String value() { |
| 103 | + return this.value; |
| 104 | + } |
| 105 | + |
| 106 | + @JsonCreator |
| 107 | + public static AdvancedSecurity.Status fromValue(String value) { |
| 108 | + Status constant = CONSTANTS.get(value); |
| 109 | + if (constant == null) { |
| 110 | + throw new IllegalArgumentException(value); |
| 111 | + } else { |
| 112 | + return constant; |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + } |
| 117 | + |
| 118 | +} |
0 commit comments