001package com.box.sdkgen.managers.classifications; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.box.sdkgen.serialization.json.EnumWrapper; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 009import com.fasterxml.jackson.databind.annotation.JsonSerialize; 010import java.util.List; 011import java.util.Objects; 012 013@JsonFilter("nullablePropertyFilter") 014public class CreateClassificationTemplateRequestBodyFieldsField extends SerializableObject { 015 016 /** The type of the field that is always enum. */ 017 @JsonDeserialize( 018 using = 019 CreateClassificationTemplateRequestBodyFieldsTypeField 020 .CreateClassificationTemplateRequestBodyFieldsTypeFieldDeserializer.class) 021 @JsonSerialize( 022 using = 023 CreateClassificationTemplateRequestBodyFieldsTypeField 024 .CreateClassificationTemplateRequestBodyFieldsTypeFieldSerializer.class) 025 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField> type; 026 027 /** Defines classifications available in the enterprise. */ 028 @JsonDeserialize( 029 using = 030 CreateClassificationTemplateRequestBodyFieldsKeyField 031 .CreateClassificationTemplateRequestBodyFieldsKeyFieldDeserializer.class) 032 @JsonSerialize( 033 using = 034 CreateClassificationTemplateRequestBodyFieldsKeyField 035 .CreateClassificationTemplateRequestBodyFieldsKeyFieldSerializer.class) 036 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField> key; 037 038 /** A display name for the classification. */ 039 @JsonDeserialize( 040 using = 041 CreateClassificationTemplateRequestBodyFieldsDisplayNameField 042 .CreateClassificationTemplateRequestBodyFieldsDisplayNameFieldDeserializer.class) 043 @JsonSerialize( 044 using = 045 CreateClassificationTemplateRequestBodyFieldsDisplayNameField 046 .CreateClassificationTemplateRequestBodyFieldsDisplayNameFieldSerializer.class) 047 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField> displayName; 048 049 /** Determines if the classification template is hidden or available on web and mobile devices. */ 050 protected Boolean hidden; 051 052 /** The actual list of classifications that are present on this template. */ 053 protected final List<CreateClassificationTemplateRequestBodyFieldsOptionsField> options; 054 055 public CreateClassificationTemplateRequestBodyFieldsField( 056 @JsonProperty("options") 057 List<CreateClassificationTemplateRequestBodyFieldsOptionsField> options) { 058 super(); 059 this.options = options; 060 this.type = 061 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField>( 062 CreateClassificationTemplateRequestBodyFieldsTypeField.ENUM); 063 this.key = 064 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField>( 065 CreateClassificationTemplateRequestBodyFieldsKeyField 066 .BOX__SECURITY__CLASSIFICATION__KEY); 067 this.displayName = 068 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField>( 069 CreateClassificationTemplateRequestBodyFieldsDisplayNameField.CLASSIFICATION); 070 } 071 072 protected CreateClassificationTemplateRequestBodyFieldsField(Builder builder) { 073 super(); 074 this.type = builder.type; 075 this.key = builder.key; 076 this.displayName = builder.displayName; 077 this.hidden = builder.hidden; 078 this.options = builder.options; 079 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 080 } 081 082 public EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField> getType() { 083 return type; 084 } 085 086 public EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField> getKey() { 087 return key; 088 } 089 090 public EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField> 091 getDisplayName() { 092 return displayName; 093 } 094 095 public Boolean getHidden() { 096 return hidden; 097 } 098 099 public List<CreateClassificationTemplateRequestBodyFieldsOptionsField> getOptions() { 100 return options; 101 } 102 103 @Override 104 public boolean equals(Object o) { 105 if (this == o) { 106 return true; 107 } 108 if (o == null || getClass() != o.getClass()) { 109 return false; 110 } 111 CreateClassificationTemplateRequestBodyFieldsField casted = 112 (CreateClassificationTemplateRequestBodyFieldsField) o; 113 return Objects.equals(type, casted.type) 114 && Objects.equals(key, casted.key) 115 && Objects.equals(displayName, casted.displayName) 116 && Objects.equals(hidden, casted.hidden) 117 && Objects.equals(options, casted.options); 118 } 119 120 @Override 121 public int hashCode() { 122 return Objects.hash(type, key, displayName, hidden, options); 123 } 124 125 @Override 126 public String toString() { 127 return "CreateClassificationTemplateRequestBodyFieldsField{" 128 + "type='" 129 + type 130 + '\'' 131 + ", " 132 + "key='" 133 + key 134 + '\'' 135 + ", " 136 + "displayName='" 137 + displayName 138 + '\'' 139 + ", " 140 + "hidden='" 141 + hidden 142 + '\'' 143 + ", " 144 + "options='" 145 + options 146 + '\'' 147 + "}"; 148 } 149 150 public static class Builder extends NullableFieldTracker { 151 152 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField> type; 153 154 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField> key; 155 156 protected EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField> 157 displayName; 158 159 protected Boolean hidden; 160 161 protected final List<CreateClassificationTemplateRequestBodyFieldsOptionsField> options; 162 163 public Builder(List<CreateClassificationTemplateRequestBodyFieldsOptionsField> options) { 164 super(); 165 this.options = options; 166 } 167 168 public Builder type(CreateClassificationTemplateRequestBodyFieldsTypeField type) { 169 this.type = new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField>(type); 170 return this; 171 } 172 173 public Builder type(EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField> type) { 174 this.type = type; 175 return this; 176 } 177 178 public Builder key(CreateClassificationTemplateRequestBodyFieldsKeyField key) { 179 this.key = new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField>(key); 180 return this; 181 } 182 183 public Builder key(EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField> key) { 184 this.key = key; 185 return this; 186 } 187 188 public Builder displayName( 189 CreateClassificationTemplateRequestBodyFieldsDisplayNameField displayName) { 190 this.displayName = 191 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField>( 192 displayName); 193 return this; 194 } 195 196 public Builder displayName( 197 EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField> displayName) { 198 this.displayName = displayName; 199 return this; 200 } 201 202 public Builder hidden(Boolean hidden) { 203 this.hidden = hidden; 204 return this; 205 } 206 207 public CreateClassificationTemplateRequestBodyFieldsField build() { 208 if (this.type == null) { 209 this.type = 210 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsTypeField>( 211 CreateClassificationTemplateRequestBodyFieldsTypeField.ENUM); 212 } 213 if (this.key == null) { 214 this.key = 215 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsKeyField>( 216 CreateClassificationTemplateRequestBodyFieldsKeyField 217 .BOX__SECURITY__CLASSIFICATION__KEY); 218 } 219 if (this.displayName == null) { 220 this.displayName = 221 new EnumWrapper<CreateClassificationTemplateRequestBodyFieldsDisplayNameField>( 222 CreateClassificationTemplateRequestBodyFieldsDisplayNameField.CLASSIFICATION); 223 } 224 return new CreateClassificationTemplateRequestBodyFieldsField(this); 225 } 226 } 227}