• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

61.29
/src/main/java/com/stripe/model/PersonCollection.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.stripe.exception.StripeException;
5
import com.stripe.net.ApiRequest;
6
import com.stripe.net.ApiRequestParams;
7
import com.stripe.net.ApiResource;
8
import com.stripe.net.BaseAddress;
9
import com.stripe.net.RequestOptions;
10
import com.stripe.param.PersonCollectionCreateParams;
11
import com.stripe.param.PersonCollectionListParams;
12
import com.stripe.param.PersonCollectionRetrieveParams;
13
import java.util.Map;
14

15
public class PersonCollection extends StripeCollection<Person> {
1✔
16
  /** Creates a new person. */
17
  public Person create(Map<String, Object> params) throws StripeException {
18
    return create(params, (RequestOptions) null);
1✔
19
  }
20

21
  /** Creates a new person. */
22
  public Person create(Map<String, Object> params, RequestOptions options) throws StripeException {
23
    String path = this.getUrl();
1✔
24
    ApiRequest request =
1✔
25
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
26
    return getResponseGetter().request(request, Person.class);
1✔
27
  }
28

29
  /** Creates a new person. */
30
  public Person create(PersonCollectionCreateParams params) throws StripeException {
31
    return create(params, (RequestOptions) null);
1✔
32
  }
33

34
  /** Creates a new person. */
35
  public Person create(PersonCollectionCreateParams params, RequestOptions options)
36
      throws StripeException {
37
    String path = this.getUrl();
1✔
38
    ApiResource.checkNullTypedParams(path, params);
1✔
39
    ApiRequest request =
1✔
40
        new ApiRequest(
41
            BaseAddress.API,
42
            ApiResource.RequestMethod.POST,
43
            path,
44
            ApiRequestParams.paramsToMap(params),
1✔
45
            options);
46
    return getResponseGetter().request(request, Person.class);
1✔
47
  }
48

49
  /**
50
   * Returns a list of people associated with the account’s legal entity. The people are returned
51
   * sorted by creation date, with the most recent people appearing first.
52
   */
53
  public PersonCollection list(Map<String, Object> params) throws StripeException {
54
    return list(params, (RequestOptions) null);
1✔
55
  }
56

57
  /**
58
   * Returns a list of people associated with the account’s legal entity. The people are returned
59
   * sorted by creation date, with the most recent people appearing first.
60
   */
61
  public PersonCollection list(Map<String, Object> params, RequestOptions options)
62
      throws StripeException {
63
    String path = this.getUrl();
1✔
64
    ApiRequest request =
1✔
65
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
66
    return getResponseGetter().request(request, PersonCollection.class);
1✔
67
  }
68

69
  /**
70
   * Returns a list of people associated with the account’s legal entity. The people are returned
71
   * sorted by creation date, with the most recent people appearing first.
72
   */
73
  public PersonCollection list(PersonCollectionListParams params) throws StripeException {
74
    return list(params, (RequestOptions) null);
×
75
  }
76

77
  /**
78
   * Returns a list of people associated with the account’s legal entity. The people are returned
79
   * sorted by creation date, with the most recent people appearing first.
80
   */
81
  public PersonCollection list(PersonCollectionListParams params, RequestOptions options)
82
      throws StripeException {
83
    String path = this.getUrl();
×
84
    ApiResource.checkNullTypedParams(path, params);
×
85
    ApiRequest request =
×
86
        new ApiRequest(
87
            BaseAddress.API,
88
            ApiResource.RequestMethod.GET,
89
            path,
90
            ApiRequestParams.paramsToMap(params),
×
91
            options);
UNCOV
92
    return getResponseGetter().request(request, PersonCollection.class);
×
93
  }
94

95
  /** Retrieves an existing person. */
96
  public Person retrieve(String id) throws StripeException {
97
    return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
1✔
98
  }
99

100
  /** Retrieves an existing person. */
101
  public Person retrieve(String id, RequestOptions options) throws StripeException {
102
    return retrieve(id, (Map<String, Object>) null, options);
×
103
  }
104

105
  /** Retrieves an existing person. */
106
  public Person retrieve(String id, Map<String, Object> params, RequestOptions options)
107
      throws StripeException {
108
    String path = String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id));
1✔
109
    ApiRequest request =
1✔
110
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
111
    return getResponseGetter().request(request, Person.class);
1✔
112
  }
113

114
  /** Retrieves an existing person. */
115
  public Person retrieve(String id, PersonCollectionRetrieveParams params, RequestOptions options)
116
      throws StripeException {
117
    String path = String.format("%s/%s", this.getUrl(), ApiResource.urlEncodeId(id));
×
118
    ApiResource.checkNullTypedParams(path, params);
×
119
    ApiRequest request =
×
120
        new ApiRequest(
121
            BaseAddress.API,
122
            ApiResource.RequestMethod.GET,
123
            path,
124
            ApiRequestParams.paramsToMap(params),
×
125
            options);
UNCOV
126
    return getResponseGetter().request(request, Person.class);
×
127
  }
128
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc