001package com.box.sdkgen.schemas.v2025r0.termsofservicebasev2025r0; 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.Objects; 011 012/** The root-level record that is supposed to represent a single Terms of Service. */ 013@JsonFilter("nullablePropertyFilter") 014public class TermsOfServiceBaseV2025R0 extends SerializableObject { 015 016 /** The unique identifier for this terms of service. */ 017 protected final String id; 018 019 /** The value will always be `terms_of_service`. */ 020 @JsonDeserialize( 021 using = 022 TermsOfServiceBaseV2025R0TypeField.TermsOfServiceBaseV2025R0TypeFieldDeserializer.class) 023 @JsonSerialize( 024 using = TermsOfServiceBaseV2025R0TypeField.TermsOfServiceBaseV2025R0TypeFieldSerializer.class) 025 protected EnumWrapper<TermsOfServiceBaseV2025R0TypeField> type; 026 027 public TermsOfServiceBaseV2025R0(@JsonProperty("id") String id) { 028 super(); 029 this.id = id; 030 this.type = 031 new EnumWrapper<TermsOfServiceBaseV2025R0TypeField>( 032 TermsOfServiceBaseV2025R0TypeField.TERMS_OF_SERVICE); 033 } 034 035 protected TermsOfServiceBaseV2025R0(Builder builder) { 036 super(); 037 this.id = builder.id; 038 this.type = builder.type; 039 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 040 } 041 042 public String getId() { 043 return id; 044 } 045 046 public EnumWrapper<TermsOfServiceBaseV2025R0TypeField> getType() { 047 return type; 048 } 049 050 @Override 051 public boolean equals(Object o) { 052 if (this == o) { 053 return true; 054 } 055 if (o == null || getClass() != o.getClass()) { 056 return false; 057 } 058 TermsOfServiceBaseV2025R0 casted = (TermsOfServiceBaseV2025R0) o; 059 return Objects.equals(id, casted.id) && Objects.equals(type, casted.type); 060 } 061 062 @Override 063 public int hashCode() { 064 return Objects.hash(id, type); 065 } 066 067 @Override 068 public String toString() { 069 return "TermsOfServiceBaseV2025R0{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}"; 070 } 071 072 public static class Builder extends NullableFieldTracker { 073 074 protected final String id; 075 076 protected EnumWrapper<TermsOfServiceBaseV2025R0TypeField> type; 077 078 public Builder(String id) { 079 super(); 080 this.id = id; 081 } 082 083 public Builder type(TermsOfServiceBaseV2025R0TypeField type) { 084 this.type = new EnumWrapper<TermsOfServiceBaseV2025R0TypeField>(type); 085 return this; 086 } 087 088 public Builder type(EnumWrapper<TermsOfServiceBaseV2025R0TypeField> type) { 089 this.type = type; 090 return this; 091 } 092 093 public TermsOfServiceBaseV2025R0 build() { 094 if (this.type == null) { 095 this.type = 096 new EnumWrapper<TermsOfServiceBaseV2025R0TypeField>( 097 TermsOfServiceBaseV2025R0TypeField.TERMS_OF_SERVICE); 098 } 099 return new TermsOfServiceBaseV2025R0(this); 100 } 101 } 102}