package com.stripe.model;
import com.stripe.Stripe;
import com.stripe.exception.APIConnectionException;
import com.stripe.exception.APIException;
import com.stripe.exception.AuthenticationException;
import com.stripe.exception.CardException;
import com.stripe.exception.InvalidRequestException;
import com.stripe.net.APIResource;
import com.stripe.net.RequestOptions;
import java.util.Map;
public class ApplePayDomain extends APIResource implements HasId {
String id;
String object;
Long created;
String domainName;
Boolean livemode;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
public Long getCreated() {
return created;
}
public void setCreated(Long created) {
this.created = created;
}
public Boolean getLivemode() {
return livemode;
}
public void setLivemode(Boolean livemode) {
this.livemode = livemode;
}
public String getDomainName() {
return domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public static ApplePayDomain create(Map<String, Object> params)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return create(params, (RequestOptions) null);
}
public static ApplePayDomain create(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return request(RequestMethod.POST, getClassURL(), params, ApplePayDomain.class, options);
}
public static ApplePayDomain retrieve(String id) throws AuthenticationException,
InvalidRequestException, APIConnectionException, CardException,
APIException {
return retrieve(id, (RequestOptions) null);
}
public static ApplePayDomain retrieve(String id, RequestOptions options)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return request(RequestMethod.GET, getInstanceURL(id), null, ApplePayDomain.class, options);
}
public DeletedApplePayDomain delete() throws AuthenticationException,
InvalidRequestException, APIConnectionException, CardException,
APIException {
return delete((RequestOptions) null);
}
public DeletedApplePayDomain delete(RequestOptions options) throws AuthenticationException,
InvalidRequestException, APIConnectionException, CardException,
APIException {
return request(RequestMethod.DELETE, getInstanceURL(id), null, DeletedApplePayDomain.class, options);
}
public static ApplePayDomainCollection list(Map<String, Object> params)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return list(params, (RequestOptions) null);
}
public static ApplePayDomainCollection list(Map<String, Object> params, RequestOptions options)
throws AuthenticationException, InvalidRequestException,
APIConnectionException, CardException, APIException {
return requestCollection(getClassURL(), params, ApplePayDomainCollection.class, options);
}
private static String getClassURL() {
return String.format("%s/v1/%s", Stripe.getApiBase(), "apple_pay/domains");
}
private static String getInstanceURL(String id) {
if (id != null || id.isEmpty()) {
return String.format("%s/%s", getClassURL(), id);
}
return null;
}
}