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

stripe / stripe-java / #14665

16 Aug 2023 06:23PM UTC coverage: 18.919% (+4.6%) from 14.344%
#14665

push

github-actions

web-flow
stripe-java v23 release (#1622)

11114 of 11114 new or added lines in 307 files covered. (100.0%)

14987 of 79217 relevant lines covered (18.92%)

0.19 hits per line

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

78.95
/src/main/java/com/stripe/model/radar/ValueListItem.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.net.ApiMode;
8
import com.stripe.net.ApiRequestParams;
9
import com.stripe.net.ApiResource;
10
import com.stripe.net.BaseAddress;
11
import com.stripe.net.RequestOptions;
12
import com.stripe.param.radar.ValueListItemCreateParams;
13
import com.stripe.param.radar.ValueListItemListParams;
14
import com.stripe.param.radar.ValueListItemRetrieveParams;
15
import java.util.Map;
16
import lombok.EqualsAndHashCode;
17
import lombok.Getter;
18
import lombok.Setter;
19

20
/**
21
 * Value list items allow you to add specific values to a given Radar value list, which can then be
22
 * used in rules.
23
 *
24
 * <p>Related guide: <a href="https://stripe.com/docs/radar/lists#managing-list-items">Managing list
25
 * items</a>
26
 */
27
@Getter
28
@Setter
29
@EqualsAndHashCode(callSuper = false)
30
public class ValueListItem extends ApiResource implements HasId {
1✔
31
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
32
  @SerializedName("created")
33
  Long created;
34

35
  /** The name or email address of the user who added this item to the value list. */
36
  @SerializedName("created_by")
37
  String createdBy;
38

39
  /** Always true for a deleted object. */
40
  @SerializedName("deleted")
41
  Boolean deleted;
42

43
  /** Unique identifier for the object. */
44
  @Getter(onMethod_ = {@Override})
45
  @SerializedName("id")
46
  String id;
47

48
  /**
49
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
50
   * object exists in test mode.
51
   */
52
  @SerializedName("livemode")
53
  Boolean livemode;
54

55
  /**
56
   * String representing the object's type. Objects of the same type share the same value.
57
   *
58
   * <p>Equal to {@code radar.value_list_item}.
59
   */
60
  @SerializedName("object")
61
  String object;
62

63
  /** The value of the item. */
64
  @SerializedName("value")
65
  String value;
66

67
  /** The identifier of the value list this item belongs to. */
68
  @SerializedName("value_list")
69
  String valueList;
70

71
  /**
72
   * Creates a new {@code ValueListItem} object, which is added to the specified parent value list.
73
   */
74
  public static ValueListItem create(Map<String, Object> params) throws StripeException {
75
    return create(params, (RequestOptions) null);
1✔
76
  }
77

78
  /**
79
   * Creates a new {@code ValueListItem} object, which is added to the specified parent value list.
80
   */
81
  public static ValueListItem create(Map<String, Object> params, RequestOptions options)
82
      throws StripeException {
83
    String path = "/v1/radar/value_list_items";
1✔
84
    return getGlobalResponseGetter()
1✔
85
        .request(
1✔
86
            BaseAddress.API,
87
            ApiResource.RequestMethod.POST,
88
            path,
89
            params,
90
            ValueListItem.class,
91
            options,
92
            ApiMode.V1);
93
  }
94

95
  /**
96
   * Creates a new {@code ValueListItem} object, which is added to the specified parent value list.
97
   */
98
  public static ValueListItem create(ValueListItemCreateParams params) throws StripeException {
99
    return create(params, (RequestOptions) null);
1✔
100
  }
101

102
  /**
103
   * Creates a new {@code ValueListItem} object, which is added to the specified parent value list.
104
   */
105
  public static ValueListItem create(ValueListItemCreateParams params, RequestOptions options)
106
      throws StripeException {
107
    String path = "/v1/radar/value_list_items";
1✔
108
    ApiResource.checkNullTypedParams(path, params);
1✔
109
    return getGlobalResponseGetter()
1✔
110
        .request(
1✔
111
            BaseAddress.API,
112
            ApiResource.RequestMethod.POST,
113
            path,
114
            ApiRequestParams.paramsToMap(params),
1✔
115
            ValueListItem.class,
116
            options,
117
            ApiMode.V1);
118
  }
119

120
  /** Deletes a {@code ValueListItem} object, removing it from its parent value list. */
121
  public ValueListItem delete() throws StripeException {
122
    return delete((Map<String, Object>) null, (RequestOptions) null);
1✔
123
  }
124

125
  /** Deletes a {@code ValueListItem} object, removing it from its parent value list. */
126
  public ValueListItem delete(RequestOptions options) throws StripeException {
127
    return delete((Map<String, Object>) null, options);
×
128
  }
129

130
  /** Deletes a {@code ValueListItem} object, removing it from its parent value list. */
131
  public ValueListItem delete(Map<String, Object> params) throws StripeException {
132
    return delete(params, (RequestOptions) null);
×
133
  }
134

135
  /** Deletes a {@code ValueListItem} object, removing it from its parent value list. */
136
  public ValueListItem delete(Map<String, Object> params, RequestOptions options)
137
      throws StripeException {
138
    String path =
1✔
139
        String.format("/v1/radar/value_list_items/%s", ApiResource.urlEncodeId(this.getId()));
1✔
140
    return getResponseGetter()
1✔
141
        .request(
1✔
142
            BaseAddress.API,
143
            ApiResource.RequestMethod.DELETE,
144
            path,
145
            params,
146
            ValueListItem.class,
147
            options,
148
            ApiMode.V1);
149
  }
150

151
  /**
152
   * Returns a list of {@code ValueListItem} objects. The objects are sorted in descending order by
153
   * creation date, with the most recently created object appearing first.
154
   */
155
  public static ValueListItemCollection list(Map<String, Object> params) throws StripeException {
156
    return list(params, (RequestOptions) null);
1✔
157
  }
158

159
  /**
160
   * Returns a list of {@code ValueListItem} objects. The objects are sorted in descending order by
161
   * creation date, with the most recently created object appearing first.
162
   */
163
  public static ValueListItemCollection list(Map<String, Object> params, RequestOptions options)
164
      throws StripeException {
165
    String path = "/v1/radar/value_list_items";
1✔
166
    return getGlobalResponseGetter()
1✔
167
        .request(
1✔
168
            BaseAddress.API,
169
            ApiResource.RequestMethod.GET,
170
            path,
171
            params,
172
            ValueListItemCollection.class,
173
            options,
174
            ApiMode.V1);
175
  }
176

177
  /**
178
   * Returns a list of {@code ValueListItem} objects. The objects are sorted in descending order by
179
   * creation date, with the most recently created object appearing first.
180
   */
181
  public static ValueListItemCollection list(ValueListItemListParams params)
182
      throws StripeException {
183
    return list(params, (RequestOptions) null);
1✔
184
  }
185

186
  /**
187
   * Returns a list of {@code ValueListItem} objects. The objects are sorted in descending order by
188
   * creation date, with the most recently created object appearing first.
189
   */
190
  public static ValueListItemCollection list(ValueListItemListParams params, RequestOptions options)
191
      throws StripeException {
192
    String path = "/v1/radar/value_list_items";
1✔
193
    ApiResource.checkNullTypedParams(path, params);
1✔
194
    return getGlobalResponseGetter()
1✔
195
        .request(
1✔
196
            BaseAddress.API,
197
            ApiResource.RequestMethod.GET,
198
            path,
199
            ApiRequestParams.paramsToMap(params),
1✔
200
            ValueListItemCollection.class,
201
            options,
202
            ApiMode.V1);
203
  }
204

205
  /** Retrieves a {@code ValueListItem} object. */
206
  public static ValueListItem retrieve(String item) throws StripeException {
207
    return retrieve(item, (Map<String, Object>) null, (RequestOptions) null);
1✔
208
  }
209

210
  /** Retrieves a {@code ValueListItem} object. */
211
  public static ValueListItem retrieve(String item, RequestOptions options) throws StripeException {
212
    return retrieve(item, (Map<String, Object>) null, options);
×
213
  }
214

215
  /** Retrieves a {@code ValueListItem} object. */
216
  public static ValueListItem retrieve(
217
      String item, Map<String, Object> params, RequestOptions options) throws StripeException {
218
    String path = String.format("/v1/radar/value_list_items/%s", ApiResource.urlEncodeId(item));
1✔
219
    return getGlobalResponseGetter()
1✔
220
        .request(
1✔
221
            BaseAddress.API,
222
            ApiResource.RequestMethod.GET,
223
            path,
224
            params,
225
            ValueListItem.class,
226
            options,
227
            ApiMode.V1);
228
  }
229

230
  /** Retrieves a {@code ValueListItem} object. */
231
  public static ValueListItem retrieve(
232
      String item, ValueListItemRetrieveParams params, RequestOptions options)
233
      throws StripeException {
234
    String path = String.format("/v1/radar/value_list_items/%s", ApiResource.urlEncodeId(item));
×
235
    ApiResource.checkNullTypedParams(path, params);
×
236
    return getGlobalResponseGetter()
×
237
        .request(
×
238
            BaseAddress.API,
239
            ApiResource.RequestMethod.GET,
240
            path,
241
            ApiRequestParams.paramsToMap(params),
×
242
            ValueListItem.class,
243
            options,
244
            ApiMode.V1);
245
  }
246
}
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