001package com.box.sdkgen.schemas.postoauth2revoke;
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/** A request to revoke an OAuth 2.0 token. */
010@JsonFilter("nullablePropertyFilter")
011public class PostOAuth2Revoke extends SerializableObject {
012
013  /** The Client ID of the application requesting to revoke the access token. */
014  @JsonProperty("client_id")
015  protected String clientId;
016
017  /** The client secret of the application requesting to revoke an access token. */
018  @JsonProperty("client_secret")
019  protected String clientSecret;
020
021  /** The access token to revoke. */
022  protected String token;
023
024  public PostOAuth2Revoke() {
025    super();
026  }
027
028  protected PostOAuth2Revoke(Builder builder) {
029    super();
030    this.clientId = builder.clientId;
031    this.clientSecret = builder.clientSecret;
032    this.token = builder.token;
033    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
034  }
035
036  public String getClientId() {
037    return clientId;
038  }
039
040  public String getClientSecret() {
041    return clientSecret;
042  }
043
044  public String getToken() {
045    return token;
046  }
047
048  @Override
049  public boolean equals(Object o) {
050    if (this == o) {
051      return true;
052    }
053    if (o == null || getClass() != o.getClass()) {
054      return false;
055    }
056    PostOAuth2Revoke casted = (PostOAuth2Revoke) o;
057    return Objects.equals(clientId, casted.clientId)
058        && Objects.equals(clientSecret, casted.clientSecret)
059        && Objects.equals(token, casted.token);
060  }
061
062  @Override
063  public int hashCode() {
064    return Objects.hash(clientId, clientSecret, token);
065  }
066
067  @Override
068  public String toString() {
069    return "PostOAuth2Revoke{"
070        + "clientId='"
071        + clientId
072        + '\''
073        + ", "
074        + "clientSecret='"
075        + clientSecret
076        + '\''
077        + ", "
078        + "token='"
079        + token
080        + '\''
081        + "}";
082  }
083
084  public static class Builder extends NullableFieldTracker {
085
086    protected String clientId;
087
088    protected String clientSecret;
089
090    protected String token;
091
092    public Builder clientId(String clientId) {
093      this.clientId = clientId;
094      return this;
095    }
096
097    public Builder clientSecret(String clientSecret) {
098      this.clientSecret = clientSecret;
099      return this;
100    }
101
102    public Builder token(String token) {
103      this.token = token;
104      return this;
105    }
106
107    public PostOAuth2Revoke build() {
108      return new PostOAuth2Revoke(this);
109    }
110  }
111}