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

stripe / stripe-java / #14624

pending completion
#14624

Pull #1596

github-actions

web-flow
Merge aa276e476 into 0adfd1352
Pull Request #1596: Add StripeClient

10149 of 10149 new or added lines in 282 files covered. (100.0%)

14798 of 78436 relevant lines covered (18.87%)

0.19 hits per line

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

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

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiMode;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.param.TaxCodeListParams;
12
import com.stripe.param.TaxCodeRetrieveParams;
13
import java.util.Map;
14
import lombok.EqualsAndHashCode;
15
import lombok.Getter;
16
import lombok.Setter;
17

18
/**
19
 * <a href="https://stripe.com/docs/tax/tax-categories">Tax codes</a> classify goods and services
20
 * for tax purposes.
21
 */
22
@Getter
23
@Setter
24
@EqualsAndHashCode(callSuper = false)
25
public class TaxCode extends ApiResource implements HasId {
1✔
26
  /** A detailed description of which types of products the tax code represents. */
27
  @SerializedName("description")
28
  String description;
29

30
  /** Unique identifier for the object. */
31
  @Getter(onMethod_ = {@Override})
32
  @SerializedName("id")
33
  String id;
34

35
  /** A short name for the tax code. */
36
  @SerializedName("name")
37
  String name;
38

39
  /**
40
   * String representing the object's type. Objects of the same type share the same value.
41
   *
42
   * <p>Equal to {@code tax_code}.
43
   */
44
  @SerializedName("object")
45
  String object;
46

47
  /**
48
   * A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes available</a> to
49
   * add to Products in order to allow specific tax calculations.
50
   */
51
  public static TaxCodeCollection list(Map<String, Object> params) throws StripeException {
52
    return list(params, (RequestOptions) null);
1✔
53
  }
54

55
  /**
56
   * A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes available</a> to
57
   * add to Products in order to allow specific tax calculations.
58
   */
59
  public static TaxCodeCollection list(Map<String, Object> params, RequestOptions options)
60
      throws StripeException {
61
    String url = "/v1/tax_codes";
1✔
62
    return getGlobalResponseGetter()
1✔
63
        .request(
1✔
64
            BaseAddress.API,
65
            ApiResource.RequestMethod.GET,
66
            url,
67
            params,
68
            TaxCodeCollection.class,
69
            options,
70
            ApiMode.V1);
71
  }
72

73
  /**
74
   * A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes available</a> to
75
   * add to Products in order to allow specific tax calculations.
76
   */
77
  public static TaxCodeCollection list(TaxCodeListParams params) throws StripeException {
78
    return list(params, (RequestOptions) null);
1✔
79
  }
80

81
  /**
82
   * A list of <a href="https://stripe.com/docs/tax/tax-categories">all tax codes available</a> to
83
   * add to Products in order to allow specific tax calculations.
84
   */
85
  public static TaxCodeCollection list(TaxCodeListParams params, RequestOptions options)
86
      throws StripeException {
87
    String url = "/v1/tax_codes";
1✔
88
    ApiResource.checkNullTypedParams(url, params);
1✔
89
    return getGlobalResponseGetter()
1✔
90
        .request(
1✔
91
            BaseAddress.API,
92
            ApiResource.RequestMethod.GET,
93
            url,
94
            ApiRequestParams.paramsToMap(params),
1✔
95
            TaxCodeCollection.class,
96
            options,
97
            ApiMode.V1);
98
  }
99

100
  /**
101
   * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will
102
   * return the corresponding tax code information.
103
   */
104
  public static TaxCode retrieve(String id) throws StripeException {
105
    return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
1✔
106
  }
107

108
  /**
109
   * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will
110
   * return the corresponding tax code information.
111
   */
112
  public static TaxCode retrieve(String id, RequestOptions options) throws StripeException {
113
    return retrieve(id, (Map<String, Object>) null, options);
×
114
  }
115

116
  /**
117
   * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will
118
   * return the corresponding tax code information.
119
   */
120
  public static TaxCode retrieve(String id, Map<String, Object> params, RequestOptions options)
121
      throws StripeException {
122
    String url = String.format("/v1/tax_codes/%s", ApiResource.urlEncodeId(id));
1✔
123
    return getGlobalResponseGetter()
1✔
124
        .request(
1✔
125
            BaseAddress.API,
126
            ApiResource.RequestMethod.GET,
127
            url,
128
            params,
129
            TaxCode.class,
130
            options,
131
            ApiMode.V1);
132
  }
133

134
  /**
135
   * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will
136
   * return the corresponding tax code information.
137
   */
138
  public static TaxCode retrieve(String id, TaxCodeRetrieveParams params, RequestOptions options)
139
      throws StripeException {
140
    String url = String.format("/v1/tax_codes/%s", ApiResource.urlEncodeId(id));
×
141
    ApiResource.checkNullTypedParams(url, params);
×
142
    return getGlobalResponseGetter()
×
143
        .request(
×
144
            BaseAddress.API,
145
            ApiResource.RequestMethod.GET,
146
            url,
147
            ApiRequestParams.paramsToMap(params),
×
148
            TaxCode.class,
149
            options,
150
            ApiMode.V1);
151
  }
152
}
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

© 2025 Coveralls, Inc