• 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/v2/billing/MeterEventAdjustmentCreateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.v2.billing;
3

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

10
@Getter
11
public class MeterEventAdjustmentCreateParams extends ApiRequestParams {
12
  /** <strong>Required.</strong> Specifies which event to cancel. */
13
  @SerializedName("cancel")
14
  Cancel cancel;
15

16
  /**
17
   * <strong>Required.</strong> The name of the meter event. Corresponds with the {@code event_name}
18
   * field on a meter.
19
   */
20
  @SerializedName("event_name")
21
  String eventName;
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
   * <strong>Required.</strong> Specifies whether to cancel a single event or a range of events for
34
   * a time period. Time period cancellation is not supported yet.
35
   */
36
  @SerializedName("type")
37
  Type type;
38

39
  private MeterEventAdjustmentCreateParams(
NEW
40
      Cancel cancel, String eventName, Map<String, Object> extraParams, Type type) {
×
NEW
41
    this.cancel = cancel;
×
NEW
42
    this.eventName = eventName;
×
NEW
43
    this.extraParams = extraParams;
×
NEW
44
    this.type = type;
×
NEW
45
  }
×
46

47
  public static Builder builder() {
NEW
48
    return new Builder();
×
49
  }
50

NEW
51
  public static class Builder {
×
52
    private Cancel cancel;
53

54
    private String eventName;
55

56
    private Map<String, Object> extraParams;
57

58
    private Type type;
59

60
    /** Finalize and obtain parameter instance from this builder. */
61
    public MeterEventAdjustmentCreateParams build() {
NEW
62
      return new MeterEventAdjustmentCreateParams(
×
63
          this.cancel, this.eventName, this.extraParams, this.type);
64
    }
65

66
    /** <strong>Required.</strong> Specifies which event to cancel. */
67
    public Builder setCancel(MeterEventAdjustmentCreateParams.Cancel cancel) {
NEW
68
      this.cancel = cancel;
×
NEW
69
      return this;
×
70
    }
71

72
    /**
73
     * <strong>Required.</strong> The name of the meter event. Corresponds with the {@code
74
     * event_name} field on a meter.
75
     */
76
    public Builder setEventName(String eventName) {
NEW
77
      this.eventName = eventName;
×
NEW
78
      return this;
×
79
    }
80

81
    /**
82
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
83
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
84
     * MeterEventAdjustmentCreateParams#extraParams} for the field documentation.
85
     */
86
    public Builder putExtraParam(String key, Object value) {
NEW
87
      if (this.extraParams == null) {
×
NEW
88
        this.extraParams = new HashMap<>();
×
89
      }
NEW
90
      this.extraParams.put(key, value);
×
NEW
91
      return this;
×
92
    }
93

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

107
    /**
108
     * <strong>Required.</strong> Specifies whether to cancel a single event or a range of events
109
     * for a time period. Time period cancellation is not supported yet.
110
     */
111
    public Builder setType(MeterEventAdjustmentCreateParams.Type type) {
NEW
112
      this.type = type;
×
NEW
113
      return this;
×
114
    }
115
  }
116

117
  @Getter
118
  public static class Cancel {
119
    /**
120
     * Map of extra parameters for custom features not available in this client library. The content
121
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
122
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
123
     * param object. Effectively, this map is flattened to its parent instance.
124
     */
125
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
126
    Map<String, Object> extraParams;
127

128
    /**
129
     * <strong>Required.</strong> Unique identifier for the event. You can only cancel events within
130
     * 24 hours of Stripe receiving them.
131
     */
132
    @SerializedName("identifier")
133
    String identifier;
134

NEW
135
    private Cancel(Map<String, Object> extraParams, String identifier) {
×
NEW
136
      this.extraParams = extraParams;
×
NEW
137
      this.identifier = identifier;
×
NEW
138
    }
×
139

140
    public static Builder builder() {
NEW
141
      return new Builder();
×
142
    }
143

NEW
144
    public static class Builder {
×
145
      private Map<String, Object> extraParams;
146

147
      private String identifier;
148

149
      /** Finalize and obtain parameter instance from this builder. */
150
      public MeterEventAdjustmentCreateParams.Cancel build() {
NEW
151
        return new MeterEventAdjustmentCreateParams.Cancel(this.extraParams, this.identifier);
×
152
      }
153

154
      /**
155
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
156
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
157
       * MeterEventAdjustmentCreateParams.Cancel#extraParams} for the field documentation.
158
       */
159
      public Builder putExtraParam(String key, Object value) {
NEW
160
        if (this.extraParams == null) {
×
NEW
161
          this.extraParams = new HashMap<>();
×
162
        }
NEW
163
        this.extraParams.put(key, value);
×
NEW
164
        return this;
×
165
      }
166

167
      /**
168
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
169
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
170
       * See {@link MeterEventAdjustmentCreateParams.Cancel#extraParams} for the field
171
       * documentation.
172
       */
173
      public Builder putAllExtraParam(Map<String, Object> map) {
NEW
174
        if (this.extraParams == null) {
×
NEW
175
          this.extraParams = new HashMap<>();
×
176
        }
NEW
177
        this.extraParams.putAll(map);
×
NEW
178
        return this;
×
179
      }
180

181
      /**
182
       * <strong>Required.</strong> Unique identifier for the event. You can only cancel events
183
       * within 24 hours of Stripe receiving them.
184
       */
185
      public Builder setIdentifier(String identifier) {
NEW
186
        this.identifier = identifier;
×
NEW
187
        return this;
×
188
      }
189
    }
190
  }
191

NEW
192
  public enum Type implements ApiRequestParams.EnumParam {
×
NEW
193
    @SerializedName("cancel")
×
194
    CANCEL("cancel");
195

196
    @Getter(onMethod_ = {@Override})
197
    private final String value;
198

NEW
199
    Type(String value) {
×
NEW
200
      this.value = value;
×
NEW
201
    }
×
202
  }
203
}
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