001package com.box.sdkgen.schemas.integrationmappingboxitemslack; 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 schema for an integration mapping Box item object for type Slack. */ 013@JsonFilter("nullablePropertyFilter") 014public class IntegrationMappingBoxItemSlack extends SerializableObject { 015 016 /** Type of the mapped item referenced in `id`. */ 017 @JsonDeserialize( 018 using = 019 IntegrationMappingBoxItemSlackTypeField 020 .IntegrationMappingBoxItemSlackTypeFieldDeserializer.class) 021 @JsonSerialize( 022 using = 023 IntegrationMappingBoxItemSlackTypeField.IntegrationMappingBoxItemSlackTypeFieldSerializer 024 .class) 025 protected EnumWrapper<IntegrationMappingBoxItemSlackTypeField> type; 026 027 /** ID of the mapped item (of type referenced in `type`). */ 028 protected final String id; 029 030 public IntegrationMappingBoxItemSlack(@JsonProperty("id") String id) { 031 super(); 032 this.id = id; 033 this.type = 034 new EnumWrapper<IntegrationMappingBoxItemSlackTypeField>( 035 IntegrationMappingBoxItemSlackTypeField.FOLDER); 036 } 037 038 protected IntegrationMappingBoxItemSlack(Builder builder) { 039 super(); 040 this.type = builder.type; 041 this.id = builder.id; 042 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 043 } 044 045 public EnumWrapper<IntegrationMappingBoxItemSlackTypeField> getType() { 046 return type; 047 } 048 049 public String getId() { 050 return id; 051 } 052 053 @Override 054 public boolean equals(Object o) { 055 if (this == o) { 056 return true; 057 } 058 if (o == null || getClass() != o.getClass()) { 059 return false; 060 } 061 IntegrationMappingBoxItemSlack casted = (IntegrationMappingBoxItemSlack) o; 062 return Objects.equals(type, casted.type) && Objects.equals(id, casted.id); 063 } 064 065 @Override 066 public int hashCode() { 067 return Objects.hash(type, id); 068 } 069 070 @Override 071 public String toString() { 072 return "IntegrationMappingBoxItemSlack{" 073 + "type='" 074 + type 075 + '\'' 076 + ", " 077 + "id='" 078 + id 079 + '\'' 080 + "}"; 081 } 082 083 public static class Builder extends NullableFieldTracker { 084 085 protected EnumWrapper<IntegrationMappingBoxItemSlackTypeField> type; 086 087 protected final String id; 088 089 public Builder(String id) { 090 super(); 091 this.id = id; 092 } 093 094 public Builder type(IntegrationMappingBoxItemSlackTypeField type) { 095 this.type = new EnumWrapper<IntegrationMappingBoxItemSlackTypeField>(type); 096 return this; 097 } 098 099 public Builder type(EnumWrapper<IntegrationMappingBoxItemSlackTypeField> type) { 100 this.type = type; 101 return this; 102 } 103 104 public IntegrationMappingBoxItemSlack build() { 105 if (this.type == null) { 106 this.type = 107 new EnumWrapper<IntegrationMappingBoxItemSlackTypeField>( 108 IntegrationMappingBoxItemSlackTypeField.FOLDER); 109 } 110 return new IntegrationMappingBoxItemSlack(this); 111 } 112 } 113}