001package com.box.sdkgen.schemas.webhookmini; 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.databind.annotation.JsonDeserialize; 008import com.fasterxml.jackson.databind.annotation.JsonSerialize; 009import java.util.Objects; 010 011@JsonFilter("nullablePropertyFilter") 012public class WebhookMiniTargetField extends SerializableObject { 013 014 /** The ID of the item to trigger a webhook. */ 015 protected String id; 016 017 /** The type of item to trigger a webhook. */ 018 @JsonDeserialize(using = WebhookMiniTargetTypeField.WebhookMiniTargetTypeFieldDeserializer.class) 019 @JsonSerialize(using = WebhookMiniTargetTypeField.WebhookMiniTargetTypeFieldSerializer.class) 020 protected EnumWrapper<WebhookMiniTargetTypeField> type; 021 022 public WebhookMiniTargetField() { 023 super(); 024 } 025 026 protected WebhookMiniTargetField(Builder builder) { 027 super(); 028 this.id = builder.id; 029 this.type = builder.type; 030 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 031 } 032 033 public String getId() { 034 return id; 035 } 036 037 public EnumWrapper<WebhookMiniTargetTypeField> getType() { 038 return type; 039 } 040 041 @Override 042 public boolean equals(Object o) { 043 if (this == o) { 044 return true; 045 } 046 if (o == null || getClass() != o.getClass()) { 047 return false; 048 } 049 WebhookMiniTargetField casted = (WebhookMiniTargetField) o; 050 return Objects.equals(id, casted.id) && Objects.equals(type, casted.type); 051 } 052 053 @Override 054 public int hashCode() { 055 return Objects.hash(id, type); 056 } 057 058 @Override 059 public String toString() { 060 return "WebhookMiniTargetField{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}"; 061 } 062 063 public static class Builder extends NullableFieldTracker { 064 065 protected String id; 066 067 protected EnumWrapper<WebhookMiniTargetTypeField> type; 068 069 public Builder id(String id) { 070 this.id = id; 071 return this; 072 } 073 074 public Builder type(WebhookMiniTargetTypeField type) { 075 this.type = new EnumWrapper<WebhookMiniTargetTypeField>(type); 076 return this; 077 } 078 079 public Builder type(EnumWrapper<WebhookMiniTargetTypeField> type) { 080 this.type = type; 081 return this; 082 } 083 084 public WebhookMiniTargetField build() { 085 return new WebhookMiniTargetField(this); 086 } 087 } 088}