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

stripe / stripe-java / #16562

18 Oct 2024 07:00PM UTC coverage: 12.614% (-0.1%) from 12.74%
#16562

push

github

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

Update generated code for beta

49 of 1978 new or added lines in 47 files covered. (2.48%)

68 existing lines in 20 files now uncovered.

18798 of 149026 relevant lines covered (12.61%)

0.13 hits per line

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

19.28
/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.billingportal;
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 ConfigurationCreateParams extends ApiRequestParams {
15
  /** The business information shown to customers in the portal. */
16
  @SerializedName("business_profile")
17
  BusinessProfile businessProfile;
18

19
  /**
20
   * The default URL to redirect customers to when they click on the portal's link to return to your
21
   * website. This can be <a
22
   * href="https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url">overriden</a>
23
   * when creating the session.
24
   */
25
  @SerializedName("default_return_url")
26
  Object defaultReturnUrl;
27

28
  /** Specifies which fields in the response should be expanded. */
29
  @SerializedName("expand")
30
  List<String> expand;
31

32
  /**
33
   * Map of extra parameters for custom features not available in this client library. The content
34
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
35
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
36
   * param object. Effectively, this map is flattened to its parent instance.
37
   */
38
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
39
  Map<String, Object> extraParams;
40

41
  /** <strong>Required.</strong> Information about the features available in the portal. */
42
  @SerializedName("features")
43
  Features features;
44

45
  /**
46
   * The hosted login page for this configuration. Learn more about the portal login page in our <a
47
   * href="https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share">integration
48
   * docs</a>.
49
   */
50
  @SerializedName("login_page")
51
  LoginPage loginPage;
52

53
  /**
54
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
55
   * to an object. This can be useful for storing additional information about the object in a
56
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
57
   * be unset by posting an empty value to {@code metadata}.
58
   */
59
  @SerializedName("metadata")
60
  Map<String, String> metadata;
61

62
  private ConfigurationCreateParams(
63
      BusinessProfile businessProfile,
64
      Object defaultReturnUrl,
65
      List<String> expand,
66
      Map<String, Object> extraParams,
67
      Features features,
68
      LoginPage loginPage,
69
      Map<String, String> metadata) {
1✔
70
    this.businessProfile = businessProfile;
1✔
71
    this.defaultReturnUrl = defaultReturnUrl;
1✔
72
    this.expand = expand;
1✔
73
    this.extraParams = extraParams;
1✔
74
    this.features = features;
1✔
75
    this.loginPage = loginPage;
1✔
76
    this.metadata = metadata;
1✔
77
  }
1✔
78

79
  public static Builder builder() {
80
    return new Builder();
1✔
81
  }
82

83
  public static class Builder {
1✔
84
    private BusinessProfile businessProfile;
85

86
    private Object defaultReturnUrl;
87

88
    private List<String> expand;
89

90
    private Map<String, Object> extraParams;
91

92
    private Features features;
93

94
    private LoginPage loginPage;
95

96
    private Map<String, String> metadata;
97

98
    /** Finalize and obtain parameter instance from this builder. */
99
    public ConfigurationCreateParams build() {
100
      return new ConfigurationCreateParams(
1✔
101
          this.businessProfile,
102
          this.defaultReturnUrl,
103
          this.expand,
104
          this.extraParams,
105
          this.features,
106
          this.loginPage,
107
          this.metadata);
108
    }
109

110
    /** The business information shown to customers in the portal. */
111
    public Builder setBusinessProfile(ConfigurationCreateParams.BusinessProfile businessProfile) {
112
      this.businessProfile = businessProfile;
1✔
113
      return this;
1✔
114
    }
115

116
    /**
117
     * The default URL to redirect customers to when they click on the portal's link to return to
118
     * your website. This can be <a
119
     * href="https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url">overriden</a>
120
     * when creating the session.
121
     */
122
    public Builder setDefaultReturnUrl(String defaultReturnUrl) {
123
      this.defaultReturnUrl = defaultReturnUrl;
×
124
      return this;
×
125
    }
126

127
    /**
128
     * The default URL to redirect customers to when they click on the portal's link to return to
129
     * your website. This can be <a
130
     * href="https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url">overriden</a>
131
     * when creating the session.
132
     */
133
    public Builder setDefaultReturnUrl(EmptyParam defaultReturnUrl) {
134
      this.defaultReturnUrl = defaultReturnUrl;
×
135
      return this;
×
136
    }
137

138
    /**
139
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
140
     * subsequent calls adds additional elements to the original list. See {@link
141
     * ConfigurationCreateParams#expand} for the field documentation.
142
     */
143
    public Builder addExpand(String element) {
144
      if (this.expand == null) {
×
145
        this.expand = new ArrayList<>();
×
146
      }
147
      this.expand.add(element);
×
148
      return this;
×
149
    }
150

151
    /**
152
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
153
     * subsequent calls adds additional elements to the original list. See {@link
154
     * ConfigurationCreateParams#expand} for the field documentation.
155
     */
156
    public Builder addAllExpand(List<String> elements) {
157
      if (this.expand == null) {
×
158
        this.expand = new ArrayList<>();
×
159
      }
160
      this.expand.addAll(elements);
×
161
      return this;
×
162
    }
163

164
    /**
165
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
166
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
167
     * ConfigurationCreateParams#extraParams} for the field documentation.
168
     */
169
    public Builder putExtraParam(String key, Object value) {
170
      if (this.extraParams == null) {
×
171
        this.extraParams = new HashMap<>();
×
172
      }
173
      this.extraParams.put(key, value);
×
174
      return this;
×
175
    }
176

177
    /**
178
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
179
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
180
     * See {@link ConfigurationCreateParams#extraParams} for the field documentation.
181
     */
182
    public Builder putAllExtraParam(Map<String, Object> map) {
183
      if (this.extraParams == null) {
×
184
        this.extraParams = new HashMap<>();
×
185
      }
186
      this.extraParams.putAll(map);
×
187
      return this;
×
188
    }
189

190
    /** <strong>Required.</strong> Information about the features available in the portal. */
191
    public Builder setFeatures(ConfigurationCreateParams.Features features) {
192
      this.features = features;
1✔
193
      return this;
1✔
194
    }
195

196
    /**
197
     * The hosted login page for this configuration. Learn more about the portal login page in our
198
     * <a
199
     * href="https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share">integration
200
     * docs</a>.
201
     */
202
    public Builder setLoginPage(ConfigurationCreateParams.LoginPage loginPage) {
203
      this.loginPage = loginPage;
×
204
      return this;
×
205
    }
206

207
    /**
208
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
209
     * and subsequent calls add additional key/value pairs to the original map. See {@link
210
     * ConfigurationCreateParams#metadata} for the field documentation.
211
     */
212
    public Builder putMetadata(String key, String value) {
213
      if (this.metadata == null) {
×
214
        this.metadata = new HashMap<>();
×
215
      }
216
      this.metadata.put(key, value);
×
217
      return this;
×
218
    }
219

220
    /**
221
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
222
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
223
     * See {@link ConfigurationCreateParams#metadata} for the field documentation.
224
     */
225
    public Builder putAllMetadata(Map<String, String> map) {
226
      if (this.metadata == null) {
×
227
        this.metadata = new HashMap<>();
×
228
      }
229
      this.metadata.putAll(map);
×
230
      return this;
×
231
    }
232
  }
233

234
  @Getter
235
  public static class BusinessProfile {
236
    /**
237
     * Map of extra parameters for custom features not available in this client library. The content
238
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
239
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
240
     * param object. Effectively, this map is flattened to its parent instance.
241
     */
242
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
243
    Map<String, Object> extraParams;
244

245
    /** The messaging shown to customers in the portal. */
246
    @SerializedName("headline")
247
    Object headline;
248

249
    /** A link to the business’s publicly available privacy policy. */
250
    @SerializedName("privacy_policy_url")
251
    String privacyPolicyUrl;
252

253
    /** A link to the business’s publicly available terms of service. */
254
    @SerializedName("terms_of_service_url")
255
    String termsOfServiceUrl;
256

257
    private BusinessProfile(
258
        Map<String, Object> extraParams,
259
        Object headline,
260
        String privacyPolicyUrl,
261
        String termsOfServiceUrl) {
1✔
262
      this.extraParams = extraParams;
1✔
263
      this.headline = headline;
1✔
264
      this.privacyPolicyUrl = privacyPolicyUrl;
1✔
265
      this.termsOfServiceUrl = termsOfServiceUrl;
1✔
266
    }
1✔
267

268
    public static Builder builder() {
269
      return new Builder();
1✔
270
    }
271

272
    public static class Builder {
1✔
273
      private Map<String, Object> extraParams;
274

275
      private Object headline;
276

277
      private String privacyPolicyUrl;
278

279
      private String termsOfServiceUrl;
280

281
      /** Finalize and obtain parameter instance from this builder. */
282
      public ConfigurationCreateParams.BusinessProfile build() {
283
        return new ConfigurationCreateParams.BusinessProfile(
1✔
284
            this.extraParams, this.headline, this.privacyPolicyUrl, this.termsOfServiceUrl);
285
      }
286

287
      /**
288
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
289
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
290
       * ConfigurationCreateParams.BusinessProfile#extraParams} for the field documentation.
291
       */
292
      public Builder putExtraParam(String key, Object value) {
293
        if (this.extraParams == null) {
×
294
          this.extraParams = new HashMap<>();
×
295
        }
296
        this.extraParams.put(key, value);
×
297
        return this;
×
298
      }
299

300
      /**
301
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
302
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
303
       * See {@link ConfigurationCreateParams.BusinessProfile#extraParams} for the field
304
       * documentation.
305
       */
306
      public Builder putAllExtraParam(Map<String, Object> map) {
307
        if (this.extraParams == null) {
×
308
          this.extraParams = new HashMap<>();
×
309
        }
310
        this.extraParams.putAll(map);
×
311
        return this;
×
312
      }
313

314
      /** The messaging shown to customers in the portal. */
315
      public Builder setHeadline(String headline) {
316
        this.headline = headline;
×
317
        return this;
×
318
      }
319

320
      /** The messaging shown to customers in the portal. */
321
      public Builder setHeadline(EmptyParam headline) {
322
        this.headline = headline;
×
323
        return this;
×
324
      }
325

326
      /** A link to the business’s publicly available privacy policy. */
327
      public Builder setPrivacyPolicyUrl(String privacyPolicyUrl) {
328
        this.privacyPolicyUrl = privacyPolicyUrl;
1✔
329
        return this;
1✔
330
      }
331

332
      /** A link to the business’s publicly available terms of service. */
333
      public Builder setTermsOfServiceUrl(String termsOfServiceUrl) {
334
        this.termsOfServiceUrl = termsOfServiceUrl;
1✔
335
        return this;
1✔
336
      }
337
    }
338
  }
339

340
  @Getter
341
  public static class Features {
342
    /** Information about updating the customer details in the portal. */
343
    @SerializedName("customer_update")
344
    CustomerUpdate customerUpdate;
345

346
    /**
347
     * Map of extra parameters for custom features not available in this client library. The content
348
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
349
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
350
     * param object. Effectively, this map is flattened to its parent instance.
351
     */
352
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
353
    Map<String, Object> extraParams;
354

355
    /** Information about showing the billing history in the portal. */
356
    @SerializedName("invoice_history")
357
    InvoiceHistory invoiceHistory;
358

359
    /** Information about updating payment methods in the portal. */
360
    @SerializedName("payment_method_update")
361
    PaymentMethodUpdate paymentMethodUpdate;
362

363
    /** Information about canceling subscriptions in the portal. */
364
    @SerializedName("subscription_cancel")
365
    SubscriptionCancel subscriptionCancel;
366

367
    /** Information about updating subscriptions in the portal. */
368
    @SerializedName("subscription_update")
369
    SubscriptionUpdate subscriptionUpdate;
370

371
    private Features(
372
        CustomerUpdate customerUpdate,
373
        Map<String, Object> extraParams,
374
        InvoiceHistory invoiceHistory,
375
        PaymentMethodUpdate paymentMethodUpdate,
376
        SubscriptionCancel subscriptionCancel,
377
        SubscriptionUpdate subscriptionUpdate) {
1✔
378
      this.customerUpdate = customerUpdate;
1✔
379
      this.extraParams = extraParams;
1✔
380
      this.invoiceHistory = invoiceHistory;
1✔
381
      this.paymentMethodUpdate = paymentMethodUpdate;
1✔
382
      this.subscriptionCancel = subscriptionCancel;
1✔
383
      this.subscriptionUpdate = subscriptionUpdate;
1✔
384
    }
1✔
385

386
    public static Builder builder() {
387
      return new Builder();
1✔
388
    }
389

390
    public static class Builder {
1✔
391
      private CustomerUpdate customerUpdate;
392

393
      private Map<String, Object> extraParams;
394

395
      private InvoiceHistory invoiceHistory;
396

397
      private PaymentMethodUpdate paymentMethodUpdate;
398

399
      private SubscriptionCancel subscriptionCancel;
400

401
      private SubscriptionUpdate subscriptionUpdate;
402

403
      /** Finalize and obtain parameter instance from this builder. */
404
      public ConfigurationCreateParams.Features build() {
405
        return new ConfigurationCreateParams.Features(
1✔
406
            this.customerUpdate,
407
            this.extraParams,
408
            this.invoiceHistory,
409
            this.paymentMethodUpdate,
410
            this.subscriptionCancel,
411
            this.subscriptionUpdate);
412
      }
413

414
      /** Information about updating the customer details in the portal. */
415
      public Builder setCustomerUpdate(
416
          ConfigurationCreateParams.Features.CustomerUpdate customerUpdate) {
417
        this.customerUpdate = customerUpdate;
1✔
418
        return this;
1✔
419
      }
420

421
      /**
422
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
423
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
424
       * ConfigurationCreateParams.Features#extraParams} for the field documentation.
425
       */
426
      public Builder putExtraParam(String key, Object value) {
427
        if (this.extraParams == null) {
×
428
          this.extraParams = new HashMap<>();
×
429
        }
430
        this.extraParams.put(key, value);
×
431
        return this;
×
432
      }
433

434
      /**
435
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
436
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
437
       * See {@link ConfigurationCreateParams.Features#extraParams} for the field documentation.
438
       */
439
      public Builder putAllExtraParam(Map<String, Object> map) {
440
        if (this.extraParams == null) {
×
441
          this.extraParams = new HashMap<>();
×
442
        }
443
        this.extraParams.putAll(map);
×
444
        return this;
×
445
      }
446

447
      /** Information about showing the billing history in the portal. */
448
      public Builder setInvoiceHistory(
449
          ConfigurationCreateParams.Features.InvoiceHistory invoiceHistory) {
450
        this.invoiceHistory = invoiceHistory;
1✔
451
        return this;
1✔
452
      }
453

454
      /** Information about updating payment methods in the portal. */
455
      public Builder setPaymentMethodUpdate(
456
          ConfigurationCreateParams.Features.PaymentMethodUpdate paymentMethodUpdate) {
457
        this.paymentMethodUpdate = paymentMethodUpdate;
×
458
        return this;
×
459
      }
460

461
      /** Information about canceling subscriptions in the portal. */
462
      public Builder setSubscriptionCancel(
463
          ConfigurationCreateParams.Features.SubscriptionCancel subscriptionCancel) {
464
        this.subscriptionCancel = subscriptionCancel;
×
465
        return this;
×
466
      }
467

468
      /** Information about updating subscriptions in the portal. */
469
      public Builder setSubscriptionUpdate(
470
          ConfigurationCreateParams.Features.SubscriptionUpdate subscriptionUpdate) {
471
        this.subscriptionUpdate = subscriptionUpdate;
×
472
        return this;
×
473
      }
474
    }
475

476
    @Getter
477
    public static class CustomerUpdate {
478
      /**
479
       * The types of customer updates that are supported. When empty, customers are not updateable.
480
       */
481
      @SerializedName("allowed_updates")
482
      Object allowedUpdates;
483

484
      /** <strong>Required.</strong> Whether the feature is enabled. */
485
      @SerializedName("enabled")
486
      Boolean enabled;
487

488
      /**
489
       * Map of extra parameters for custom features not available in this client library. The
490
       * content in this map is not serialized under this field's {@code @SerializedName} value.
491
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
492
       * name in this param object. Effectively, this map is flattened to its parent instance.
493
       */
494
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
495
      Map<String, Object> extraParams;
496

497
      private CustomerUpdate(
498
          Object allowedUpdates, Boolean enabled, Map<String, Object> extraParams) {
1✔
499
        this.allowedUpdates = allowedUpdates;
1✔
500
        this.enabled = enabled;
1✔
501
        this.extraParams = extraParams;
1✔
502
      }
1✔
503

504
      public static Builder builder() {
505
        return new Builder();
1✔
506
      }
507

508
      public static class Builder {
1✔
509
        private Object allowedUpdates;
510

511
        private Boolean enabled;
512

513
        private Map<String, Object> extraParams;
514

515
        /** Finalize and obtain parameter instance from this builder. */
516
        public ConfigurationCreateParams.Features.CustomerUpdate build() {
517
          return new ConfigurationCreateParams.Features.CustomerUpdate(
1✔
518
              this.allowedUpdates, this.enabled, this.extraParams);
519
        }
520

521
        /**
522
         * Add an element to `allowedUpdates` list. A list is initialized for the first `add/addAll`
523
         * call, and subsequent calls adds additional elements to the original list. See {@link
524
         * ConfigurationCreateParams.Features.CustomerUpdate#allowedUpdates} for the field
525
         * documentation.
526
         */
527
        @SuppressWarnings("unchecked")
528
        public Builder addAllowedUpdate(
529
            ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate element) {
530
          if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) {
1✔
531
            this.allowedUpdates =
1✔
532
                new ArrayList<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate>();
533
          }
534
          ((List<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate>)
1✔
535
                  this.allowedUpdates)
536
              .add(element);
1✔
537
          return this;
1✔
538
        }
539

540
        /**
541
         * Add all elements to `allowedUpdates` list. A list is initialized for the first
542
         * `add/addAll` call, and subsequent calls adds additional elements to the original list.
543
         * See {@link ConfigurationCreateParams.Features.CustomerUpdate#allowedUpdates} for the
544
         * field documentation.
545
         */
546
        @SuppressWarnings("unchecked")
547
        public Builder addAllAllowedUpdate(
548
            List<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate> elements) {
549
          if (this.allowedUpdates == null || this.allowedUpdates instanceof EmptyParam) {
×
550
            this.allowedUpdates =
×
551
                new ArrayList<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate>();
552
          }
553
          ((List<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate>)
×
554
                  this.allowedUpdates)
555
              .addAll(elements);
×
556
          return this;
×
557
        }
558

559
        /**
560
         * The types of customer updates that are supported. When empty, customers are not
561
         * updateable.
562
         */
563
        public Builder setAllowedUpdates(EmptyParam allowedUpdates) {
564
          this.allowedUpdates = allowedUpdates;
×
565
          return this;
×
566
        }
567

568
        /**
569
         * The types of customer updates that are supported. When empty, customers are not
570
         * updateable.
571
         */
572
        public Builder setAllowedUpdates(
573
            List<ConfigurationCreateParams.Features.CustomerUpdate.AllowedUpdate> allowedUpdates) {
574
          this.allowedUpdates = allowedUpdates;
1✔
575
          return this;
1✔
576
        }
577

578
        /** <strong>Required.</strong> Whether the feature is enabled. */
579
        public Builder setEnabled(Boolean enabled) {
580
          this.enabled = enabled;
1✔
581
          return this;
1✔
582
        }
583

584
        /**
585
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
586
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
587
         * map. See {@link ConfigurationCreateParams.Features.CustomerUpdate#extraParams} for the
588
         * field documentation.
589
         */
590
        public Builder putExtraParam(String key, Object value) {
591
          if (this.extraParams == null) {
×
592
            this.extraParams = new HashMap<>();
×
593
          }
594
          this.extraParams.put(key, value);
×
595
          return this;
×
596
        }
597

598
        /**
599
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
600
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
601
         * map. See {@link ConfigurationCreateParams.Features.CustomerUpdate#extraParams} for the
602
         * field documentation.
603
         */
604
        public Builder putAllExtraParam(Map<String, Object> map) {
605
          if (this.extraParams == null) {
×
606
            this.extraParams = new HashMap<>();
×
607
          }
608
          this.extraParams.putAll(map);
×
609
          return this;
×
610
        }
611
      }
612

613
      public enum AllowedUpdate implements ApiRequestParams.EnumParam {
1✔
614
        @SerializedName("address")
1✔
615
        ADDRESS("address"),
616

617
        @SerializedName("email")
1✔
618
        EMAIL("email"),
619

620
        @SerializedName("name")
1✔
621
        NAME("name"),
622

623
        @SerializedName("phone")
1✔
624
        PHONE("phone"),
625

626
        @SerializedName("shipping")
1✔
627
        SHIPPING("shipping"),
628

629
        @SerializedName("tax_id")
1✔
630
        TAX_ID("tax_id");
631

632
        @Getter(onMethod_ = {@Override})
633
        private final String value;
634

635
        AllowedUpdate(String value) {
1✔
636
          this.value = value;
1✔
637
        }
1✔
638
      }
639
    }
640

641
    @Getter
642
    public static class InvoiceHistory {
643
      /** <strong>Required.</strong> Whether the feature is enabled. */
644
      @SerializedName("enabled")
645
      Boolean enabled;
646

647
      /**
648
       * Map of extra parameters for custom features not available in this client library. The
649
       * content in this map is not serialized under this field's {@code @SerializedName} value.
650
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
651
       * name in this param object. Effectively, this map is flattened to its parent instance.
652
       */
653
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
654
      Map<String, Object> extraParams;
655

656
      private InvoiceHistory(Boolean enabled, Map<String, Object> extraParams) {
1✔
657
        this.enabled = enabled;
1✔
658
        this.extraParams = extraParams;
1✔
659
      }
1✔
660

661
      public static Builder builder() {
662
        return new Builder();
1✔
663
      }
664

665
      public static class Builder {
1✔
666
        private Boolean enabled;
667

668
        private Map<String, Object> extraParams;
669

670
        /** Finalize and obtain parameter instance from this builder. */
671
        public ConfigurationCreateParams.Features.InvoiceHistory build() {
672
          return new ConfigurationCreateParams.Features.InvoiceHistory(
1✔
673
              this.enabled, this.extraParams);
674
        }
675

676
        /** <strong>Required.</strong> Whether the feature is enabled. */
677
        public Builder setEnabled(Boolean enabled) {
678
          this.enabled = enabled;
1✔
679
          return this;
1✔
680
        }
681

682
        /**
683
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
684
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
685
         * map. See {@link ConfigurationCreateParams.Features.InvoiceHistory#extraParams} for the
686
         * field documentation.
687
         */
688
        public Builder putExtraParam(String key, Object value) {
689
          if (this.extraParams == null) {
×
690
            this.extraParams = new HashMap<>();
×
691
          }
692
          this.extraParams.put(key, value);
×
693
          return this;
×
694
        }
695

696
        /**
697
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
698
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
699
         * map. See {@link ConfigurationCreateParams.Features.InvoiceHistory#extraParams} for the
700
         * field documentation.
701
         */
702
        public Builder putAllExtraParam(Map<String, Object> map) {
703
          if (this.extraParams == null) {
×
704
            this.extraParams = new HashMap<>();
×
705
          }
706
          this.extraParams.putAll(map);
×
707
          return this;
×
708
        }
709
      }
710
    }
711

712
    @Getter
713
    public static class PaymentMethodUpdate {
714
      /** <strong>Required.</strong> Whether the feature is enabled. */
715
      @SerializedName("enabled")
716
      Boolean enabled;
717

718
      /**
719
       * Map of extra parameters for custom features not available in this client library. The
720
       * content in this map is not serialized under this field's {@code @SerializedName} value.
721
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
722
       * name in this param object. Effectively, this map is flattened to its parent instance.
723
       */
724
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
725
      Map<String, Object> extraParams;
726

727
      private PaymentMethodUpdate(Boolean enabled, Map<String, Object> extraParams) {
×
728
        this.enabled = enabled;
×
729
        this.extraParams = extraParams;
×
730
      }
×
731

732
      public static Builder builder() {
733
        return new Builder();
×
734
      }
735

736
      public static class Builder {
×
737
        private Boolean enabled;
738

739
        private Map<String, Object> extraParams;
740

741
        /** Finalize and obtain parameter instance from this builder. */
742
        public ConfigurationCreateParams.Features.PaymentMethodUpdate build() {
743
          return new ConfigurationCreateParams.Features.PaymentMethodUpdate(
×
744
              this.enabled, this.extraParams);
745
        }
746

747
        /** <strong>Required.</strong> Whether the feature is enabled. */
748
        public Builder setEnabled(Boolean enabled) {
749
          this.enabled = enabled;
×
750
          return this;
×
751
        }
752

753
        /**
754
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
755
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
756
         * map. See {@link ConfigurationCreateParams.Features.PaymentMethodUpdate#extraParams} for
757
         * the field documentation.
758
         */
759
        public Builder putExtraParam(String key, Object value) {
760
          if (this.extraParams == null) {
×
761
            this.extraParams = new HashMap<>();
×
762
          }
763
          this.extraParams.put(key, value);
×
764
          return this;
×
765
        }
766

767
        /**
768
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
769
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
770
         * map. See {@link ConfigurationCreateParams.Features.PaymentMethodUpdate#extraParams} for
771
         * the field documentation.
772
         */
773
        public Builder putAllExtraParam(Map<String, Object> map) {
774
          if (this.extraParams == null) {
×
775
            this.extraParams = new HashMap<>();
×
776
          }
777
          this.extraParams.putAll(map);
×
778
          return this;
×
779
        }
780
      }
781
    }
782

783
    @Getter
784
    public static class SubscriptionCancel {
785
      /**
786
       * Whether the cancellation reasons will be collected in the portal and which options are
787
       * exposed to the customer.
788
       */
789
      @SerializedName("cancellation_reason")
790
      CancellationReason cancellationReason;
791

792
      /** <strong>Required.</strong> Whether the feature is enabled. */
793
      @SerializedName("enabled")
794
      Boolean enabled;
795

796
      /**
797
       * Map of extra parameters for custom features not available in this client library. The
798
       * content in this map is not serialized under this field's {@code @SerializedName} value.
799
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
800
       * name in this param object. Effectively, this map is flattened to its parent instance.
801
       */
802
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
803
      Map<String, Object> extraParams;
804

805
      /** Whether to cancel subscriptions immediately or at the end of the billing period. */
806
      @SerializedName("mode")
807
      Mode mode;
808

809
      /**
810
       * Whether to create prorations when canceling subscriptions. Possible values are {@code none}
811
       * and {@code create_prorations}, which is only compatible with {@code mode=immediately}. No
812
       * prorations are generated when canceling a subscription at the end of its natural billing
813
       * period.
814
       */
815
      @SerializedName("proration_behavior")
816
      ProrationBehavior prorationBehavior;
817

818
      private SubscriptionCancel(
819
          CancellationReason cancellationReason,
820
          Boolean enabled,
821
          Map<String, Object> extraParams,
822
          Mode mode,
823
          ProrationBehavior prorationBehavior) {
×
824
        this.cancellationReason = cancellationReason;
×
825
        this.enabled = enabled;
×
826
        this.extraParams = extraParams;
×
827
        this.mode = mode;
×
828
        this.prorationBehavior = prorationBehavior;
×
829
      }
×
830

831
      public static Builder builder() {
832
        return new Builder();
×
833
      }
834

835
      public static class Builder {
×
836
        private CancellationReason cancellationReason;
837

838
        private Boolean enabled;
839

840
        private Map<String, Object> extraParams;
841

842
        private Mode mode;
843

844
        private ProrationBehavior prorationBehavior;
845

846
        /** Finalize and obtain parameter instance from this builder. */
847
        public ConfigurationCreateParams.Features.SubscriptionCancel build() {
848
          return new ConfigurationCreateParams.Features.SubscriptionCancel(
×
849
              this.cancellationReason,
850
              this.enabled,
851
              this.extraParams,
852
              this.mode,
853
              this.prorationBehavior);
854
        }
855

856
        /**
857
         * Whether the cancellation reasons will be collected in the portal and which options are
858
         * exposed to the customer.
859
         */
860
        public Builder setCancellationReason(
861
            ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason
862
                cancellationReason) {
863
          this.cancellationReason = cancellationReason;
×
864
          return this;
×
865
        }
866

867
        /** <strong>Required.</strong> Whether the feature is enabled. */
868
        public Builder setEnabled(Boolean enabled) {
869
          this.enabled = enabled;
×
870
          return this;
×
871
        }
872

873
        /**
874
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
875
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
876
         * map. See {@link ConfigurationCreateParams.Features.SubscriptionCancel#extraParams} for
877
         * the field documentation.
878
         */
879
        public Builder putExtraParam(String key, Object value) {
880
          if (this.extraParams == null) {
×
881
            this.extraParams = new HashMap<>();
×
882
          }
883
          this.extraParams.put(key, value);
×
884
          return this;
×
885
        }
886

887
        /**
888
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
889
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
890
         * map. See {@link ConfigurationCreateParams.Features.SubscriptionCancel#extraParams} for
891
         * the field documentation.
892
         */
893
        public Builder putAllExtraParam(Map<String, Object> map) {
894
          if (this.extraParams == null) {
×
895
            this.extraParams = new HashMap<>();
×
896
          }
897
          this.extraParams.putAll(map);
×
898
          return this;
×
899
        }
900

901
        /** Whether to cancel subscriptions immediately or at the end of the billing period. */
902
        public Builder setMode(ConfigurationCreateParams.Features.SubscriptionCancel.Mode mode) {
903
          this.mode = mode;
×
904
          return this;
×
905
        }
906

907
        /**
908
         * Whether to create prorations when canceling subscriptions. Possible values are {@code
909
         * none} and {@code create_prorations}, which is only compatible with {@code
910
         * mode=immediately}. No prorations are generated when canceling a subscription at the end
911
         * of its natural billing period.
912
         */
913
        public Builder setProrationBehavior(
914
            ConfigurationCreateParams.Features.SubscriptionCancel.ProrationBehavior
915
                prorationBehavior) {
916
          this.prorationBehavior = prorationBehavior;
×
917
          return this;
×
918
        }
919
      }
920

921
      @Getter
922
      public static class CancellationReason {
923
        /** <strong>Required.</strong> Whether the feature is enabled. */
924
        @SerializedName("enabled")
925
        Boolean enabled;
926

927
        /**
928
         * Map of extra parameters for custom features not available in this client library. The
929
         * content in this map is not serialized under this field's {@code @SerializedName} value.
930
         * Instead, each key/value pair is serialized as if the key is a root-level field
931
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
932
         * instance.
933
         */
934
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
935
        Map<String, Object> extraParams;
936

937
        /**
938
         * <strong>Required.</strong> Which cancellation reasons will be given as options to the
939
         * customer.
940
         */
941
        @SerializedName("options")
942
        Object options;
943

944
        private CancellationReason(
945
            Boolean enabled, Map<String, Object> extraParams, Object options) {
×
946
          this.enabled = enabled;
×
947
          this.extraParams = extraParams;
×
948
          this.options = options;
×
949
        }
×
950

951
        public static Builder builder() {
952
          return new Builder();
×
953
        }
954

955
        public static class Builder {
×
956
          private Boolean enabled;
957

958
          private Map<String, Object> extraParams;
959

960
          private Object options;
961

962
          /** Finalize and obtain parameter instance from this builder. */
963
          public ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason build() {
964
            return new ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason(
×
965
                this.enabled, this.extraParams, this.options);
966
          }
967

968
          /** <strong>Required.</strong> Whether the feature is enabled. */
969
          public Builder setEnabled(Boolean enabled) {
970
            this.enabled = enabled;
×
971
            return this;
×
972
          }
973

974
          /**
975
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
976
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
977
           * map. See {@link
978
           * ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#extraParams}
979
           * for the field documentation.
980
           */
981
          public Builder putExtraParam(String key, Object value) {
982
            if (this.extraParams == null) {
×
983
              this.extraParams = new HashMap<>();
×
984
            }
985
            this.extraParams.put(key, value);
×
986
            return this;
×
987
          }
988

989
          /**
990
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
991
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
992
           * map. See {@link
993
           * ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#extraParams}
994
           * for the field documentation.
995
           */
996
          public Builder putAllExtraParam(Map<String, Object> map) {
997
            if (this.extraParams == null) {
×
998
              this.extraParams = new HashMap<>();
×
999
            }
1000
            this.extraParams.putAll(map);
×
1001
            return this;
×
1002
          }
1003

1004
          /**
1005
           * Add an element to `options` list. A list is initialized for the first `add/addAll`
1006
           * call, and subsequent calls adds additional elements to the original list. See {@link
1007
           * ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#options} for
1008
           * the field documentation.
1009
           */
1010
          @SuppressWarnings("unchecked")
1011
          public Builder addOption(
1012
              ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option
1013
                  element) {
1014
            if (this.options == null || this.options instanceof EmptyParam) {
×
1015
              this.options =
×
1016
                  new ArrayList<
1017
                      ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason
1018
                          .Option>();
1019
            }
1020
            ((List<ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option>)
×
1021
                    this.options)
1022
                .add(element);
×
1023
            return this;
×
1024
          }
1025

1026
          /**
1027
           * Add all elements to `options` list. A list is initialized for the first `add/addAll`
1028
           * call, and subsequent calls adds additional elements to the original list. See {@link
1029
           * ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason#options} for
1030
           * the field documentation.
1031
           */
1032
          @SuppressWarnings("unchecked")
1033
          public Builder addAllOption(
1034
              List<ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option>
1035
                  elements) {
1036
            if (this.options == null || this.options instanceof EmptyParam) {
×
1037
              this.options =
×
1038
                  new ArrayList<
1039
                      ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason
1040
                          .Option>();
1041
            }
1042
            ((List<ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option>)
×
1043
                    this.options)
1044
                .addAll(elements);
×
1045
            return this;
×
1046
          }
1047

1048
          /**
1049
           * <strong>Required.</strong> Which cancellation reasons will be given as options to the
1050
           * customer.
1051
           */
1052
          public Builder setOptions(EmptyParam options) {
1053
            this.options = options;
×
1054
            return this;
×
1055
          }
1056

1057
          /**
1058
           * <strong>Required.</strong> Which cancellation reasons will be given as options to the
1059
           * customer.
1060
           */
1061
          public Builder setOptions(
1062
              List<ConfigurationCreateParams.Features.SubscriptionCancel.CancellationReason.Option>
1063
                  options) {
1064
            this.options = options;
×
1065
            return this;
×
1066
          }
1067
        }
1068

1069
        public enum Option implements ApiRequestParams.EnumParam {
×
1070
          @SerializedName("customer_service")
×
1071
          CUSTOMER_SERVICE("customer_service"),
1072

1073
          @SerializedName("low_quality")
×
1074
          LOW_QUALITY("low_quality"),
1075

1076
          @SerializedName("missing_features")
×
1077
          MISSING_FEATURES("missing_features"),
1078

1079
          @SerializedName("other")
×
1080
          OTHER("other"),
1081

1082
          @SerializedName("switched_service")
×
1083
          SWITCHED_SERVICE("switched_service"),
1084

1085
          @SerializedName("too_complex")
×
1086
          TOO_COMPLEX("too_complex"),
1087

1088
          @SerializedName("too_expensive")
×
1089
          TOO_EXPENSIVE("too_expensive"),
1090

1091
          @SerializedName("unused")
×
1092
          UNUSED("unused");
1093

1094
          @Getter(onMethod_ = {@Override})
1095
          private final String value;
1096

1097
          Option(String value) {
×
1098
            this.value = value;
×
1099
          }
×
1100
        }
1101
      }
1102

1103
      public enum Mode implements ApiRequestParams.EnumParam {
×
1104
        @SerializedName("at_period_end")
×
1105
        AT_PERIOD_END("at_period_end"),
1106

1107
        @SerializedName("immediately")
×
1108
        IMMEDIATELY("immediately");
1109

1110
        @Getter(onMethod_ = {@Override})
1111
        private final String value;
1112

1113
        Mode(String value) {
×
1114
          this.value = value;
×
1115
        }
×
1116
      }
1117

1118
      public enum ProrationBehavior implements ApiRequestParams.EnumParam {
×
1119
        @SerializedName("always_invoice")
×
1120
        ALWAYS_INVOICE("always_invoice"),
1121

1122
        @SerializedName("create_prorations")
×
1123
        CREATE_PRORATIONS("create_prorations"),
1124

1125
        @SerializedName("none")
×
1126
        NONE("none");
1127

1128
        @Getter(onMethod_ = {@Override})
1129
        private final String value;
1130

1131
        ProrationBehavior(String value) {
×
1132
          this.value = value;
×
1133
        }
×
1134
      }
1135
    }
1136

1137
    @Getter
1138
    public static class SubscriptionUpdate {
1139
      /**
1140
       * The types of subscription updates that are supported. When empty, subscriptions are not
1141
       * updateable.
1142
       */
1143
      @SerializedName("default_allowed_updates")
1144
      Object defaultAllowedUpdates;
1145

1146
      /** <strong>Required.</strong> Whether the feature is enabled. */
1147
      @SerializedName("enabled")
1148
      Boolean enabled;
1149

1150
      /**
1151
       * Map of extra parameters for custom features not available in this client library. The
1152
       * content in this map is not serialized under this field's {@code @SerializedName} value.
1153
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
1154
       * name in this param object. Effectively, this map is flattened to its parent instance.
1155
       */
1156
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1157
      Map<String, Object> extraParams;
1158

1159
      /** The list of up to 10 products that support subscription updates. */
1160
      @SerializedName("products")
1161
      Object products;
1162

1163
      /**
1164
       * Determines how to handle prorations resulting from subscription updates. Valid values are
1165
       * {@code none}, {@code create_prorations}, and {@code always_invoice}.
1166
       */
1167
      @SerializedName("proration_behavior")
1168
      ProrationBehavior prorationBehavior;
1169

1170
      /**
1171
       * Setting to control when an update should be scheduled at the end of the period instead of
1172
       * applying immediately.
1173
       */
1174
      @SerializedName("schedule_at_period_end")
1175
      ScheduleAtPeriodEnd scheduleAtPeriodEnd;
1176

1177
      private SubscriptionUpdate(
1178
          Object defaultAllowedUpdates,
1179
          Boolean enabled,
1180
          Map<String, Object> extraParams,
1181
          Object products,
1182
          ProrationBehavior prorationBehavior,
NEW
1183
          ScheduleAtPeriodEnd scheduleAtPeriodEnd) {
×
1184
        this.defaultAllowedUpdates = defaultAllowedUpdates;
×
1185
        this.enabled = enabled;
×
1186
        this.extraParams = extraParams;
×
1187
        this.products = products;
×
1188
        this.prorationBehavior = prorationBehavior;
×
NEW
1189
        this.scheduleAtPeriodEnd = scheduleAtPeriodEnd;
×
UNCOV
1190
      }
×
1191

1192
      public static Builder builder() {
1193
        return new Builder();
×
1194
      }
1195

1196
      public static class Builder {
×
1197
        private Object defaultAllowedUpdates;
1198

1199
        private Boolean enabled;
1200

1201
        private Map<String, Object> extraParams;
1202

1203
        private Object products;
1204

1205
        private ProrationBehavior prorationBehavior;
1206

1207
        private ScheduleAtPeriodEnd scheduleAtPeriodEnd;
1208

1209
        /** Finalize and obtain parameter instance from this builder. */
1210
        public ConfigurationCreateParams.Features.SubscriptionUpdate build() {
1211
          return new ConfigurationCreateParams.Features.SubscriptionUpdate(
×
1212
              this.defaultAllowedUpdates,
1213
              this.enabled,
1214
              this.extraParams,
1215
              this.products,
1216
              this.prorationBehavior,
1217
              this.scheduleAtPeriodEnd);
1218
        }
1219

1220
        /**
1221
         * Add an element to `defaultAllowedUpdates` list. A list is initialized for the first
1222
         * `add/addAll` call, and subsequent calls adds additional elements to the original list.
1223
         * See {@link ConfigurationCreateParams.Features.SubscriptionUpdate#defaultAllowedUpdates}
1224
         * for the field documentation.
1225
         */
1226
        @SuppressWarnings("unchecked")
1227
        public Builder addDefaultAllowedUpdate(
1228
            ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate element) {
1229
          if (this.defaultAllowedUpdates == null
×
1230
              || this.defaultAllowedUpdates instanceof EmptyParam) {
1231
            this.defaultAllowedUpdates =
×
1232
                new ArrayList<
1233
                    ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>();
1234
          }
1235
          ((List<ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>)
×
1236
                  this.defaultAllowedUpdates)
1237
              .add(element);
×
1238
          return this;
×
1239
        }
1240

1241
        /**
1242
         * Add all elements to `defaultAllowedUpdates` list. A list is initialized for the first
1243
         * `add/addAll` call, and subsequent calls adds additional elements to the original list.
1244
         * See {@link ConfigurationCreateParams.Features.SubscriptionUpdate#defaultAllowedUpdates}
1245
         * for the field documentation.
1246
         */
1247
        @SuppressWarnings("unchecked")
1248
        public Builder addAllDefaultAllowedUpdate(
1249
            List<ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>
1250
                elements) {
1251
          if (this.defaultAllowedUpdates == null
×
1252
              || this.defaultAllowedUpdates instanceof EmptyParam) {
1253
            this.defaultAllowedUpdates =
×
1254
                new ArrayList<
1255
                    ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>();
1256
          }
1257
          ((List<ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>)
×
1258
                  this.defaultAllowedUpdates)
1259
              .addAll(elements);
×
1260
          return this;
×
1261
        }
1262

1263
        /**
1264
         * The types of subscription updates that are supported. When empty, subscriptions are not
1265
         * updateable.
1266
         */
1267
        public Builder setDefaultAllowedUpdates(EmptyParam defaultAllowedUpdates) {
1268
          this.defaultAllowedUpdates = defaultAllowedUpdates;
×
1269
          return this;
×
1270
        }
1271

1272
        /**
1273
         * The types of subscription updates that are supported. When empty, subscriptions are not
1274
         * updateable.
1275
         */
1276
        public Builder setDefaultAllowedUpdates(
1277
            List<ConfigurationCreateParams.Features.SubscriptionUpdate.DefaultAllowedUpdate>
1278
                defaultAllowedUpdates) {
1279
          this.defaultAllowedUpdates = defaultAllowedUpdates;
×
1280
          return this;
×
1281
        }
1282

1283
        /** <strong>Required.</strong> Whether the feature is enabled. */
1284
        public Builder setEnabled(Boolean enabled) {
1285
          this.enabled = enabled;
×
1286
          return this;
×
1287
        }
1288

1289
        /**
1290
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
1291
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1292
         * map. See {@link ConfigurationCreateParams.Features.SubscriptionUpdate#extraParams} for
1293
         * the field documentation.
1294
         */
1295
        public Builder putExtraParam(String key, Object value) {
1296
          if (this.extraParams == null) {
×
1297
            this.extraParams = new HashMap<>();
×
1298
          }
1299
          this.extraParams.put(key, value);
×
1300
          return this;
×
1301
        }
1302

1303
        /**
1304
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1305
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1306
         * map. See {@link ConfigurationCreateParams.Features.SubscriptionUpdate#extraParams} for
1307
         * the field documentation.
1308
         */
1309
        public Builder putAllExtraParam(Map<String, Object> map) {
1310
          if (this.extraParams == null) {
×
1311
            this.extraParams = new HashMap<>();
×
1312
          }
1313
          this.extraParams.putAll(map);
×
1314
          return this;
×
1315
        }
1316

1317
        /**
1318
         * Add an element to `products` list. A list is initialized for the first `add/addAll` call,
1319
         * and subsequent calls adds additional elements to the original list. See {@link
1320
         * ConfigurationCreateParams.Features.SubscriptionUpdate#products} for the field
1321
         * documentation.
1322
         */
1323
        @SuppressWarnings("unchecked")
1324
        public Builder addProduct(
1325
            ConfigurationCreateParams.Features.SubscriptionUpdate.Product element) {
1326
          if (this.products == null || this.products instanceof EmptyParam) {
×
1327
            this.products =
×
1328
                new ArrayList<ConfigurationCreateParams.Features.SubscriptionUpdate.Product>();
1329
          }
1330
          ((List<ConfigurationCreateParams.Features.SubscriptionUpdate.Product>) this.products)
×
1331
              .add(element);
×
1332
          return this;
×
1333
        }
1334

1335
        /**
1336
         * Add all elements to `products` list. A list is initialized for the first `add/addAll`
1337
         * call, and subsequent calls adds additional elements to the original list. See {@link
1338
         * ConfigurationCreateParams.Features.SubscriptionUpdate#products} for the field
1339
         * documentation.
1340
         */
1341
        @SuppressWarnings("unchecked")
1342
        public Builder addAllProduct(
1343
            List<ConfigurationCreateParams.Features.SubscriptionUpdate.Product> elements) {
1344
          if (this.products == null || this.products instanceof EmptyParam) {
×
1345
            this.products =
×
1346
                new ArrayList<ConfigurationCreateParams.Features.SubscriptionUpdate.Product>();
1347
          }
1348
          ((List<ConfigurationCreateParams.Features.SubscriptionUpdate.Product>) this.products)
×
1349
              .addAll(elements);
×
1350
          return this;
×
1351
        }
1352

1353
        /** The list of up to 10 products that support subscription updates. */
1354
        public Builder setProducts(EmptyParam products) {
1355
          this.products = products;
×
1356
          return this;
×
1357
        }
1358

1359
        /** The list of up to 10 products that support subscription updates. */
1360
        public Builder setProducts(
1361
            List<ConfigurationCreateParams.Features.SubscriptionUpdate.Product> products) {
1362
          this.products = products;
×
1363
          return this;
×
1364
        }
1365

1366
        /**
1367
         * Determines how to handle prorations resulting from subscription updates. Valid values are
1368
         * {@code none}, {@code create_prorations}, and {@code always_invoice}.
1369
         */
1370
        public Builder setProrationBehavior(
1371
            ConfigurationCreateParams.Features.SubscriptionUpdate.ProrationBehavior
1372
                prorationBehavior) {
1373
          this.prorationBehavior = prorationBehavior;
×
1374
          return this;
×
1375
        }
1376

1377
        /**
1378
         * Setting to control when an update should be scheduled at the end of the period instead of
1379
         * applying immediately.
1380
         */
1381
        public Builder setScheduleAtPeriodEnd(
1382
            ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
1383
                scheduleAtPeriodEnd) {
NEW
1384
          this.scheduleAtPeriodEnd = scheduleAtPeriodEnd;
×
NEW
1385
          return this;
×
1386
        }
1387
      }
1388

1389
      @Getter
1390
      public static class Product {
1391
        /**
1392
         * Map of extra parameters for custom features not available in this client library. The
1393
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1394
         * Instead, each key/value pair is serialized as if the key is a root-level field
1395
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1396
         * instance.
1397
         */
1398
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1399
        Map<String, Object> extraParams;
1400

1401
        /**
1402
         * <strong>Required.</strong> The list of price IDs for the product that a subscription can
1403
         * be updated to.
1404
         */
1405
        @SerializedName("prices")
1406
        List<String> prices;
1407

1408
        /** <strong>Required.</strong> The product id. */
1409
        @SerializedName("product")
1410
        String product;
1411

1412
        private Product(Map<String, Object> extraParams, List<String> prices, String product) {
×
1413
          this.extraParams = extraParams;
×
1414
          this.prices = prices;
×
1415
          this.product = product;
×
1416
        }
×
1417

1418
        public static Builder builder() {
1419
          return new Builder();
×
1420
        }
1421

1422
        public static class Builder {
×
1423
          private Map<String, Object> extraParams;
1424

1425
          private List<String> prices;
1426

1427
          private String product;
1428

1429
          /** Finalize and obtain parameter instance from this builder. */
1430
          public ConfigurationCreateParams.Features.SubscriptionUpdate.Product build() {
1431
            return new ConfigurationCreateParams.Features.SubscriptionUpdate.Product(
×
1432
                this.extraParams, this.prices, this.product);
1433
          }
1434

1435
          /**
1436
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1437
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1438
           * map. See {@link
1439
           * ConfigurationCreateParams.Features.SubscriptionUpdate.Product#extraParams} for the
1440
           * field documentation.
1441
           */
1442
          public Builder putExtraParam(String key, Object value) {
1443
            if (this.extraParams == null) {
×
1444
              this.extraParams = new HashMap<>();
×
1445
            }
1446
            this.extraParams.put(key, value);
×
1447
            return this;
×
1448
          }
1449

1450
          /**
1451
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1452
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1453
           * map. See {@link
1454
           * ConfigurationCreateParams.Features.SubscriptionUpdate.Product#extraParams} for the
1455
           * field documentation.
1456
           */
1457
          public Builder putAllExtraParam(Map<String, Object> map) {
1458
            if (this.extraParams == null) {
×
1459
              this.extraParams = new HashMap<>();
×
1460
            }
1461
            this.extraParams.putAll(map);
×
1462
            return this;
×
1463
          }
1464

1465
          /**
1466
           * Add an element to `prices` list. A list is initialized for the first `add/addAll` call,
1467
           * and subsequent calls adds additional elements to the original list. See {@link
1468
           * ConfigurationCreateParams.Features.SubscriptionUpdate.Product#prices} for the field
1469
           * documentation.
1470
           */
1471
          public Builder addPrice(String element) {
1472
            if (this.prices == null) {
×
1473
              this.prices = new ArrayList<>();
×
1474
            }
1475
            this.prices.add(element);
×
1476
            return this;
×
1477
          }
1478

1479
          /**
1480
           * Add all elements to `prices` list. A list is initialized for the first `add/addAll`
1481
           * call, and subsequent calls adds additional elements to the original list. See {@link
1482
           * ConfigurationCreateParams.Features.SubscriptionUpdate.Product#prices} for the field
1483
           * documentation.
1484
           */
1485
          public Builder addAllPrice(List<String> elements) {
1486
            if (this.prices == null) {
×
1487
              this.prices = new ArrayList<>();
×
1488
            }
1489
            this.prices.addAll(elements);
×
1490
            return this;
×
1491
          }
1492

1493
          /** <strong>Required.</strong> The product id. */
1494
          public Builder setProduct(String product) {
1495
            this.product = product;
×
1496
            return this;
×
1497
          }
1498
        }
1499
      }
1500

1501
      @Getter
1502
      public static class ScheduleAtPeriodEnd {
1503
        /**
1504
         * List of conditions. When any condition is true, the update will be scheduled at the end
1505
         * of the current period.
1506
         */
1507
        @SerializedName("conditions")
1508
        List<ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition>
1509
            conditions;
1510

1511
        /**
1512
         * Map of extra parameters for custom features not available in this client library. The
1513
         * content in this map is not serialized under this field's {@code @SerializedName} value.
1514
         * Instead, each key/value pair is serialized as if the key is a root-level field
1515
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
1516
         * instance.
1517
         */
1518
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1519
        Map<String, Object> extraParams;
1520

1521
        private ScheduleAtPeriodEnd(
1522
            List<
1523
                    ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
1524
                        .Condition>
1525
                conditions,
NEW
1526
            Map<String, Object> extraParams) {
×
NEW
1527
          this.conditions = conditions;
×
NEW
1528
          this.extraParams = extraParams;
×
NEW
1529
        }
×
1530

1531
        public static Builder builder() {
NEW
1532
          return new Builder();
×
1533
        }
1534

NEW
1535
        public static class Builder {
×
1536
          private List<
1537
                  ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
1538
                      .Condition>
1539
              conditions;
1540

1541
          private Map<String, Object> extraParams;
1542

1543
          /** Finalize and obtain parameter instance from this builder. */
1544
          public ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd build() {
NEW
1545
            return new ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd(
×
1546
                this.conditions, this.extraParams);
1547
          }
1548

1549
          /**
1550
           * Add an element to `conditions` list. A list is initialized for the first `add/addAll`
1551
           * call, and subsequent calls adds additional elements to the original list. See {@link
1552
           * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd#conditions}
1553
           * for the field documentation.
1554
           */
1555
          public Builder addCondition(
1556
              ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition
1557
                  element) {
NEW
1558
            if (this.conditions == null) {
×
NEW
1559
              this.conditions = new ArrayList<>();
×
1560
            }
NEW
1561
            this.conditions.add(element);
×
NEW
1562
            return this;
×
1563
          }
1564

1565
          /**
1566
           * Add all elements to `conditions` list. A list is initialized for the first `add/addAll`
1567
           * call, and subsequent calls adds additional elements to the original list. See {@link
1568
           * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd#conditions}
1569
           * for the field documentation.
1570
           */
1571
          public Builder addAllCondition(
1572
              List<
1573
                      ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
1574
                          .Condition>
1575
                  elements) {
NEW
1576
            if (this.conditions == null) {
×
NEW
1577
              this.conditions = new ArrayList<>();
×
1578
            }
NEW
1579
            this.conditions.addAll(elements);
×
NEW
1580
            return this;
×
1581
          }
1582

1583
          /**
1584
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
1585
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1586
           * map. See {@link
1587
           * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd#extraParams}
1588
           * for the field documentation.
1589
           */
1590
          public Builder putExtraParam(String key, Object value) {
NEW
1591
            if (this.extraParams == null) {
×
NEW
1592
              this.extraParams = new HashMap<>();
×
1593
            }
NEW
1594
            this.extraParams.put(key, value);
×
NEW
1595
            return this;
×
1596
          }
1597

1598
          /**
1599
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1600
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
1601
           * map. See {@link
1602
           * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd#extraParams}
1603
           * for the field documentation.
1604
           */
1605
          public Builder putAllExtraParam(Map<String, Object> map) {
NEW
1606
            if (this.extraParams == null) {
×
NEW
1607
              this.extraParams = new HashMap<>();
×
1608
            }
NEW
1609
            this.extraParams.putAll(map);
×
NEW
1610
            return this;
×
1611
          }
1612
        }
1613

1614
        @Getter
1615
        public static class Condition {
1616
          /**
1617
           * Map of extra parameters for custom features not available in this client library. The
1618
           * content in this map is not serialized under this field's {@code @SerializedName} value.
1619
           * Instead, each key/value pair is serialized as if the key is a root-level field
1620
           * (serialized) name in this param object. Effectively, this map is flattened to its
1621
           * parent instance.
1622
           */
1623
          @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1624
          Map<String, Object> extraParams;
1625

1626
          /** <strong>Required.</strong> The type of condition. */
1627
          @SerializedName("type")
1628
          Type type;
1629

NEW
1630
          private Condition(Map<String, Object> extraParams, Type type) {
×
NEW
1631
            this.extraParams = extraParams;
×
NEW
1632
            this.type = type;
×
NEW
1633
          }
×
1634

1635
          public static Builder builder() {
NEW
1636
            return new Builder();
×
1637
          }
1638

NEW
1639
          public static class Builder {
×
1640
            private Map<String, Object> extraParams;
1641

1642
            private Type type;
1643

1644
            /** Finalize and obtain parameter instance from this builder. */
1645
            public ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
1646
                    .Condition
1647
                build() {
NEW
1648
              return new ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd
×
1649
                  .Condition(this.extraParams, this.type);
1650
            }
1651

1652
            /**
1653
             * Add a key/value pair to `extraParams` map. A map is initialized for the first
1654
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1655
             * original map. See {@link
1656
             * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition#extraParams}
1657
             * for the field documentation.
1658
             */
1659
            public Builder putExtraParam(String key, Object value) {
NEW
1660
              if (this.extraParams == null) {
×
NEW
1661
                this.extraParams = new HashMap<>();
×
1662
              }
NEW
1663
              this.extraParams.put(key, value);
×
NEW
1664
              return this;
×
1665
            }
1666

1667
            /**
1668
             * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1669
             * `put/putAll` call, and subsequent calls add additional key/value pairs to the
1670
             * original map. See {@link
1671
             * ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition#extraParams}
1672
             * for the field documentation.
1673
             */
1674
            public Builder putAllExtraParam(Map<String, Object> map) {
NEW
1675
              if (this.extraParams == null) {
×
NEW
1676
                this.extraParams = new HashMap<>();
×
1677
              }
NEW
1678
              this.extraParams.putAll(map);
×
NEW
1679
              return this;
×
1680
            }
1681

1682
            /** <strong>Required.</strong> The type of condition. */
1683
            public Builder setType(
1684
                ConfigurationCreateParams.Features.SubscriptionUpdate.ScheduleAtPeriodEnd.Condition
1685
                        .Type
1686
                    type) {
NEW
1687
              this.type = type;
×
NEW
1688
              return this;
×
1689
            }
1690
          }
1691

NEW
1692
          public enum Type implements ApiRequestParams.EnumParam {
×
NEW
1693
            @SerializedName("decreasing_item_amount")
×
1694
            DECREASING_ITEM_AMOUNT("decreasing_item_amount"),
1695

NEW
1696
            @SerializedName("shortening_interval")
×
1697
            SHORTENING_INTERVAL("shortening_interval");
1698

1699
            @Getter(onMethod_ = {@Override})
1700
            private final String value;
1701

NEW
1702
            Type(String value) {
×
NEW
1703
              this.value = value;
×
NEW
1704
            }
×
1705
          }
1706
        }
1707
      }
1708

1709
      public enum DefaultAllowedUpdate implements ApiRequestParams.EnumParam {
×
1710
        @SerializedName("price")
×
1711
        PRICE("price"),
1712

1713
        @SerializedName("promotion_code")
×
1714
        PROMOTION_CODE("promotion_code"),
1715

1716
        @SerializedName("quantity")
×
1717
        QUANTITY("quantity");
1718

1719
        @Getter(onMethod_ = {@Override})
1720
        private final String value;
1721

1722
        DefaultAllowedUpdate(String value) {
×
1723
          this.value = value;
×
1724
        }
×
1725
      }
1726

1727
      public enum ProrationBehavior implements ApiRequestParams.EnumParam {
×
1728
        @SerializedName("always_invoice")
×
1729
        ALWAYS_INVOICE("always_invoice"),
1730

1731
        @SerializedName("create_prorations")
×
1732
        CREATE_PRORATIONS("create_prorations"),
1733

1734
        @SerializedName("none")
×
1735
        NONE("none");
1736

1737
        @Getter(onMethod_ = {@Override})
1738
        private final String value;
1739

1740
        ProrationBehavior(String value) {
×
1741
          this.value = value;
×
1742
        }
×
1743
      }
1744
    }
1745
  }
1746

1747
  @Getter
1748
  public static class LoginPage {
1749
    /**
1750
     * <strong>Required.</strong> Set to {@code true} to generate a shareable URL <a
1751
     * href="https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url">{@code
1752
     * login_page.url}</a> that will take your customers to a hosted login page for the customer
1753
     * portal.
1754
     */
1755
    @SerializedName("enabled")
1756
    Boolean enabled;
1757

1758
    /**
1759
     * Map of extra parameters for custom features not available in this client library. The content
1760
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1761
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1762
     * param object. Effectively, this map is flattened to its parent instance.
1763
     */
1764
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1765
    Map<String, Object> extraParams;
1766

1767
    private LoginPage(Boolean enabled, Map<String, Object> extraParams) {
×
1768
      this.enabled = enabled;
×
1769
      this.extraParams = extraParams;
×
1770
    }
×
1771

1772
    public static Builder builder() {
1773
      return new Builder();
×
1774
    }
1775

1776
    public static class Builder {
×
1777
      private Boolean enabled;
1778

1779
      private Map<String, Object> extraParams;
1780

1781
      /** Finalize and obtain parameter instance from this builder. */
1782
      public ConfigurationCreateParams.LoginPage build() {
1783
        return new ConfigurationCreateParams.LoginPage(this.enabled, this.extraParams);
×
1784
      }
1785

1786
      /**
1787
       * <strong>Required.</strong> Set to {@code true} to generate a shareable URL <a
1788
       * href="https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url">{@code
1789
       * login_page.url}</a> that will take your customers to a hosted login page for the customer
1790
       * portal.
1791
       */
1792
      public Builder setEnabled(Boolean enabled) {
1793
        this.enabled = enabled;
×
1794
        return this;
×
1795
      }
1796

1797
      /**
1798
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1799
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1800
       * ConfigurationCreateParams.LoginPage#extraParams} for the field documentation.
1801
       */
1802
      public Builder putExtraParam(String key, Object value) {
1803
        if (this.extraParams == null) {
×
1804
          this.extraParams = new HashMap<>();
×
1805
        }
1806
        this.extraParams.put(key, value);
×
1807
        return this;
×
1808
      }
1809

1810
      /**
1811
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1812
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1813
       * See {@link ConfigurationCreateParams.LoginPage#extraParams} for the field documentation.
1814
       */
1815
      public Builder putAllExtraParam(Map<String, Object> map) {
1816
        if (this.extraParams == null) {
×
1817
          this.extraParams = new HashMap<>();
×
1818
        }
1819
        this.extraParams.putAll(map);
×
1820
        return this;
×
1821
      }
1822
    }
1823
  }
1824
}
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