com.stripe.model.terminal.Location Maven / Gradle / Ivy
// Generated by delombok at Mon May 18 17:31:35 PDT 2020
package com.stripe.model.terminal;
import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Address;
import com.stripe.model.HasId;
import com.stripe.model.MetadataStore;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.terminal.LocationCreateParams;
import com.stripe.param.terminal.LocationListParams;
import com.stripe.param.terminal.LocationRetrieveParams;
import com.stripe.param.terminal.LocationUpdateParams;
import java.util.Map;
public class Location extends ApiResource implements HasId, MetadataStore {
@SerializedName("address")
Address address;
/**
* Always true for a deleted object.
*/
@SerializedName("deleted")
Boolean deleted;
/**
* The display name of the location.
*/
@SerializedName("display_name")
String displayName;
/**
* Unique identifier for the object.
*/
@SerializedName("id")
String id;
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format.
*/
@SerializedName("metadata")
Map metadata;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code terminal.location}.
*/
@SerializedName("object")
String object;
/**
* Retrieves a Location
object.
*/
public static Location retrieve(String location) throws StripeException {
return retrieve(location, (Map) null, (RequestOptions) null);
}
/**
* Retrieves a Location
object.
*/
public static Location retrieve(String location, RequestOptions options) throws StripeException {
return retrieve(location, (Map) null, options);
}
/**
* Retrieves a Location
object.
*/
public static Location retrieve(String location, Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options);
}
/**
* Retrieves a Location
object.
*/
public static Location retrieve(String location, LocationRetrieveParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(location)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Location.class, options);
}
/**
* Creates a new Location
object.
*/
public static Location create(Map params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates a new Location
object.
*/
public static Location create(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/locations");
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Location.class, options);
}
/**
* Creates a new Location
object.
*/
public static Location create(LocationCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/**
* Creates a new Location
object.
*/
public static Location create(LocationCreateParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/locations");
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Location.class, options);
}
/**
* Updates a Location
object by setting the values of the parameters passed. Any
* parameters not provided will be left unchanged.
*/
@Override
public Location update(Map params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a Location
object by setting the values of the parameters passed. Any
* parameters not provided will be left unchanged.
*/
@Override
public Location update(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Location.class, options);
}
/**
* Updates a Location
object by setting the values of the parameters passed. Any
* parameters not provided will be left unchanged.
*/
public Location update(LocationUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates a Location
object by setting the values of the parameters passed. Any
* parameters not provided will be left unchanged.
*/
public Location update(LocationUpdateParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Location.class, options);
}
/**
* Returns a list of Location
objects.
*/
public static LocationCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of Location
objects.
*/
public static LocationCollection list(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/locations");
return ApiResource.requestCollection(url, params, LocationCollection.class, options);
}
/**
* Returns a list of Location
objects.
*/
public static LocationCollection list(LocationListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of Location
objects.
*/
public static LocationCollection list(LocationListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/terminal/locations");
return ApiResource.requestCollection(url, params, LocationCollection.class, options);
}
/**
* Deletes a Location
object.
*/
public Location delete() throws StripeException {
return delete((Map) null, (RequestOptions) null);
}
/**
* Deletes a Location
object.
*/
public Location delete(RequestOptions options) throws StripeException {
return delete((Map) null, options);
}
/**
* Deletes a Location
object.
*/
public Location delete(Map params) throws StripeException {
return delete(params, (RequestOptions) null);
}
/**
* Deletes a Location
object.
*/
public Location delete(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), String.format("/v1/terminal/locations/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(ApiResource.RequestMethod.DELETE, url, params, Location.class, options);
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Address getAddress() {
return this.address;
}
/**
* Always true for a deleted object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getDeleted() {
return this.deleted;
}
/**
* The display name of the location.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDisplayName() {
return this.displayName;
}
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getLivemode() {
return this.livemode;
}
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code terminal.location}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getObject() {
return this.object;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setAddress(final Address address) {
this.address = address;
}
/**
* Always true for a deleted object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setDeleted(final Boolean deleted) {
this.deleted = deleted;
}
/**
* The display name of the location.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setDisplayName(final String displayName) {
this.displayName = displayName;
}
/**
* Unique identifier for the object.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setId(final String id) {
this.id = id;
}
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setLivemode(final Boolean livemode) {
this.livemode = livemode;
}
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setMetadata(final Map metadata) {
this.metadata = metadata;
}
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code terminal.location}.
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setObject(final String object) {
this.object = object;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof Location)) return false;
final Location other = (Location) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$address = this.getAddress();
final java.lang.Object other$address = other.getAddress();
if (this$address == null ? other$address != null : !this$address.equals(other$address)) return false;
final java.lang.Object this$deleted = this.getDeleted();
final java.lang.Object other$deleted = other.getDeleted();
if (this$deleted == null ? other$deleted != null : !this$deleted.equals(other$deleted)) return false;
final java.lang.Object this$displayName = this.getDisplayName();
final java.lang.Object other$displayName = other.getDisplayName();
if (this$displayName == null ? other$displayName != null : !this$displayName.equals(other$displayName)) return false;
final java.lang.Object this$id = this.getId();
final java.lang.Object other$id = other.getId();
if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
final java.lang.Object this$livemode = this.getLivemode();
final java.lang.Object other$livemode = other.getLivemode();
if (this$livemode == null ? other$livemode != null : !this$livemode.equals(other$livemode)) return false;
final java.lang.Object this$metadata = this.getMetadata();
final java.lang.Object other$metadata = other.getMetadata();
if (this$metadata == null ? other$metadata != null : !this$metadata.equals(other$metadata)) return false;
final java.lang.Object this$object = this.getObject();
final java.lang.Object other$object = other.getObject();
if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof Location;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $address = this.getAddress();
result = result * PRIME + ($address == null ? 43 : $address.hashCode());
final java.lang.Object $deleted = this.getDeleted();
result = result * PRIME + ($deleted == null ? 43 : $deleted.hashCode());
final java.lang.Object $displayName = this.getDisplayName();
result = result * PRIME + ($displayName == null ? 43 : $displayName.hashCode());
final java.lang.Object $id = this.getId();
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
final java.lang.Object $livemode = this.getLivemode();
result = result * PRIME + ($livemode == null ? 43 : $livemode.hashCode());
final java.lang.Object $metadata = this.getMetadata();
result = result * PRIME + ($metadata == null ? 43 : $metadata.hashCode());
final java.lang.Object $object = this.getObject();
result = result * PRIME + ($object == null ? 43 : $object.hashCode());
return result;
}
/**
* Unique identifier for the object.
*/
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getId() {
return this.id;
}
/**
* Set of key-value pairs that you can attach to an object. This can be useful for storing
* additional information about the object in a structured format.
*/
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
}