• 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/EventDestinationUpdateParams.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 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 EventDestinationUpdateParams extends ApiRequestParams {
15
  /** An optional description of what the event destination is used for. */
16
  @SerializedName("description")
17
  Object description;
18

19
  /** The list of events to enable for this endpoint. */
20
  @SerializedName("enabled_events")
21
  List<String> enabledEvents;
22

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

32
  /**
33
   * Additional fields to include in the response. Currently supports {@code webhook_endpoint.url}.
34
   */
35
  @SerializedName("include")
36
  List<EventDestinationUpdateParams.Include> include;
37

38
  /** Metadata. */
39
  @SerializedName("metadata")
40
  Map<String, Object> metadata;
41

42
  /** Event destination name. */
43
  @SerializedName("name")
44
  Object name;
45

46
  /** Webhook endpoint configuration. */
47
  @SerializedName("webhook_endpoint")
48
  WebhookEndpoint webhookEndpoint;
49

50
  private EventDestinationUpdateParams(
51
      Object description,
52
      List<String> enabledEvents,
53
      Map<String, Object> extraParams,
54
      List<EventDestinationUpdateParams.Include> include,
55
      Map<String, Object> metadata,
56
      Object name,
NEW
57
      WebhookEndpoint webhookEndpoint) {
×
NEW
58
    this.description = description;
×
NEW
59
    this.enabledEvents = enabledEvents;
×
NEW
60
    this.extraParams = extraParams;
×
NEW
61
    this.include = include;
×
NEW
62
    this.metadata = metadata;
×
NEW
63
    this.name = name;
×
NEW
64
    this.webhookEndpoint = webhookEndpoint;
×
NEW
65
  }
×
66

67
  public static Builder builder() {
NEW
68
    return new Builder();
×
69
  }
70

NEW
71
  public static class Builder {
×
72
    private Object description;
73

74
    private List<String> enabledEvents;
75

76
    private Map<String, Object> extraParams;
77

78
    private List<EventDestinationUpdateParams.Include> include;
79

80
    private Map<String, Object> metadata;
81

82
    private Object name;
83

84
    private WebhookEndpoint webhookEndpoint;
85

86
    /** Finalize and obtain parameter instance from this builder. */
87
    public EventDestinationUpdateParams build() {
NEW
88
      return new EventDestinationUpdateParams(
×
89
          this.description,
90
          this.enabledEvents,
91
          this.extraParams,
92
          this.include,
93
          this.metadata,
94
          this.name,
95
          this.webhookEndpoint);
96
    }
97

98
    /** An optional description of what the event destination is used for. */
99
    public Builder setDescription(String description) {
NEW
100
      this.description = description;
×
NEW
101
      return this;
×
102
    }
103

104
    /** An optional description of what the event destination is used for. */
105
    public Builder setDescription(EmptyParam description) {
NEW
106
      this.description = description;
×
NEW
107
      return this;
×
108
    }
109

110
    /**
111
     * Add an element to `enabledEvents` list. A list is initialized for the first `add/addAll`
112
     * call, and subsequent calls adds additional elements to the original list. See {@link
113
     * EventDestinationUpdateParams#enabledEvents} for the field documentation.
114
     */
115
    public Builder addEnabledEvent(String element) {
NEW
116
      if (this.enabledEvents == null) {
×
NEW
117
        this.enabledEvents = new ArrayList<>();
×
118
      }
NEW
119
      this.enabledEvents.add(element);
×
NEW
120
      return this;
×
121
    }
122

123
    /**
124
     * Add all elements to `enabledEvents` list. A list is initialized for the first `add/addAll`
125
     * call, and subsequent calls adds additional elements to the original list. See {@link
126
     * EventDestinationUpdateParams#enabledEvents} for the field documentation.
127
     */
128
    public Builder addAllEnabledEvent(List<String> elements) {
NEW
129
      if (this.enabledEvents == null) {
×
NEW
130
        this.enabledEvents = new ArrayList<>();
×
131
      }
NEW
132
      this.enabledEvents.addAll(elements);
×
NEW
133
      return this;
×
134
    }
135

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

149
    /**
150
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
151
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
152
     * See {@link EventDestinationUpdateParams#extraParams} for the field documentation.
153
     */
154
    public Builder putAllExtraParam(Map<String, Object> map) {
NEW
155
      if (this.extraParams == null) {
×
NEW
156
        this.extraParams = new HashMap<>();
×
157
      }
NEW
158
      this.extraParams.putAll(map);
×
NEW
159
      return this;
×
160
    }
161

162
    /**
163
     * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and
164
     * subsequent calls adds additional elements to the original list. See {@link
165
     * EventDestinationUpdateParams#include} for the field documentation.
166
     */
167
    public Builder addInclude(EventDestinationUpdateParams.Include element) {
NEW
168
      if (this.include == null) {
×
NEW
169
        this.include = new ArrayList<>();
×
170
      }
NEW
171
      this.include.add(element);
×
NEW
172
      return this;
×
173
    }
174

175
    /**
176
     * Add all elements to `include` list. A list is initialized for the first `add/addAll` call,
177
     * and subsequent calls adds additional elements to the original list. See {@link
178
     * EventDestinationUpdateParams#include} for the field documentation.
179
     */
180
    public Builder addAllInclude(List<EventDestinationUpdateParams.Include> elements) {
NEW
181
      if (this.include == null) {
×
NEW
182
        this.include = new ArrayList<>();
×
183
      }
NEW
184
      this.include.addAll(elements);
×
NEW
185
      return this;
×
186
    }
187

188
    /**
189
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
190
     * and subsequent calls add additional key/value pairs to the original map. See {@link
191
     * EventDestinationUpdateParams#metadata} for the field documentation.
192
     */
193
    public Builder putMetadata(String key, String value) {
NEW
194
      if (this.metadata == null) {
×
NEW
195
        this.metadata = new HashMap<>();
×
196
      }
NEW
197
      this.metadata.put(key, value);
×
NEW
198
      return this;
×
199
    }
200

201
    /**
202
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
203
     * and subsequent calls add additional key/value pairs to the original map. See {@link
204
     * EventDestinationUpdateParams#metadata} for the field documentation.
205
     */
206
    public Builder putMetadata(String key, EmptyParam value) {
NEW
207
      if (this.metadata == null) {
×
NEW
208
        this.metadata = new HashMap<>();
×
209
      }
NEW
210
      this.metadata.put(key, value);
×
NEW
211
      return this;
×
212
    }
213

214
    /**
215
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
216
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
217
     * Map values can only be one of the following types: `String`, `EmptyParam`. See {@link
218
     * EventDestinationUpdateParams#metadata} for the field documentation.
219
     */
220
    public Builder putAllMetadata(Map<String, Object> map) {
NEW
221
      if (!map.values().stream().allMatch(v -> v instanceof String || v instanceof EmptyParam)) {
×
NEW
222
        throw new IllegalArgumentException(
×
223
            "All map values must one of the following types: String, EmptyParam");
224
      }
NEW
225
      if (this.metadata == null) {
×
NEW
226
        this.metadata = new HashMap<>();
×
227
      }
NEW
228
      this.metadata.putAll(map);
×
NEW
229
      return this;
×
230
    }
231

232
    /** Event destination name. */
233
    public Builder setName(String name) {
NEW
234
      this.name = name;
×
NEW
235
      return this;
×
236
    }
237

238
    /** Event destination name. */
239
    public Builder setName(EmptyParam name) {
NEW
240
      this.name = name;
×
NEW
241
      return this;
×
242
    }
243

244
    /** Webhook endpoint configuration. */
245
    public Builder setWebhookEndpoint(
246
        EventDestinationUpdateParams.WebhookEndpoint webhookEndpoint) {
NEW
247
      this.webhookEndpoint = webhookEndpoint;
×
NEW
248
      return this;
×
249
    }
250
  }
251

252
  @Getter
253
  public static class WebhookEndpoint {
254
    /**
255
     * Map of extra parameters for custom features not available in this client library. The content
256
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
257
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
258
     * param object. Effectively, this map is flattened to its parent instance.
259
     */
260
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
261
    Map<String, Object> extraParams;
262

263
    /** <strong>Required.</strong> The URL of the webhook endpoint. */
264
    @SerializedName("url")
265
    Object url;
266

NEW
267
    private WebhookEndpoint(Map<String, Object> extraParams, Object url) {
×
NEW
268
      this.extraParams = extraParams;
×
NEW
269
      this.url = url;
×
NEW
270
    }
×
271

272
    public static Builder builder() {
NEW
273
      return new Builder();
×
274
    }
275

NEW
276
    public static class Builder {
×
277
      private Map<String, Object> extraParams;
278

279
      private Object url;
280

281
      /** Finalize and obtain parameter instance from this builder. */
282
      public EventDestinationUpdateParams.WebhookEndpoint build() {
NEW
283
        return new EventDestinationUpdateParams.WebhookEndpoint(this.extraParams, this.url);
×
284
      }
285

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

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

313
      /** <strong>Required.</strong> The URL of the webhook endpoint. */
314
      public Builder setUrl(String url) {
NEW
315
        this.url = url;
×
NEW
316
        return this;
×
317
      }
318

319
      /** <strong>Required.</strong> The URL of the webhook endpoint. */
320
      public Builder setUrl(EmptyParam url) {
NEW
321
        this.url = url;
×
NEW
322
        return this;
×
323
      }
324
    }
325
  }
326

NEW
327
  public enum Include implements ApiRequestParams.EnumParam {
×
NEW
328
    @SerializedName("webhook_endpoint.url")
×
329
    WEBHOOK_ENDPOINT__URL("webhook_endpoint.url");
330

331
    @Getter(onMethod_ = {@Override})
332
    private final String value;
333

NEW
334
    Include(String value) {
×
NEW
335
      this.value = value;
×
NEW
336
    }
×
337
  }
338
}
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