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