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 UpdateWebLinkByIdRequestBody extends SerializableObject {
011
012  /** The new URL that the web link links to. Must start with `"http://"` or `"https://"`. */
013  protected String url;
014
015  protected UpdateWebLinkByIdRequestBodyParentField parent;
016
017  /** A new name for the web link. Defaults to the URL if not set. */
018  protected String name;
019
020  /** A new description of the web link. */
021  protected String description;
022
023  /** The settings for the shared link to update. */
024  @JsonProperty("shared_link")
025  protected UpdateWebLinkByIdRequestBodySharedLinkField sharedLink;
026
027  public UpdateWebLinkByIdRequestBody() {
028    super();
029  }
030
031  protected UpdateWebLinkByIdRequestBody(Builder builder) {
032    super();
033    this.url = builder.url;
034    this.parent = builder.parent;
035    this.name = builder.name;
036    this.description = builder.description;
037    this.sharedLink = builder.sharedLink;
038    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
039  }
040
041  public String getUrl() {
042    return url;
043  }
044
045  public UpdateWebLinkByIdRequestBodyParentField 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  public UpdateWebLinkByIdRequestBodySharedLinkField getSharedLink() {
058    return sharedLink;
059  }
060
061  @Override
062  public boolean equals(Object o) {
063    if (this == o) {
064      return true;
065    }
066    if (o == null || getClass() != o.getClass()) {
067      return false;
068    }
069    UpdateWebLinkByIdRequestBody casted = (UpdateWebLinkByIdRequestBody) o;
070    return Objects.equals(url, casted.url)
071        && Objects.equals(parent, casted.parent)
072        && Objects.equals(name, casted.name)
073        && Objects.equals(description, casted.description)
074        && Objects.equals(sharedLink, casted.sharedLink);
075  }
076
077  @Override
078  public int hashCode() {
079    return Objects.hash(url, parent, name, description, sharedLink);
080  }
081
082  @Override
083  public String toString() {
084    return "UpdateWebLinkByIdRequestBody{"
085        + "url='"
086        + url
087        + '\''
088        + ", "
089        + "parent='"
090        + parent
091        + '\''
092        + ", "
093        + "name='"
094        + name
095        + '\''
096        + ", "
097        + "description='"
098        + description
099        + '\''
100        + ", "
101        + "sharedLink='"
102        + sharedLink
103        + '\''
104        + "}";
105  }
106
107  public static class Builder extends NullableFieldTracker {
108
109    protected String url;
110
111    protected UpdateWebLinkByIdRequestBodyParentField parent;
112
113    protected String name;
114
115    protected String description;
116
117    protected UpdateWebLinkByIdRequestBodySharedLinkField sharedLink;
118
119    public Builder url(String url) {
120      this.url = url;
121      return this;
122    }
123
124    public Builder parent(UpdateWebLinkByIdRequestBodyParentField parent) {
125      this.parent = parent;
126      return this;
127    }
128
129    public Builder name(String name) {
130      this.name = name;
131      return this;
132    }
133
134    public Builder description(String description) {
135      this.description = description;
136      return this;
137    }
138
139    public Builder sharedLink(UpdateWebLinkByIdRequestBodySharedLinkField sharedLink) {
140      this.sharedLink = sharedLink;
141      return this;
142    }
143
144    public UpdateWebLinkByIdRequestBody build() {
145      return new UpdateWebLinkByIdRequestBody(this);
146    }
147  }
148}