001package com.box.sdkgen.managers.weblinks; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import java.util.Objects; 008 009@JsonFilter("nullablePropertyFilter") 010public class CreateWebLinkRequestBody extends SerializableObject { 011 012 /** The URL that this web link links to. Must start with `"http://"` or `"https://"`. */ 013 protected final String url; 014 015 /** The parent folder to create the web link within. */ 016 protected final CreateWebLinkRequestBodyParentField parent; 017 018 /** Name of the web link. Defaults to the URL if not set. */ 019 protected String name; 020 021 /** Description of the web link. */ 022 protected String description; 023 024 public CreateWebLinkRequestBody( 025 @JsonProperty("url") String url, 026 @JsonProperty("parent") CreateWebLinkRequestBodyParentField parent) { 027 super(); 028 this.url = url; 029 this.parent = parent; 030 } 031 032 protected CreateWebLinkRequestBody(Builder builder) { 033 super(); 034 this.url = builder.url; 035 this.parent = builder.parent; 036 this.name = builder.name; 037 this.description = builder.description; 038 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 039 } 040 041 public String getUrl() { 042 return url; 043 } 044 045 public CreateWebLinkRequestBodyParentField getParent() { 046 return parent; 047 } 048 049 public String getName() { 050 return name; 051 } 052 053 public String getDescription() { 054 return description; 055 } 056 057 @Override 058 public boolean equals(Object o) { 059 if (this == o) { 060 return true; 061 } 062 if (o == null || getClass() != o.getClass()) { 063 return false; 064 } 065 CreateWebLinkRequestBody casted = (CreateWebLinkRequestBody) o; 066 return Objects.equals(url, casted.url) 067 && Objects.equals(parent, casted.parent) 068 && Objects.equals(name, casted.name) 069 && Objects.equals(description, casted.description); 070 } 071 072 @Override 073 public int hashCode() { 074 return Objects.hash(url, parent, name, description); 075 } 076 077 @Override 078 public String toString() { 079 return "CreateWebLinkRequestBody{" 080 + "url='" 081 + url 082 + '\'' 083 + ", " 084 + "parent='" 085 + parent 086 + '\'' 087 + ", " 088 + "name='" 089 + name 090 + '\'' 091 + ", " 092 + "description='" 093 + description 094 + '\'' 095 + "}"; 096 } 097 098 public static class Builder extends NullableFieldTracker { 099 100 protected final String url; 101 102 protected final CreateWebLinkRequestBodyParentField parent; 103 104 protected String name; 105 106 protected String description; 107 108 public Builder(String url, CreateWebLinkRequestBodyParentField parent) { 109 super(); 110 this.url = url; 111 this.parent = parent; 112 } 113 114 public Builder name(String name) { 115 this.name = name; 116 return this; 117 } 118 119 public Builder description(String description) { 120 this.description = description; 121 return this; 122 } 123 124 public CreateWebLinkRequestBody build() { 125 return new CreateWebLinkRequestBody(this); 126 } 127 } 128}