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

stripe / stripe-java / #16624

07 Nov 2024 10:04PM UTC coverage: 12.419% (-0.1%) from 12.519%
#16624

push

github

web-flow
Merge pull request #1917 from stripe/latest-codegen-beta

Update generated code for beta

17 of 1341 new or added lines in 57 files covered. (1.27%)

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 hits per line

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

20.0
/src/main/java/com/stripe/param/TaxRateUpdateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.net.ApiRequestParams;
6
import com.stripe.param.common.EmptyParam;
7
import java.util.ArrayList;
8
import java.util.HashMap;
9
import java.util.List;
10
import java.util.Map;
11
import lombok.Getter;
12

13
@Getter
14
public class TaxRateUpdateParams extends ApiRequestParams {
15
  /**
16
   * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates
17
   * cannot be used with new applications or Checkout Sessions, but will still work for
18
   * subscriptions and invoices that already have it set.
19
   */
20
  @SerializedName("active")
21
  Boolean active;
22

23
  /**
24
   * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1
25
   * alpha-2</a>).
26
   */
27
  @SerializedName("country")
28
  Object country;
29

30
  /**
31
   * An arbitrary string attached to the tax rate for your internal use only. It will not be visible
32
   * to your customers.
33
   */
34
  @SerializedName("description")
35
  Object description;
36

37
  /** The display name of the tax rate, which will be shown to users. */
38
  @SerializedName("display_name")
39
  Object displayName;
40

41
  /** Specifies which fields in the response should be expanded. */
42
  @SerializedName("expand")
43
  List<String> expand;
44

45
  /**
46
   * Map of extra parameters for custom features not available in this client library. The content
47
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
48
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
49
   * param object. Effectively, this map is flattened to its parent instance.
50
   */
51
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
52
  Map<String, Object> extraParams;
53

54
  /**
55
   * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It
56
   * also appears on your customer’s invoice.
57
   */
58
  @SerializedName("jurisdiction")
59
  Object jurisdiction;
60

61
  /**
62
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
63
   * to an object. This can be useful for storing additional information about the object in a
64
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
65
   * be unset by posting an empty value to {@code metadata}.
66
   */
67
  @SerializedName("metadata")
68
  Object metadata;
69

70
  /**
71
   * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>, without
72
   * country prefix. For example, &quot;NY&quot; for New York, United States.
73
   */
74
  @SerializedName("state")
75
  Object state;
76

77
  /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
78
  @SerializedName("tax_type")
79
  TaxType taxType;
80

81
  private TaxRateUpdateParams(
82
      Boolean active,
83
      Object country,
84
      Object description,
85
      Object displayName,
86
      List<String> expand,
87
      Map<String, Object> extraParams,
88
      Object jurisdiction,
89
      Object metadata,
90
      Object state,
91
      TaxType taxType) {
1✔
92
    this.active = active;
1✔
93
    this.country = country;
1✔
94
    this.description = description;
1✔
95
    this.displayName = displayName;
1✔
96
    this.expand = expand;
1✔
97
    this.extraParams = extraParams;
1✔
98
    this.jurisdiction = jurisdiction;
1✔
99
    this.metadata = metadata;
1✔
100
    this.state = state;
1✔
101
    this.taxType = taxType;
1✔
102
  }
1✔
103

104
  public static Builder builder() {
105
    return new Builder();
1✔
106
  }
107

108
  public static class Builder {
1✔
109
    private Boolean active;
110

111
    private Object country;
112

113
    private Object description;
114

115
    private Object displayName;
116

117
    private List<String> expand;
118

119
    private Map<String, Object> extraParams;
120

121
    private Object jurisdiction;
122

123
    private Object metadata;
124

125
    private Object state;
126

127
    private TaxType taxType;
128

129
    /** Finalize and obtain parameter instance from this builder. */
130
    public TaxRateUpdateParams build() {
131
      return new TaxRateUpdateParams(
1✔
132
          this.active,
133
          this.country,
134
          this.description,
135
          this.displayName,
136
          this.expand,
137
          this.extraParams,
138
          this.jurisdiction,
139
          this.metadata,
140
          this.state,
141
          this.taxType);
142
    }
143

144
    /**
145
     * Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates
146
     * cannot be used with new applications or Checkout Sessions, but will still work for
147
     * subscriptions and invoices that already have it set.
148
     */
149
    public Builder setActive(Boolean active) {
150
      this.active = active;
1✔
151
      return this;
1✔
152
    }
153

154
    /**
155
     * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
156
     * 3166-1 alpha-2</a>).
157
     */
158
    public Builder setCountry(String country) {
159
      this.country = country;
×
160
      return this;
×
161
    }
162

163
    /**
164
     * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
165
     * 3166-1 alpha-2</a>).
166
     */
167
    public Builder setCountry(EmptyParam country) {
168
      this.country = country;
×
169
      return this;
×
170
    }
171

172
    /**
173
     * An arbitrary string attached to the tax rate for your internal use only. It will not be
174
     * visible to your customers.
175
     */
176
    public Builder setDescription(String description) {
177
      this.description = description;
×
178
      return this;
×
179
    }
180

181
    /**
182
     * An arbitrary string attached to the tax rate for your internal use only. It will not be
183
     * visible to your customers.
184
     */
185
    public Builder setDescription(EmptyParam description) {
186
      this.description = description;
×
187
      return this;
×
188
    }
189

190
    /** The display name of the tax rate, which will be shown to users. */
191
    public Builder setDisplayName(String displayName) {
192
      this.displayName = displayName;
×
193
      return this;
×
194
    }
195

196
    /** The display name of the tax rate, which will be shown to users. */
197
    public Builder setDisplayName(EmptyParam displayName) {
198
      this.displayName = displayName;
×
199
      return this;
×
200
    }
201

202
    /**
203
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
204
     * subsequent calls adds additional elements to the original list. See {@link
205
     * TaxRateUpdateParams#expand} for the field documentation.
206
     */
207
    public Builder addExpand(String element) {
208
      if (this.expand == null) {
×
209
        this.expand = new ArrayList<>();
×
210
      }
211
      this.expand.add(element);
×
212
      return this;
×
213
    }
214

215
    /**
216
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
217
     * subsequent calls adds additional elements to the original list. See {@link
218
     * TaxRateUpdateParams#expand} for the field documentation.
219
     */
220
    public Builder addAllExpand(List<String> elements) {
221
      if (this.expand == null) {
×
222
        this.expand = new ArrayList<>();
×
223
      }
224
      this.expand.addAll(elements);
×
225
      return this;
×
226
    }
227

228
    /**
229
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
230
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
231
     * TaxRateUpdateParams#extraParams} for the field documentation.
232
     */
233
    public Builder putExtraParam(String key, Object value) {
234
      if (this.extraParams == null) {
×
235
        this.extraParams = new HashMap<>();
×
236
      }
237
      this.extraParams.put(key, value);
×
238
      return this;
×
239
    }
240

241
    /**
242
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
243
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
244
     * See {@link TaxRateUpdateParams#extraParams} for the field documentation.
245
     */
246
    public Builder putAllExtraParam(Map<String, Object> map) {
247
      if (this.extraParams == null) {
×
248
        this.extraParams = new HashMap<>();
×
249
      }
250
      this.extraParams.putAll(map);
×
251
      return this;
×
252
    }
253

254
    /**
255
     * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes.
256
     * It also appears on your customer’s invoice.
257
     */
258
    public Builder setJurisdiction(String jurisdiction) {
259
      this.jurisdiction = jurisdiction;
×
260
      return this;
×
261
    }
262

263
    /**
264
     * The jurisdiction for the tax rate. You can use this label field for tax reporting purposes.
265
     * It also appears on your customer’s invoice.
266
     */
267
    public Builder setJurisdiction(EmptyParam jurisdiction) {
268
      this.jurisdiction = jurisdiction;
×
269
      return this;
×
270
    }
271

272
    /**
273
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
274
     * and subsequent calls add additional key/value pairs to the original map. See {@link
275
     * TaxRateUpdateParams#metadata} for the field documentation.
276
     */
277
    @SuppressWarnings("unchecked")
278
    public Builder putMetadata(String key, String value) {
279
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
280
        this.metadata = new HashMap<String, String>();
×
281
      }
282
      ((Map<String, String>) this.metadata).put(key, value);
×
283
      return this;
×
284
    }
285

286
    /**
287
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
288
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
289
     * See {@link TaxRateUpdateParams#metadata} for the field documentation.
290
     */
291
    @SuppressWarnings("unchecked")
292
    public Builder putAllMetadata(Map<String, String> map) {
293
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
294
        this.metadata = new HashMap<String, String>();
×
295
      }
296
      ((Map<String, String>) this.metadata).putAll(map);
×
297
      return this;
×
298
    }
299

300
    /**
301
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
302
     * to an object. This can be useful for storing additional information about the object in a
303
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
304
     * can be unset by posting an empty value to {@code metadata}.
305
     */
306
    public Builder setMetadata(EmptyParam metadata) {
307
      this.metadata = metadata;
×
308
      return this;
×
309
    }
310

311
    /**
312
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
313
     * to an object. This can be useful for storing additional information about the object in a
314
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
315
     * can be unset by posting an empty value to {@code metadata}.
316
     */
317
    public Builder setMetadata(Map<String, String> metadata) {
318
      this.metadata = metadata;
×
319
      return this;
×
320
    }
321

322
    /**
323
     * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
324
     * without country prefix. For example, &quot;NY&quot; for New York, United States.
325
     */
326
    public Builder setState(String state) {
327
      this.state = state;
×
328
      return this;
×
329
    }
330

331
    /**
332
     * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
333
     * without country prefix. For example, &quot;NY&quot; for New York, United States.
334
     */
335
    public Builder setState(EmptyParam state) {
336
      this.state = state;
×
337
      return this;
×
338
    }
339

340
    /** The high-level tax type, such as {@code vat} or {@code sales_tax}. */
341
    public Builder setTaxType(TaxRateUpdateParams.TaxType taxType) {
342
      this.taxType = taxType;
×
343
      return this;
×
344
    }
345
  }
346

347
  public enum TaxType implements ApiRequestParams.EnumParam {
×
348
    @SerializedName("amusement_tax")
×
349
    AMUSEMENT_TAX("amusement_tax"),
350

351
    @SerializedName("communications_tax")
×
352
    COMMUNICATIONS_TAX("communications_tax"),
353

354
    @SerializedName("gst")
×
355
    GST("gst"),
356

357
    @SerializedName("hst")
×
358
    HST("hst"),
359

360
    @SerializedName("igst")
×
361
    IGST("igst"),
362

363
    @SerializedName("jct")
×
364
    JCT("jct"),
365

366
    @SerializedName("lease_tax")
×
367
    LEASE_TAX("lease_tax"),
368

369
    @SerializedName("pst")
×
370
    PST("pst"),
371

372
    @SerializedName("qst")
×
373
    QST("qst"),
374

375
    @SerializedName("retail_delivery_fee")
×
376
    RETAIL_DELIVERY_FEE("retail_delivery_fee"),
377

378
    @SerializedName("rst")
×
379
    RST("rst"),
380

381
    @SerializedName("sales_tax")
×
382
    SALES_TAX("sales_tax"),
383

NEW
384
    @SerializedName("service_tax")
×
385
    SERVICE_TAX("service_tax"),
386

UNCOV
387
    @SerializedName("vat")
×
388
    VAT("vat");
389

390
    @Getter(onMethod_ = {@Override})
391
    private final String value;
392

393
    TaxType(String value) {
×
394
      this.value = value;
×
395
    }
×
396
  }
397
}
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