001package com.box.sdkgen.managers.shieldinformationbarriersegmentrestrictions;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.shieldinformationbarrierbase.ShieldInformationBarrierBase;
006import com.box.sdkgen.serialization.json.EnumWrapper;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
010import com.fasterxml.jackson.databind.annotation.JsonSerialize;
011import java.util.Objects;
012
013@JsonFilter("nullablePropertyFilter")
014public class CreateShieldInformationBarrierSegmentRestrictionRequestBody
015    extends SerializableObject {
016
017  /** The type of the shield barrier segment restriction for this member. */
018  @JsonDeserialize(
019      using =
020          CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField
021              .CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeFieldDeserializer
022              .class)
023  @JsonSerialize(
024      using =
025          CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField
026              .CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeFieldSerializer.class)
027  protected EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField> type;
028
029  @JsonProperty("shield_information_barrier")
030  protected ShieldInformationBarrierBase shieldInformationBarrier;
031
032  /** The `type` and `id` of the requested shield information barrier segment. */
033  @JsonProperty("shield_information_barrier_segment")
034  protected final
035  CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField
036      shieldInformationBarrierSegment;
037
038  /** The `type` and `id` of the restricted shield information barrier segment. */
039  @JsonProperty("restricted_segment")
040  protected final CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
041      restrictedSegment;
042
043  public CreateShieldInformationBarrierSegmentRestrictionRequestBody(
044      @JsonProperty("shield_information_barrier_segment")
045          CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField
046              shieldInformationBarrierSegment,
047      @JsonProperty("restricted_segment")
048          CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
049              restrictedSegment) {
050    super();
051    this.shieldInformationBarrierSegment = shieldInformationBarrierSegment;
052    this.restrictedSegment = restrictedSegment;
053    this.type =
054        new EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField>(
055            CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField
056                .SHIELD_INFORMATION_BARRIER_SEGMENT_RESTRICTION);
057  }
058
059  protected CreateShieldInformationBarrierSegmentRestrictionRequestBody(Builder builder) {
060    super();
061    this.type = builder.type;
062    this.shieldInformationBarrier = builder.shieldInformationBarrier;
063    this.shieldInformationBarrierSegment = builder.shieldInformationBarrierSegment;
064    this.restrictedSegment = builder.restrictedSegment;
065    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
066  }
067
068  public EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField>
069      getType() {
070    return type;
071  }
072
073  public ShieldInformationBarrierBase getShieldInformationBarrier() {
074    return shieldInformationBarrier;
075  }
076
077  public
078  CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField
079      getShieldInformationBarrierSegment() {
080    return shieldInformationBarrierSegment;
081  }
082
083  public CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
084      getRestrictedSegment() {
085    return restrictedSegment;
086  }
087
088  @Override
089  public boolean equals(Object o) {
090    if (this == o) {
091      return true;
092    }
093    if (o == null || getClass() != o.getClass()) {
094      return false;
095    }
096    CreateShieldInformationBarrierSegmentRestrictionRequestBody casted =
097        (CreateShieldInformationBarrierSegmentRestrictionRequestBody) o;
098    return Objects.equals(type, casted.type)
099        && Objects.equals(shieldInformationBarrier, casted.shieldInformationBarrier)
100        && Objects.equals(shieldInformationBarrierSegment, casted.shieldInformationBarrierSegment)
101        && Objects.equals(restrictedSegment, casted.restrictedSegment);
102  }
103
104  @Override
105  public int hashCode() {
106    return Objects.hash(
107        type, shieldInformationBarrier, shieldInformationBarrierSegment, restrictedSegment);
108  }
109
110  @Override
111  public String toString() {
112    return "CreateShieldInformationBarrierSegmentRestrictionRequestBody{"
113        + "type='"
114        + type
115        + '\''
116        + ", "
117        + "shieldInformationBarrier='"
118        + shieldInformationBarrier
119        + '\''
120        + ", "
121        + "shieldInformationBarrierSegment='"
122        + shieldInformationBarrierSegment
123        + '\''
124        + ", "
125        + "restrictedSegment='"
126        + restrictedSegment
127        + '\''
128        + "}";
129  }
130
131  public static class Builder extends NullableFieldTracker {
132
133    protected EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField>
134        type;
135
136    protected ShieldInformationBarrierBase shieldInformationBarrier;
137
138    protected final
139    CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField
140        shieldInformationBarrierSegment;
141
142    protected final
143    CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
144        restrictedSegment;
145
146    public Builder(
147        CreateShieldInformationBarrierSegmentRestrictionRequestBodyShieldInformationBarrierSegmentField
148            shieldInformationBarrierSegment,
149        CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
150            restrictedSegment) {
151      super();
152      this.shieldInformationBarrierSegment = shieldInformationBarrierSegment;
153      this.restrictedSegment = restrictedSegment;
154    }
155
156    public Builder type(CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField type) {
157      this.type =
158          new EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField>(
159              type);
160      return this;
161    }
162
163    public Builder type(
164        EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField> type) {
165      this.type = type;
166      return this;
167    }
168
169    public Builder shieldInformationBarrier(ShieldInformationBarrierBase shieldInformationBarrier) {
170      this.shieldInformationBarrier = shieldInformationBarrier;
171      return this;
172    }
173
174    public CreateShieldInformationBarrierSegmentRestrictionRequestBody build() {
175      if (this.type == null) {
176        this.type =
177            new EnumWrapper<CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField>(
178                CreateShieldInformationBarrierSegmentRestrictionRequestBodyTypeField
179                    .SHIELD_INFORMATION_BARRIER_SEGMENT_RESTRICTION);
180      }
181      return new CreateShieldInformationBarrierSegmentRestrictionRequestBody(this);
182    }
183  }
184}