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

stripe / stripe-java / #16493

03 Oct 2024 07:15PM UTC coverage: 12.942% (+0.08%) from 12.864%
#16493

push

github

web-flow
Merge Stripe-java v27.0.0 to beta branch (#1888)

409 of 1651 new or added lines in 88 files covered. (24.77%)

31 existing lines in 7 files now uncovered.

18773 of 145050 relevant lines covered (12.94%)

0.13 hits per line

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

0.0
/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.billing;
3

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

12
@Getter
13
public class CreditBalanceSummaryRetrieveParams extends ApiRequestParams {
14
  /** <strong>Required.</strong> The customer for which to fetch credit balance summary. */
15
  @SerializedName("customer")
16
  String customer;
17

18
  /** Specifies which fields in the response should be expanded. */
19
  @SerializedName("expand")
20
  List<String> expand;
21

22
  /**
23
   * Map of extra parameters for custom features not available in this client library. The content
24
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
25
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
26
   * param object. Effectively, this map is flattened to its parent instance.
27
   */
28
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
29
  Map<String, Object> extraParams;
30

31
  /** <strong>Required.</strong> The filter criteria for the credit balance summary. */
32
  @SerializedName("filter")
33
  Filter filter;
34

35
  private CreditBalanceSummaryRetrieveParams(
NEW
36
      String customer, List<String> expand, Map<String, Object> extraParams, Filter filter) {
×
NEW
37
    this.customer = customer;
×
NEW
38
    this.expand = expand;
×
NEW
39
    this.extraParams = extraParams;
×
NEW
40
    this.filter = filter;
×
NEW
41
  }
×
42

43
  public static Builder builder() {
NEW
44
    return new Builder();
×
45
  }
46

NEW
47
  public static class Builder {
×
48
    private String customer;
49

50
    private List<String> expand;
51

52
    private Map<String, Object> extraParams;
53

54
    private Filter filter;
55

56
    /** Finalize and obtain parameter instance from this builder. */
57
    public CreditBalanceSummaryRetrieveParams build() {
NEW
58
      return new CreditBalanceSummaryRetrieveParams(
×
59
          this.customer, this.expand, this.extraParams, this.filter);
60
    }
61

62
    /** <strong>Required.</strong> The customer for which to fetch credit balance summary. */
63
    public Builder setCustomer(String customer) {
NEW
64
      this.customer = customer;
×
NEW
65
      return this;
×
66
    }
67

68
    /**
69
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
70
     * subsequent calls adds additional elements to the original list. See {@link
71
     * CreditBalanceSummaryRetrieveParams#expand} for the field documentation.
72
     */
73
    public Builder addExpand(String element) {
NEW
74
      if (this.expand == null) {
×
NEW
75
        this.expand = new ArrayList<>();
×
76
      }
NEW
77
      this.expand.add(element);
×
NEW
78
      return this;
×
79
    }
80

81
    /**
82
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
83
     * subsequent calls adds additional elements to the original list. See {@link
84
     * CreditBalanceSummaryRetrieveParams#expand} for the field documentation.
85
     */
86
    public Builder addAllExpand(List<String> elements) {
NEW
87
      if (this.expand == null) {
×
NEW
88
        this.expand = new ArrayList<>();
×
89
      }
NEW
90
      this.expand.addAll(elements);
×
NEW
91
      return this;
×
92
    }
93

94
    /**
95
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
96
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
97
     * CreditBalanceSummaryRetrieveParams#extraParams} for the field documentation.
98
     */
99
    public Builder putExtraParam(String key, Object value) {
NEW
100
      if (this.extraParams == null) {
×
NEW
101
        this.extraParams = new HashMap<>();
×
102
      }
NEW
103
      this.extraParams.put(key, value);
×
NEW
104
      return this;
×
105
    }
106

107
    /**
108
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
109
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
110
     * See {@link CreditBalanceSummaryRetrieveParams#extraParams} for the field documentation.
111
     */
112
    public Builder putAllExtraParam(Map<String, Object> map) {
NEW
113
      if (this.extraParams == null) {
×
NEW
114
        this.extraParams = new HashMap<>();
×
115
      }
NEW
116
      this.extraParams.putAll(map);
×
NEW
117
      return this;
×
118
    }
119

120
    /** <strong>Required.</strong> The filter criteria for the credit balance summary. */
121
    public Builder setFilter(CreditBalanceSummaryRetrieveParams.Filter filter) {
NEW
122
      this.filter = filter;
×
NEW
123
      return this;
×
124
    }
125
  }
126

127
  @Getter
128
  public static class Filter {
129
    /** The credit applicability scope for which to fetch balance summary. */
130
    @SerializedName("applicability_scope")
131
    ApplicabilityScope applicabilityScope;
132

133
    /** The credit grant for which to fetch balance summary. */
134
    @SerializedName("credit_grant")
135
    String creditGrant;
136

137
    /**
138
     * Map of extra parameters for custom features not available in this client library. The content
139
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
140
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
141
     * param object. Effectively, this map is flattened to its parent instance.
142
     */
143
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
144
    Map<String, Object> extraParams;
145

146
    /** <strong>Required.</strong> Specify the type of this filter. */
147
    @SerializedName("type")
148
    Type type;
149

150
    private Filter(
151
        ApplicabilityScope applicabilityScope,
152
        String creditGrant,
153
        Map<String, Object> extraParams,
NEW
154
        Type type) {
×
NEW
155
      this.applicabilityScope = applicabilityScope;
×
NEW
156
      this.creditGrant = creditGrant;
×
NEW
157
      this.extraParams = extraParams;
×
NEW
158
      this.type = type;
×
NEW
159
    }
×
160

161
    public static Builder builder() {
NEW
162
      return new Builder();
×
163
    }
164

NEW
165
    public static class Builder {
×
166
      private ApplicabilityScope applicabilityScope;
167

168
      private String creditGrant;
169

170
      private Map<String, Object> extraParams;
171

172
      private Type type;
173

174
      /** Finalize and obtain parameter instance from this builder. */
175
      public CreditBalanceSummaryRetrieveParams.Filter build() {
NEW
176
        return new CreditBalanceSummaryRetrieveParams.Filter(
×
177
            this.applicabilityScope, this.creditGrant, this.extraParams, this.type);
178
      }
179

180
      /** The credit applicability scope for which to fetch balance summary. */
181
      public Builder setApplicabilityScope(
182
          CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope applicabilityScope) {
NEW
183
        this.applicabilityScope = applicabilityScope;
×
NEW
184
        return this;
×
185
      }
186

187
      /** The credit grant for which to fetch balance summary. */
188
      public Builder setCreditGrant(String creditGrant) {
NEW
189
        this.creditGrant = creditGrant;
×
NEW
190
        return this;
×
191
      }
192

193
      /**
194
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
195
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
196
       * CreditBalanceSummaryRetrieveParams.Filter#extraParams} for the field documentation.
197
       */
198
      public Builder putExtraParam(String key, Object value) {
NEW
199
        if (this.extraParams == null) {
×
NEW
200
          this.extraParams = new HashMap<>();
×
201
        }
NEW
202
        this.extraParams.put(key, value);
×
NEW
203
        return this;
×
204
      }
205

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

220
      /** <strong>Required.</strong> Specify the type of this filter. */
221
      public Builder setType(CreditBalanceSummaryRetrieveParams.Filter.Type type) {
NEW
222
        this.type = type;
×
NEW
223
        return this;
×
224
      }
225
    }
226

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

238
      /**
239
       * <strong>Required.</strong> The price type to which credit grants can apply to. We currently
240
       * only support {@code metered} price type.
241
       */
242
      @SerializedName("price_type")
243
      PriceType priceType;
244

NEW
245
      private ApplicabilityScope(Map<String, Object> extraParams, PriceType priceType) {
×
NEW
246
        this.extraParams = extraParams;
×
NEW
247
        this.priceType = priceType;
×
NEW
248
      }
×
249

250
      public static Builder builder() {
NEW
251
        return new Builder();
×
252
      }
253

NEW
254
      public static class Builder {
×
255
        private Map<String, Object> extraParams;
256

257
        private PriceType priceType;
258

259
        /** Finalize and obtain parameter instance from this builder. */
260
        public CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope build() {
NEW
261
          return new CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope(
×
262
              this.extraParams, this.priceType);
263
        }
264

265
        /**
266
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
267
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
268
         * map. See {@link CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope#extraParams}
269
         * for the field documentation.
270
         */
271
        public Builder putExtraParam(String key, Object value) {
NEW
272
          if (this.extraParams == null) {
×
NEW
273
            this.extraParams = new HashMap<>();
×
274
          }
NEW
275
          this.extraParams.put(key, value);
×
NEW
276
          return this;
×
277
        }
278

279
        /**
280
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
281
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
282
         * map. See {@link CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope#extraParams}
283
         * for the field documentation.
284
         */
285
        public Builder putAllExtraParam(Map<String, Object> map) {
NEW
286
          if (this.extraParams == null) {
×
NEW
287
            this.extraParams = new HashMap<>();
×
288
          }
NEW
289
          this.extraParams.putAll(map);
×
NEW
290
          return this;
×
291
        }
292

293
        /**
294
         * <strong>Required.</strong> The price type to which credit grants can apply to. We
295
         * currently only support {@code metered} price type.
296
         */
297
        public Builder setPriceType(
298
            CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope.PriceType priceType) {
NEW
299
          this.priceType = priceType;
×
NEW
300
          return this;
×
301
        }
302
      }
303

NEW
304
      public enum PriceType implements ApiRequestParams.EnumParam {
×
NEW
305
        @SerializedName("metered")
×
306
        METERED("metered");
307

308
        @Getter(onMethod_ = {@Override})
309
        private final String value;
310

NEW
311
        PriceType(String value) {
×
NEW
312
          this.value = value;
×
NEW
313
        }
×
314
      }
315
    }
316

NEW
317
    public enum Type implements ApiRequestParams.EnumParam {
×
NEW
318
      @SerializedName("applicability_scope")
×
319
      APPLICABILITY_SCOPE("applicability_scope"),
320

NEW
321
      @SerializedName("credit_grant")
×
322
      CREDIT_GRANT("credit_grant");
323

324
      @Getter(onMethod_ = {@Override})
325
      private final String value;
326

NEW
327
      Type(String value) {
×
NEW
328
        this.value = value;
×
NEW
329
      }
×
330
    }
331
  }
332
}
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