• 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

33.33
/src/main/java/com/stripe/service/tax/FormService.java
1
// File generated from our OpenAPI spec
2
package com.stripe.service.tax;
3

4
import com.google.gson.reflect.TypeToken;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.StripeCollection;
7
import com.stripe.model.tax.Form;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.ApiService;
12
import com.stripe.net.BaseAddress;
13
import com.stripe.net.RequestOptions;
14
import com.stripe.net.StripeResponseGetter;
15
import com.stripe.param.tax.FormListParams;
16
import com.stripe.param.tax.FormPdfParams;
17
import com.stripe.param.tax.FormRetrieveParams;
18
import java.io.InputStream;
19

20
public final class FormService extends ApiService {
21
  public FormService(StripeResponseGetter responseGetter) {
22
    super(responseGetter);
1✔
23
  }
1✔
24

25
  /**
26
   * Returns a list of tax forms which were previously created. The tax forms are returned in sorted
27
   * order, with the oldest tax forms appearing first.
28
   */
29
  public StripeCollection<Form> list(FormListParams params) throws StripeException {
30
    return list(params, (RequestOptions) null);
×
31
  }
32
  /**
33
   * Returns a list of tax forms which were previously created. The tax forms are returned in sorted
34
   * order, with the oldest tax forms appearing first.
35
   */
36
  public StripeCollection<Form> list(FormListParams params, RequestOptions options)
37
      throws StripeException {
38
    String path = "/v1/tax/forms";
×
39
    ApiRequest request =
×
40
        new ApiRequest(
41
            BaseAddress.API,
42
            ApiResource.RequestMethod.GET,
43
            path,
44
            ApiRequestParams.paramsToMap(params),
×
45
            options);
UNCOV
46
    return this.request(request, new TypeToken<StripeCollection<Form>>() {}.getType());
×
47
  }
48
  /**
49
   * Retrieves the details of a tax form that has previously been created. Supply the unique tax
50
   * form ID that was returned from your previous request, and Stripe will return the corresponding
51
   * tax form information.
52
   */
53
  public Form retrieve(String id, FormRetrieveParams params) throws StripeException {
54
    return retrieve(id, params, (RequestOptions) null);
×
55
  }
56
  /**
57
   * Retrieves the details of a tax form that has previously been created. Supply the unique tax
58
   * form ID that was returned from your previous request, and Stripe will return the corresponding
59
   * tax form information.
60
   */
61
  public Form retrieve(String id, RequestOptions options) throws StripeException {
62
    return retrieve(id, (FormRetrieveParams) null, options);
×
63
  }
64
  /**
65
   * Retrieves the details of a tax form that has previously been created. Supply the unique tax
66
   * form ID that was returned from your previous request, and Stripe will return the corresponding
67
   * tax form information.
68
   */
69
  public Form retrieve(String id) throws StripeException {
70
    return retrieve(id, (FormRetrieveParams) null, (RequestOptions) null);
×
71
  }
72
  /**
73
   * Retrieves the details of a tax form that has previously been created. Supply the unique tax
74
   * form ID that was returned from your previous request, and Stripe will return the corresponding
75
   * tax form information.
76
   */
77
  public Form retrieve(String id, FormRetrieveParams params, RequestOptions options)
78
      throws StripeException {
79
    String path = String.format("/v1/tax/forms/%s", ApiResource.urlEncodeId(id));
×
80
    ApiRequest request =
×
81
        new ApiRequest(
82
            BaseAddress.API,
83
            ApiResource.RequestMethod.GET,
84
            path,
85
            ApiRequestParams.paramsToMap(params),
×
86
            options);
UNCOV
87
    return this.request(request, Form.class);
×
88
  }
89
  /** Download the PDF for a tax form. */
90
  public InputStream pdf(String id, FormPdfParams params) throws StripeException {
91
    return pdf(id, params, (RequestOptions) null);
1✔
92
  }
93
  /** Download the PDF for a tax form. */
94
  public InputStream pdf(String id, RequestOptions options) throws StripeException {
95
    return pdf(id, (FormPdfParams) null, options);
×
96
  }
97
  /** Download the PDF for a tax form. */
98
  public InputStream pdf(String id) throws StripeException {
99
    return pdf(id, (FormPdfParams) null, (RequestOptions) null);
×
100
  }
101
  /** Download the PDF for a tax form. */
102
  public InputStream pdf(String id, FormPdfParams params, RequestOptions options)
103
      throws StripeException {
104
    String path = String.format("/v1/tax/forms/%s/pdf", ApiResource.urlEncodeId(id));
1✔
105
    ApiRequest request =
1✔
106
        new ApiRequest(
107
            BaseAddress.FILES,
108
            ApiResource.RequestMethod.GET,
109
            path,
110
            ApiRequestParams.paramsToMap(params),
1✔
111
            options);
112
    return this.requestStream(request);
1✔
113
  }
114
}
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