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

stripe / stripe-java / #16365

29 Aug 2024 06:39AM UTC coverage: 16.372% (-0.008%) from 16.38%
#16365

Pull #1855

github

web-flow
Merge f5eb6ef4b into a6080c2d9
Pull Request #1855: No need for APIMode to be passed around from individual API methods

16 of 86 new or added lines in 6 files covered. (18.6%)

513 existing lines in 170 files now uncovered.

18149 of 110857 relevant lines covered (16.37%)

0.16 hits per line

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

84.0
/src/main/java/com/stripe/model/radar/ValueList.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.radar;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.HasId;
7
import com.stripe.model.MetadataStore;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.BaseAddress;
12
import com.stripe.net.RequestOptions;
13
import com.stripe.net.StripeResponseGetter;
14
import com.stripe.param.radar.ValueListCreateParams;
15
import com.stripe.param.radar.ValueListListParams;
16
import com.stripe.param.radar.ValueListRetrieveParams;
17
import com.stripe.param.radar.ValueListUpdateParams;
18
import java.util.Map;
19
import lombok.EqualsAndHashCode;
20
import lombok.Getter;
21
import lombok.Setter;
22

23
/**
24
 * Value lists allow you to group values together which can then be referenced in rules.
25
 *
26
 * <p>Related guide: <a href="https://stripe.com/docs/radar/lists#managing-list-items">Default
27
 * Stripe lists</a>
28
 */
29
@Getter
30
@Setter
31
@EqualsAndHashCode(callSuper = false)
32
public class ValueList extends ApiResource implements HasId, MetadataStore<ValueList> {
1✔
33
  /** The name of the value list for use in rules. */
34
  @SerializedName("alias")
35
  String alias;
36

37
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
38
  @SerializedName("created")
39
  Long created;
40

41
  /** The name or email address of the user who created this value list. */
42
  @SerializedName("created_by")
43
  String createdBy;
44

45
  /** Always true for a deleted object. */
46
  @SerializedName("deleted")
47
  Boolean deleted;
48

49
  /** Unique identifier for the object. */
50
  @Getter(onMethod_ = {@Override})
51
  @SerializedName("id")
52
  String id;
53

54
  /**
55
   * The type of items in the value list. One of {@code card_fingerprint}, {@code
56
   * us_bank_account_fingerprint}, {@code sepa_debit_fingerprint}, {@code card_bin}, {@code email},
57
   * {@code ip_address}, {@code country}, {@code string}, {@code case_sensitive_string}, or {@code
58
   * customer_id}.
59
   */
60
  @SerializedName("item_type")
61
  String itemType;
62

63
  /** List of items contained within this value list. */
64
  @SerializedName("list_items")
65
  ValueListItemCollection listItems;
66

67
  /**
68
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
69
   * object exists in test mode.
70
   */
71
  @SerializedName("livemode")
72
  Boolean livemode;
73

74
  /**
75
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
76
   * to an object. This can be useful for storing additional information about the object in a
77
   * structured format.
78
   */
79
  @Getter(onMethod_ = {@Override})
80
  @SerializedName("metadata")
81
  Map<String, String> metadata;
82

83
  /** The name of the value list. */
84
  @SerializedName("name")
85
  String name;
86

87
  /**
88
   * String representing the object's type. Objects of the same type share the same value.
89
   *
90
   * <p>Equal to {@code radar.value_list}.
91
   */
92
  @SerializedName("object")
93
  String object;
94

95
  /** Creates a new {@code ValueList} object, which can then be referenced in rules. */
96
  public static ValueList create(Map<String, Object> params) throws StripeException {
97
    return create(params, (RequestOptions) null);
1✔
98
  }
99

100
  /** Creates a new {@code ValueList} object, which can then be referenced in rules. */
101
  public static ValueList create(Map<String, Object> params, RequestOptions options)
102
      throws StripeException {
103
    String path = "/v1/radar/value_lists";
1✔
104
    ApiRequest request =
1✔
105
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
106
    return getGlobalResponseGetter().request(request, ValueList.class);
1✔
107
  }
108

109
  /** Creates a new {@code ValueList} object, which can then be referenced in rules. */
110
  public static ValueList create(ValueListCreateParams params) throws StripeException {
111
    return create(params, (RequestOptions) null);
1✔
112
  }
113

114
  /** Creates a new {@code ValueList} object, which can then be referenced in rules. */
115
  public static ValueList create(ValueListCreateParams params, RequestOptions options)
116
      throws StripeException {
117
    String path = "/v1/radar/value_lists";
1✔
118
    ApiResource.checkNullTypedParams(path, params);
1✔
119
    ApiRequest request =
1✔
120
        new ApiRequest(
121
            BaseAddress.API,
122
            ApiResource.RequestMethod.POST,
123
            path,
124
            ApiRequestParams.paramsToMap(params),
1✔
125
            options);
126
    return getGlobalResponseGetter().request(request, ValueList.class);
1✔
127
  }
128

129
  /**
130
   * Deletes a {@code ValueList} object, also deleting any items contained within the value list. To
131
   * be deleted, a value list must not be referenced in any rules.
132
   */
133
  public ValueList delete() throws StripeException {
134
    return delete((Map<String, Object>) null, (RequestOptions) null);
1✔
135
  }
136

137
  /**
138
   * Deletes a {@code ValueList} object, also deleting any items contained within the value list. To
139
   * be deleted, a value list must not be referenced in any rules.
140
   */
141
  public ValueList delete(RequestOptions options) throws StripeException {
142
    return delete((Map<String, Object>) null, options);
×
143
  }
144

145
  /**
146
   * Deletes a {@code ValueList} object, also deleting any items contained within the value list. To
147
   * be deleted, a value list must not be referenced in any rules.
148
   */
149
  public ValueList delete(Map<String, Object> params) throws StripeException {
150
    return delete(params, (RequestOptions) null);
×
151
  }
152

153
  /**
154
   * Deletes a {@code ValueList} object, also deleting any items contained within the value list. To
155
   * be deleted, a value list must not be referenced in any rules.
156
   */
157
  public ValueList delete(Map<String, Object> params, RequestOptions options)
158
      throws StripeException {
159
    String path = String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(this.getId()));
1✔
160
    ApiRequest request =
1✔
161
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options);
162
    return getResponseGetter().request(request, ValueList.class);
1✔
163
  }
164

165
  /**
166
   * Returns a list of {@code ValueList} objects. The objects are sorted in descending order by
167
   * creation date, with the most recently created object appearing first.
168
   */
169
  public static ValueListCollection list(Map<String, Object> params) throws StripeException {
170
    return list(params, (RequestOptions) null);
1✔
171
  }
172

173
  /**
174
   * Returns a list of {@code ValueList} objects. The objects are sorted in descending order by
175
   * creation date, with the most recently created object appearing first.
176
   */
177
  public static ValueListCollection list(Map<String, Object> params, RequestOptions options)
178
      throws StripeException {
179
    String path = "/v1/radar/value_lists";
1✔
180
    ApiRequest request =
1✔
181
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
182
    return getGlobalResponseGetter().request(request, ValueListCollection.class);
1✔
183
  }
184

185
  /**
186
   * Returns a list of {@code ValueList} objects. The objects are sorted in descending order by
187
   * creation date, with the most recently created object appearing first.
188
   */
189
  public static ValueListCollection list(ValueListListParams params) throws StripeException {
190
    return list(params, (RequestOptions) null);
1✔
191
  }
192

193
  /**
194
   * Returns a list of {@code ValueList} objects. The objects are sorted in descending order by
195
   * creation date, with the most recently created object appearing first.
196
   */
197
  public static ValueListCollection list(ValueListListParams params, RequestOptions options)
198
      throws StripeException {
199
    String path = "/v1/radar/value_lists";
1✔
200
    ApiResource.checkNullTypedParams(path, params);
1✔
201
    ApiRequest request =
1✔
202
        new ApiRequest(
203
            BaseAddress.API,
204
            ApiResource.RequestMethod.GET,
205
            path,
206
            ApiRequestParams.paramsToMap(params),
1✔
207
            options);
208
    return getGlobalResponseGetter().request(request, ValueListCollection.class);
1✔
209
  }
210

211
  /** Retrieves a {@code ValueList} object. */
212
  public static ValueList retrieve(String valueList) throws StripeException {
213
    return retrieve(valueList, (Map<String, Object>) null, (RequestOptions) null);
1✔
214
  }
215

216
  /** Retrieves a {@code ValueList} object. */
217
  public static ValueList retrieve(String valueList, RequestOptions options)
218
      throws StripeException {
219
    return retrieve(valueList, (Map<String, Object>) null, options);
×
220
  }
221

222
  /** Retrieves a {@code ValueList} object. */
223
  public static ValueList retrieve(
224
      String valueList, Map<String, Object> params, RequestOptions options) throws StripeException {
225
    String path = String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(valueList));
1✔
226
    ApiRequest request =
1✔
227
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
228
    return getGlobalResponseGetter().request(request, ValueList.class);
1✔
229
  }
230

231
  /** Retrieves a {@code ValueList} object. */
232
  public static ValueList retrieve(
233
      String valueList, ValueListRetrieveParams params, RequestOptions options)
234
      throws StripeException {
235
    String path = String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(valueList));
×
236
    ApiResource.checkNullTypedParams(path, params);
×
237
    ApiRequest request =
×
238
        new ApiRequest(
239
            BaseAddress.API,
240
            ApiResource.RequestMethod.GET,
241
            path,
242
            ApiRequestParams.paramsToMap(params),
×
243
            options);
UNCOV
244
    return getGlobalResponseGetter().request(request, ValueList.class);
×
245
  }
246

247
  /**
248
   * Updates a {@code ValueList} object by setting the values of the parameters passed. Any
249
   * parameters not provided will be left unchanged. Note that {@code item_type} is immutable.
250
   */
251
  @Override
252
  public ValueList update(Map<String, Object> params) throws StripeException {
253
    return update(params, (RequestOptions) null);
1✔
254
  }
255

256
  /**
257
   * Updates a {@code ValueList} object by setting the values of the parameters passed. Any
258
   * parameters not provided will be left unchanged. Note that {@code item_type} is immutable.
259
   */
260
  @Override
261
  public ValueList update(Map<String, Object> params, RequestOptions options)
262
      throws StripeException {
263
    String path = String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(this.getId()));
1✔
264
    ApiRequest request =
1✔
265
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
266
    return getResponseGetter().request(request, ValueList.class);
1✔
267
  }
268

269
  /**
270
   * Updates a {@code ValueList} object by setting the values of the parameters passed. Any
271
   * parameters not provided will be left unchanged. Note that {@code item_type} is immutable.
272
   */
273
  public ValueList update(ValueListUpdateParams params) throws StripeException {
274
    return update(params, (RequestOptions) null);
1✔
275
  }
276

277
  /**
278
   * Updates a {@code ValueList} object by setting the values of the parameters passed. Any
279
   * parameters not provided will be left unchanged. Note that {@code item_type} is immutable.
280
   */
281
  public ValueList update(ValueListUpdateParams params, RequestOptions options)
282
      throws StripeException {
283
    String path = String.format("/v1/radar/value_lists/%s", ApiResource.urlEncodeId(this.getId()));
1✔
284
    ApiResource.checkNullTypedParams(path, params);
1✔
285
    ApiRequest request =
1✔
286
        new ApiRequest(
287
            BaseAddress.API,
288
            ApiResource.RequestMethod.POST,
289
            path,
290
            ApiRequestParams.paramsToMap(params),
1✔
291
            options);
292
    return getResponseGetter().request(request, ValueList.class);
1✔
293
  }
294

295
  @Override
296
  public void setResponseGetter(StripeResponseGetter responseGetter) {
297
    super.setResponseGetter(responseGetter);
1✔
298
    trySetResponseGetter(listItems, responseGetter);
1✔
299
  }
1✔
300
}
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

© 2025 Coveralls, Inc