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

stripe / stripe-java / #16599

29 Oct 2024 11:04PM UTC coverage: 12.519% (-0.1%) from 12.62%
#16599

push

github

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

Update generated code for beta

40 of 1580 new or added lines in 51 files covered. (2.53%)

19 existing lines in 15 files now uncovered.

18843 of 150513 relevant lines covered (12.52%)

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/v2/core/EventDestinationCreateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.v2.core;
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 EventDestinationCreateParams extends ApiRequestParams {
14
  /** Amazon EventBridge configuration. */
15
  @SerializedName("amazon_eventbridge")
16
  AmazonEventbridge amazonEventbridge;
17

18
  /** An optional description of what the event destination is used for. */
19
  @SerializedName("description")
20
  String description;
21

22
  /** <strong>Required.</strong> The list of events to enable for this endpoint. */
23
  @SerializedName("enabled_events")
24
  List<String> enabledEvents;
25

26
  /** <strong>Required.</strong> Payload type of events being subscribed to. */
27
  @SerializedName("event_payload")
28
  EventPayload eventPayload;
29

30
  /** Where events should be routed from. */
31
  @SerializedName("events_from")
32
  List<EventDestinationCreateParams.EventsFrom> eventsFrom;
33

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

43
  /** Additional fields to include in the response. */
44
  @SerializedName("include")
45
  List<EventDestinationCreateParams.Include> include;
46

47
  /** Metadata. */
48
  @SerializedName("metadata")
49
  Map<String, String> metadata;
50

51
  /** <strong>Required.</strong> Event destination name. */
52
  @SerializedName("name")
53
  String name;
54

55
  /** If using the snapshot event payload, the API version events are rendered as. */
56
  @SerializedName("snapshot_api_version")
57
  String snapshotApiVersion;
58

59
  /** <strong>Required.</strong> Event destination type. */
60
  @SerializedName("type")
61
  Type type;
62

63
  /** Webhook endpoint configuration. */
64
  @SerializedName("webhook_endpoint")
65
  WebhookEndpoint webhookEndpoint;
66

67
  private EventDestinationCreateParams(
68
      AmazonEventbridge amazonEventbridge,
69
      String description,
70
      List<String> enabledEvents,
71
      EventPayload eventPayload,
72
      List<EventDestinationCreateParams.EventsFrom> eventsFrom,
73
      Map<String, Object> extraParams,
74
      List<EventDestinationCreateParams.Include> include,
75
      Map<String, String> metadata,
76
      String name,
77
      String snapshotApiVersion,
78
      Type type,
NEW
79
      WebhookEndpoint webhookEndpoint) {
×
NEW
80
    this.amazonEventbridge = amazonEventbridge;
×
NEW
81
    this.description = description;
×
NEW
82
    this.enabledEvents = enabledEvents;
×
NEW
83
    this.eventPayload = eventPayload;
×
NEW
84
    this.eventsFrom = eventsFrom;
×
NEW
85
    this.extraParams = extraParams;
×
NEW
86
    this.include = include;
×
NEW
87
    this.metadata = metadata;
×
NEW
88
    this.name = name;
×
NEW
89
    this.snapshotApiVersion = snapshotApiVersion;
×
NEW
90
    this.type = type;
×
NEW
91
    this.webhookEndpoint = webhookEndpoint;
×
NEW
92
  }
×
93

94
  public static Builder builder() {
NEW
95
    return new Builder();
×
96
  }
97

NEW
98
  public static class Builder {
×
99
    private AmazonEventbridge amazonEventbridge;
100

101
    private String description;
102

103
    private List<String> enabledEvents;
104

105
    private EventPayload eventPayload;
106

107
    private List<EventDestinationCreateParams.EventsFrom> eventsFrom;
108

109
    private Map<String, Object> extraParams;
110

111
    private List<EventDestinationCreateParams.Include> include;
112

113
    private Map<String, String> metadata;
114

115
    private String name;
116

117
    private String snapshotApiVersion;
118

119
    private Type type;
120

121
    private WebhookEndpoint webhookEndpoint;
122

123
    /** Finalize and obtain parameter instance from this builder. */
124
    public EventDestinationCreateParams build() {
NEW
125
      return new EventDestinationCreateParams(
×
126
          this.amazonEventbridge,
127
          this.description,
128
          this.enabledEvents,
129
          this.eventPayload,
130
          this.eventsFrom,
131
          this.extraParams,
132
          this.include,
133
          this.metadata,
134
          this.name,
135
          this.snapshotApiVersion,
136
          this.type,
137
          this.webhookEndpoint);
138
    }
139

140
    /** Amazon EventBridge configuration. */
141
    public Builder setAmazonEventbridge(
142
        EventDestinationCreateParams.AmazonEventbridge amazonEventbridge) {
NEW
143
      this.amazonEventbridge = amazonEventbridge;
×
NEW
144
      return this;
×
145
    }
146

147
    /** An optional description of what the event destination is used for. */
148
    public Builder setDescription(String description) {
NEW
149
      this.description = description;
×
NEW
150
      return this;
×
151
    }
152

153
    /**
154
     * Add an element to `enabledEvents` list. A list is initialized for the first `add/addAll`
155
     * call, and subsequent calls adds additional elements to the original list. See {@link
156
     * EventDestinationCreateParams#enabledEvents} for the field documentation.
157
     */
158
    public Builder addEnabledEvent(String element) {
NEW
159
      if (this.enabledEvents == null) {
×
NEW
160
        this.enabledEvents = new ArrayList<>();
×
161
      }
NEW
162
      this.enabledEvents.add(element);
×
NEW
163
      return this;
×
164
    }
165

166
    /**
167
     * Add all elements to `enabledEvents` list. A list is initialized for the first `add/addAll`
168
     * call, and subsequent calls adds additional elements to the original list. See {@link
169
     * EventDestinationCreateParams#enabledEvents} for the field documentation.
170
     */
171
    public Builder addAllEnabledEvent(List<String> elements) {
NEW
172
      if (this.enabledEvents == null) {
×
NEW
173
        this.enabledEvents = new ArrayList<>();
×
174
      }
NEW
175
      this.enabledEvents.addAll(elements);
×
NEW
176
      return this;
×
177
    }
178

179
    /** <strong>Required.</strong> Payload type of events being subscribed to. */
180
    public Builder setEventPayload(EventDestinationCreateParams.EventPayload eventPayload) {
NEW
181
      this.eventPayload = eventPayload;
×
NEW
182
      return this;
×
183
    }
184

185
    /**
186
     * Add an element to `eventsFrom` list. A list is initialized for the first `add/addAll` call,
187
     * and subsequent calls adds additional elements to the original list. See {@link
188
     * EventDestinationCreateParams#eventsFrom} for the field documentation.
189
     */
190
    public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) {
NEW
191
      if (this.eventsFrom == null) {
×
NEW
192
        this.eventsFrom = new ArrayList<>();
×
193
      }
NEW
194
      this.eventsFrom.add(element);
×
NEW
195
      return this;
×
196
    }
197

198
    /**
199
     * Add all elements to `eventsFrom` list. A list is initialized for the first `add/addAll` call,
200
     * and subsequent calls adds additional elements to the original list. See {@link
201
     * EventDestinationCreateParams#eventsFrom} for the field documentation.
202
     */
203
    public Builder addAllEventsFrom(List<EventDestinationCreateParams.EventsFrom> elements) {
NEW
204
      if (this.eventsFrom == null) {
×
NEW
205
        this.eventsFrom = new ArrayList<>();
×
206
      }
NEW
207
      this.eventsFrom.addAll(elements);
×
NEW
208
      return this;
×
209
    }
210

211
    /**
212
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
213
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
214
     * EventDestinationCreateParams#extraParams} for the field documentation.
215
     */
216
    public Builder putExtraParam(String key, Object value) {
NEW
217
      if (this.extraParams == null) {
×
NEW
218
        this.extraParams = new HashMap<>();
×
219
      }
NEW
220
      this.extraParams.put(key, value);
×
NEW
221
      return this;
×
222
    }
223

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

237
    /**
238
     * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and
239
     * subsequent calls adds additional elements to the original list. See {@link
240
     * EventDestinationCreateParams#include} for the field documentation.
241
     */
242
    public Builder addInclude(EventDestinationCreateParams.Include element) {
NEW
243
      if (this.include == null) {
×
NEW
244
        this.include = new ArrayList<>();
×
245
      }
NEW
246
      this.include.add(element);
×
NEW
247
      return this;
×
248
    }
249

250
    /**
251
     * Add all elements to `include` list. A list is initialized for the first `add/addAll` call,
252
     * and subsequent calls adds additional elements to the original list. See {@link
253
     * EventDestinationCreateParams#include} for the field documentation.
254
     */
255
    public Builder addAllInclude(List<EventDestinationCreateParams.Include> elements) {
NEW
256
      if (this.include == null) {
×
NEW
257
        this.include = new ArrayList<>();
×
258
      }
NEW
259
      this.include.addAll(elements);
×
NEW
260
      return this;
×
261
    }
262

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

276
    /**
277
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
278
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
279
     * See {@link EventDestinationCreateParams#metadata} for the field documentation.
280
     */
281
    public Builder putAllMetadata(Map<String, String> map) {
NEW
282
      if (this.metadata == null) {
×
NEW
283
        this.metadata = new HashMap<>();
×
284
      }
NEW
285
      this.metadata.putAll(map);
×
NEW
286
      return this;
×
287
    }
288

289
    /** <strong>Required.</strong> Event destination name. */
290
    public Builder setName(String name) {
NEW
291
      this.name = name;
×
NEW
292
      return this;
×
293
    }
294

295
    /** If using the snapshot event payload, the API version events are rendered as. */
296
    public Builder setSnapshotApiVersion(String snapshotApiVersion) {
NEW
297
      this.snapshotApiVersion = snapshotApiVersion;
×
NEW
298
      return this;
×
299
    }
300

301
    /** <strong>Required.</strong> Event destination type. */
302
    public Builder setType(EventDestinationCreateParams.Type type) {
NEW
303
      this.type = type;
×
NEW
304
      return this;
×
305
    }
306

307
    /** Webhook endpoint configuration. */
308
    public Builder setWebhookEndpoint(
309
        EventDestinationCreateParams.WebhookEndpoint webhookEndpoint) {
NEW
310
      this.webhookEndpoint = webhookEndpoint;
×
NEW
311
      return this;
×
312
    }
313
  }
314

315
  @Getter
316
  public static class AmazonEventbridge {
317
    /** <strong>Required.</strong> The AWS account ID. */
318
    @SerializedName("aws_account_id")
319
    String awsAccountId;
320

321
    /** <strong>Required.</strong> The region of the AWS event source. */
322
    @SerializedName("aws_region")
323
    String awsRegion;
324

325
    /**
326
     * Map of extra parameters for custom features not available in this client library. The content
327
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
328
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
329
     * param object. Effectively, this map is flattened to its parent instance.
330
     */
331
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
332
    Map<String, Object> extraParams;
333

334
    private AmazonEventbridge(
NEW
335
        String awsAccountId, String awsRegion, Map<String, Object> extraParams) {
×
NEW
336
      this.awsAccountId = awsAccountId;
×
NEW
337
      this.awsRegion = awsRegion;
×
NEW
338
      this.extraParams = extraParams;
×
NEW
339
    }
×
340

341
    public static Builder builder() {
NEW
342
      return new Builder();
×
343
    }
344

NEW
345
    public static class Builder {
×
346
      private String awsAccountId;
347

348
      private String awsRegion;
349

350
      private Map<String, Object> extraParams;
351

352
      /** Finalize and obtain parameter instance from this builder. */
353
      public EventDestinationCreateParams.AmazonEventbridge build() {
NEW
354
        return new EventDestinationCreateParams.AmazonEventbridge(
×
355
            this.awsAccountId, this.awsRegion, this.extraParams);
356
      }
357

358
      /** <strong>Required.</strong> The AWS account ID. */
359
      public Builder setAwsAccountId(String awsAccountId) {
NEW
360
        this.awsAccountId = awsAccountId;
×
NEW
361
        return this;
×
362
      }
363

364
      /** <strong>Required.</strong> The region of the AWS event source. */
365
      public Builder setAwsRegion(String awsRegion) {
NEW
366
        this.awsRegion = awsRegion;
×
NEW
367
        return this;
×
368
      }
369

370
      /**
371
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
372
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
373
       * EventDestinationCreateParams.AmazonEventbridge#extraParams} for the field documentation.
374
       */
375
      public Builder putExtraParam(String key, Object value) {
NEW
376
        if (this.extraParams == null) {
×
NEW
377
          this.extraParams = new HashMap<>();
×
378
        }
NEW
379
        this.extraParams.put(key, value);
×
NEW
380
        return this;
×
381
      }
382

383
      /**
384
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
385
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
386
       * See {@link EventDestinationCreateParams.AmazonEventbridge#extraParams} for the field
387
       * documentation.
388
       */
389
      public Builder putAllExtraParam(Map<String, Object> map) {
NEW
390
        if (this.extraParams == null) {
×
NEW
391
          this.extraParams = new HashMap<>();
×
392
        }
NEW
393
        this.extraParams.putAll(map);
×
NEW
394
        return this;
×
395
      }
396
    }
397
  }
398

399
  @Getter
400
  public static class WebhookEndpoint {
401
    /**
402
     * Map of extra parameters for custom features not available in this client library. The content
403
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
404
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
405
     * param object. Effectively, this map is flattened to its parent instance.
406
     */
407
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
408
    Map<String, Object> extraParams;
409

410
    /** <strong>Required.</strong> The URL of the webhook endpoint. */
411
    @SerializedName("url")
412
    String url;
413

NEW
414
    private WebhookEndpoint(Map<String, Object> extraParams, String url) {
×
NEW
415
      this.extraParams = extraParams;
×
NEW
416
      this.url = url;
×
NEW
417
    }
×
418

419
    public static Builder builder() {
NEW
420
      return new Builder();
×
421
    }
422

NEW
423
    public static class Builder {
×
424
      private Map<String, Object> extraParams;
425

426
      private String url;
427

428
      /** Finalize and obtain parameter instance from this builder. */
429
      public EventDestinationCreateParams.WebhookEndpoint build() {
NEW
430
        return new EventDestinationCreateParams.WebhookEndpoint(this.extraParams, this.url);
×
431
      }
432

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

446
      /**
447
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
448
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
449
       * See {@link EventDestinationCreateParams.WebhookEndpoint#extraParams} for the field
450
       * documentation.
451
       */
452
      public Builder putAllExtraParam(Map<String, Object> map) {
NEW
453
        if (this.extraParams == null) {
×
NEW
454
          this.extraParams = new HashMap<>();
×
455
        }
NEW
456
        this.extraParams.putAll(map);
×
NEW
457
        return this;
×
458
      }
459

460
      /** <strong>Required.</strong> The URL of the webhook endpoint. */
461
      public Builder setUrl(String url) {
NEW
462
        this.url = url;
×
NEW
463
        return this;
×
464
      }
465
    }
466
  }
467

NEW
468
  public enum EventPayload implements ApiRequestParams.EnumParam {
×
NEW
469
    @SerializedName("snapshot")
×
470
    SNAPSHOT("snapshot"),
471

NEW
472
    @SerializedName("thin")
×
473
    THIN("thin");
474

475
    @Getter(onMethod_ = {@Override})
476
    private final String value;
477

NEW
478
    EventPayload(String value) {
×
NEW
479
      this.value = value;
×
NEW
480
    }
×
481
  }
482

NEW
483
  public enum EventsFrom implements ApiRequestParams.EnumParam {
×
NEW
484
    @SerializedName("other_accounts")
×
485
    OTHER_ACCOUNTS("other_accounts"),
486

NEW
487
    @SerializedName("self")
×
488
    SELF("self");
489

490
    @Getter(onMethod_ = {@Override})
491
    private final String value;
492

NEW
493
    EventsFrom(String value) {
×
NEW
494
      this.value = value;
×
NEW
495
    }
×
496
  }
497

NEW
498
  public enum Include implements ApiRequestParams.EnumParam {
×
NEW
499
    @SerializedName("webhook_endpoint.signing_secret")
×
500
    WEBHOOK_ENDPOINT__SIGNING_SECRET("webhook_endpoint.signing_secret"),
501

NEW
502
    @SerializedName("webhook_endpoint.url")
×
503
    WEBHOOK_ENDPOINT__URL("webhook_endpoint.url");
504

505
    @Getter(onMethod_ = {@Override})
506
    private final String value;
507

NEW
508
    Include(String value) {
×
NEW
509
      this.value = value;
×
NEW
510
    }
×
511
  }
512

NEW
513
  public enum Type implements ApiRequestParams.EnumParam {
×
NEW
514
    @SerializedName("amazon_eventbridge")
×
515
    AMAZON_EVENTBRIDGE("amazon_eventbridge"),
516

NEW
517
    @SerializedName("webhook_endpoint")
×
518
    WEBHOOK_ENDPOINT("webhook_endpoint");
519

520
    @Getter(onMethod_ = {@Override})
521
    private final String value;
522

NEW
523
    Type(String value) {
×
NEW
524
      this.value = value;
×
NEW
525
    }
×
526
  }
527
}
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