com.stripe.model.PersonCollection Maven / Gradle / Ivy
// File generated from our OpenAPI spec
package com.stripe.model;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.PersonCollectionCreateParams;
import com.stripe.param.PersonCollectionListParams;
import com.stripe.param.PersonCollectionRetrieveParams;
import java.util.Map;
public class PersonCollection extends StripeCollection {
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection list(Map params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, PersonCollection.class, options);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection list(PersonCollectionListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of people associated with the account’s legal entity. The people are returned
* sorted by creation date, with the most recent people appearing first.
*/
public PersonCollection list(PersonCollectionListParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.requestCollection(url, params, PersonCollection.class, options);
}
/** Retrieves an existing person. */
public Person retrieve(String id) throws StripeException {
return retrieve(id, (Map) null, (RequestOptions) null);
}
/** Retrieves an existing person. */
public Person retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, (Map) null, options);
}
/** Retrieves an existing person. */
public Person retrieve(String id, Map params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Person.class, options);
}
/** Retrieves an existing person. */
public Person retrieve(String id, PersonCollectionRetrieveParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id)));
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Person.class, options);
}
/** Creates a new person. */
public Person create(Map params) throws StripeException {
return create(params, (RequestOptions) null);
}
/** Creates a new person. */
public Person create(Map params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options);
}
/** Creates a new person. */
public Person create(PersonCollectionCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/** Creates a new person. */
public Person create(PersonCollectionCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), this.getUrl());
return ApiResource.request(ApiResource.RequestMethod.POST, url, params, Person.class, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy