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

stripe / stripe-java / #16624

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

push

github

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

Update generated code for beta

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

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 hits per line

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

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

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

13
@Getter
14
public class InvoiceAttachPaymentParams extends ApiRequestParams {
15
  /**
16
   * The portion of the {@code amount} on the PaymentIntent or out of band payment to apply to this
17
   * invoice. It defaults to the entire amount.
18
   */
19
  @SerializedName("amount_requested")
20
  Long amountRequested;
21

22
  /** Specifies which fields in the response should be expanded. */
23
  @SerializedName("expand")
24
  List<String> expand;
25

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

35
  /** The ID of the PaymentIntent to attach to the invoice. */
36
  @SerializedName("payment_intent")
37
  String paymentIntent;
38

39
  /** The ID of the PaymentRecord to detach from the invoice. */
40
  @SerializedName("payment_record")
41
  String paymentRecord;
42

43
  /** The PaymentRecord data for attaching an out of band payment to the invoice. */
44
  @SerializedName("payment_record_data")
45
  PaymentRecordData paymentRecordData;
46

47
  private InvoiceAttachPaymentParams(
48
      Long amountRequested,
49
      List<String> expand,
50
      Map<String, Object> extraParams,
51
      String paymentIntent,
52
      String paymentRecord,
NEW
53
      PaymentRecordData paymentRecordData) {
×
54
    this.amountRequested = amountRequested;
×
55
    this.expand = expand;
×
56
    this.extraParams = extraParams;
×
57
    this.paymentIntent = paymentIntent;
×
NEW
58
    this.paymentRecord = paymentRecord;
×
NEW
59
    this.paymentRecordData = paymentRecordData;
×
UNCOV
60
  }
×
61

62
  public static Builder builder() {
63
    return new Builder();
×
64
  }
65

66
  public static class Builder {
×
67
    private Long amountRequested;
68

69
    private List<String> expand;
70

71
    private Map<String, Object> extraParams;
72

73
    private String paymentIntent;
74

75
    private String paymentRecord;
76

77
    private PaymentRecordData paymentRecordData;
78

79
    /** Finalize and obtain parameter instance from this builder. */
80
    public InvoiceAttachPaymentParams build() {
81
      return new InvoiceAttachPaymentParams(
×
82
          this.amountRequested,
83
          this.expand,
84
          this.extraParams,
85
          this.paymentIntent,
86
          this.paymentRecord,
87
          this.paymentRecordData);
88
    }
89

90
    /**
91
     * The portion of the {@code amount} on the PaymentIntent or out of band payment to apply to
92
     * this invoice. It defaults to the entire amount.
93
     */
94
    public Builder setAmountRequested(Long amountRequested) {
95
      this.amountRequested = amountRequested;
×
96
      return this;
×
97
    }
98

99
    /**
100
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
101
     * subsequent calls adds additional elements to the original list. See {@link
102
     * InvoiceAttachPaymentParams#expand} for the field documentation.
103
     */
104
    public Builder addExpand(String element) {
105
      if (this.expand == null) {
×
106
        this.expand = new ArrayList<>();
×
107
      }
108
      this.expand.add(element);
×
109
      return this;
×
110
    }
111

112
    /**
113
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
114
     * subsequent calls adds additional elements to the original list. See {@link
115
     * InvoiceAttachPaymentParams#expand} for the field documentation.
116
     */
117
    public Builder addAllExpand(List<String> elements) {
118
      if (this.expand == null) {
×
119
        this.expand = new ArrayList<>();
×
120
      }
121
      this.expand.addAll(elements);
×
122
      return this;
×
123
    }
124

125
    /**
126
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
127
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
128
     * InvoiceAttachPaymentParams#extraParams} for the field documentation.
129
     */
130
    public Builder putExtraParam(String key, Object value) {
131
      if (this.extraParams == null) {
×
132
        this.extraParams = new HashMap<>();
×
133
      }
134
      this.extraParams.put(key, value);
×
135
      return this;
×
136
    }
137

138
    /**
139
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
140
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
141
     * See {@link InvoiceAttachPaymentParams#extraParams} for the field documentation.
142
     */
143
    public Builder putAllExtraParam(Map<String, Object> map) {
144
      if (this.extraParams == null) {
×
145
        this.extraParams = new HashMap<>();
×
146
      }
147
      this.extraParams.putAll(map);
×
148
      return this;
×
149
    }
150

151
    /** The ID of the PaymentIntent to attach to the invoice. */
152
    public Builder setPaymentIntent(String paymentIntent) {
153
      this.paymentIntent = paymentIntent;
×
154
      return this;
×
155
    }
156

157
    /** The ID of the PaymentRecord to detach from the invoice. */
158
    public Builder setPaymentRecord(String paymentRecord) {
NEW
159
      this.paymentRecord = paymentRecord;
×
NEW
160
      return this;
×
161
    }
162

163
    /** The PaymentRecord data for attaching an out of band payment to the invoice. */
164
    public Builder setPaymentRecordData(
165
        InvoiceAttachPaymentParams.PaymentRecordData paymentRecordData) {
NEW
166
      this.paymentRecordData = paymentRecordData;
×
NEW
167
      return this;
×
168
    }
169
  }
170

171
  @Getter
172
  public static class PaymentRecordData {
173
    /** <strong>Required.</strong> The amount that was paid out of band. */
174
    @SerializedName("amount")
175
    Long amount;
176

177
    /** <strong>Required.</strong> The currency that was paid out of band. */
178
    @SerializedName("currency")
179
    String currency;
180

181
    /**
182
     * Map of extra parameters for custom features not available in this client library. The content
183
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
184
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
185
     * param object. Effectively, this map is flattened to its parent instance.
186
     */
187
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
188
    Map<String, Object> extraParams;
189

190
    /**
191
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
192
     * to an object. This can be useful for storing additional information about the object in a
193
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
194
     * can be unset by posting an empty value to {@code metadata}.
195
     */
196
    @SerializedName("metadata")
197
    Object metadata;
198

199
    /**
200
     * <strong>Required.</strong> The type of money movement for this out of band payment record.
201
     */
202
    @SerializedName("money_movement_type")
203
    String moneyMovementType;
204

205
    /** The timestamp when this out of band payment was paid. */
206
    @SerializedName("paid_at")
207
    Long paidAt;
208

209
    /** The reference for this out of band payment record. */
210
    @SerializedName("payment_reference")
211
    String paymentReference;
212

213
    private PaymentRecordData(
214
        Long amount,
215
        String currency,
216
        Map<String, Object> extraParams,
217
        Object metadata,
218
        String moneyMovementType,
219
        Long paidAt,
220
        String paymentReference) {
×
221
      this.amount = amount;
×
222
      this.currency = currency;
×
223
      this.extraParams = extraParams;
×
224
      this.metadata = metadata;
×
225
      this.moneyMovementType = moneyMovementType;
×
226
      this.paidAt = paidAt;
×
227
      this.paymentReference = paymentReference;
×
228
    }
×
229

230
    public static Builder builder() {
231
      return new Builder();
×
232
    }
233

234
    public static class Builder {
×
235
      private Long amount;
236

237
      private String currency;
238

239
      private Map<String, Object> extraParams;
240

241
      private Object metadata;
242

243
      private String moneyMovementType;
244

245
      private Long paidAt;
246

247
      private String paymentReference;
248

249
      /** Finalize and obtain parameter instance from this builder. */
250
      public InvoiceAttachPaymentParams.PaymentRecordData build() {
NEW
251
        return new InvoiceAttachPaymentParams.PaymentRecordData(
×
252
            this.amount,
253
            this.currency,
254
            this.extraParams,
255
            this.metadata,
256
            this.moneyMovementType,
257
            this.paidAt,
258
            this.paymentReference);
259
      }
260

261
      /** <strong>Required.</strong> The amount that was paid out of band. */
262
      public Builder setAmount(Long amount) {
263
        this.amount = amount;
×
264
        return this;
×
265
      }
266

267
      /** <strong>Required.</strong> The currency that was paid out of band. */
268
      public Builder setCurrency(String currency) {
269
        this.currency = currency;
×
270
        return this;
×
271
      }
272

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

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

300
      /**
301
       * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll`
302
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
303
       * InvoiceAttachPaymentParams.PaymentRecordData#metadata} for the field documentation.
304
       */
305
      @SuppressWarnings("unchecked")
306
      public Builder putMetadata(String key, String value) {
307
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
308
          this.metadata = new HashMap<String, String>();
×
309
        }
310
        ((Map<String, String>) this.metadata).put(key, value);
×
311
        return this;
×
312
      }
313

314
      /**
315
       * Add all map key/value pairs to `metadata` map. A map is initialized for the first
316
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
317
       * See {@link InvoiceAttachPaymentParams.PaymentRecordData#metadata} for the field
318
       * documentation.
319
       */
320
      @SuppressWarnings("unchecked")
321
      public Builder putAllMetadata(Map<String, String> map) {
322
        if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
323
          this.metadata = new HashMap<String, String>();
×
324
        }
325
        ((Map<String, String>) this.metadata).putAll(map);
×
326
        return this;
×
327
      }
328

329
      /**
330
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
331
       * attach to an object. This can be useful for storing additional information about the object
332
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
333
       * keys can be unset by posting an empty value to {@code metadata}.
334
       */
335
      public Builder setMetadata(EmptyParam metadata) {
336
        this.metadata = metadata;
×
337
        return this;
×
338
      }
339

340
      /**
341
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
342
       * attach to an object. This can be useful for storing additional information about the object
343
       * in a structured format. Individual keys can be unset by posting an empty value to them. All
344
       * keys can be unset by posting an empty value to {@code metadata}.
345
       */
346
      public Builder setMetadata(Map<String, String> metadata) {
347
        this.metadata = metadata;
×
348
        return this;
×
349
      }
350

351
      /**
352
       * <strong>Required.</strong> The type of money movement for this out of band payment record.
353
       */
354
      public Builder setMoneyMovementType(String moneyMovementType) {
355
        this.moneyMovementType = moneyMovementType;
×
356
        return this;
×
357
      }
358

359
      /** The timestamp when this out of band payment was paid. */
360
      public Builder setPaidAt(Long paidAt) {
361
        this.paidAt = paidAt;
×
362
        return this;
×
363
      }
364

365
      /** The reference for this out of band payment record. */
366
      public Builder setPaymentReference(String paymentReference) {
367
        this.paymentReference = paymentReference;
×
368
        return this;
×
369
      }
370
    }
371
  }
372
}
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