001package com.box.sdkgen.managers.webhooks; 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 UpdateWebhookByIdRequestBodyTargetField 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( 019 using = 020 UpdateWebhookByIdRequestBodyTargetTypeField 021 .UpdateWebhookByIdRequestBodyTargetTypeFieldDeserializer.class) 022 @JsonSerialize( 023 using = 024 UpdateWebhookByIdRequestBodyTargetTypeField 025 .UpdateWebhookByIdRequestBodyTargetTypeFieldSerializer.class) 026 protected EnumWrapper<UpdateWebhookByIdRequestBodyTargetTypeField> type; 027 028 public UpdateWebhookByIdRequestBodyTargetField() { 029 super(); 030 } 031 032 protected UpdateWebhookByIdRequestBodyTargetField(Builder builder) { 033 super(); 034 this.id = builder.id; 035 this.type = builder.type; 036 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 037 } 038 039 public String getId() { 040 return id; 041 } 042 043 public EnumWrapper<UpdateWebhookByIdRequestBodyTargetTypeField> getType() { 044 return type; 045 } 046 047 @Override 048 public boolean equals(Object o) { 049 if (this == o) { 050 return true; 051 } 052 if (o == null || getClass() != o.getClass()) { 053 return false; 054 } 055 UpdateWebhookByIdRequestBodyTargetField casted = (UpdateWebhookByIdRequestBodyTargetField) o; 056 return Objects.equals(id, casted.id) && Objects.equals(type, casted.type); 057 } 058 059 @Override 060 public int hashCode() { 061 return Objects.hash(id, type); 062 } 063 064 @Override 065 public String toString() { 066 return "UpdateWebhookByIdRequestBodyTargetField{" 067 + "id='" 068 + id 069 + '\'' 070 + ", " 071 + "type='" 072 + type 073 + '\'' 074 + "}"; 075 } 076 077 public static class Builder extends NullableFieldTracker { 078 079 protected String id; 080 081 protected EnumWrapper<UpdateWebhookByIdRequestBodyTargetTypeField> type; 082 083 public Builder id(String id) { 084 this.id = id; 085 return this; 086 } 087 088 public Builder type(UpdateWebhookByIdRequestBodyTargetTypeField type) { 089 this.type = new EnumWrapper<UpdateWebhookByIdRequestBodyTargetTypeField>(type); 090 return this; 091 } 092 093 public Builder type(EnumWrapper<UpdateWebhookByIdRequestBodyTargetTypeField> type) { 094 this.type = type; 095 return this; 096 } 097 098 public UpdateWebhookByIdRequestBodyTargetField build() { 099 return new UpdateWebhookByIdRequestBodyTargetField(this); 100 } 101 } 102}