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

stripe / stripe-java / #14885

05 Oct 2023 04:40PM UTC coverage: 19.955% (-0.1%) from 20.054%
#14885

push

github-actions

web-flow
Update generated code (#1662)

* Update generated code for v570

* Update generated code for v571

* Update generated code for v572

* Update generated code for v573

* Update generated code for v574

* Update generated code for v576

* Update generated code for v578

* Update generated code for v579

* Update generated code for v580

* Update generated code for v580

* Update generated code for v581

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

462 of 462 new or added lines in 19 files covered. (100.0%)

17105 of 85717 relevant lines covered (19.96%)

0.2 hits per line

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

0.0
/src/main/java/com/stripe/model/issuing/Token.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.issuing;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.ExpandableField;
7
import com.stripe.model.HasId;
8
import com.stripe.model.StripeObject;
9
import com.stripe.net.ApiMode;
10
import com.stripe.net.ApiRequestParams;
11
import com.stripe.net.ApiResource;
12
import com.stripe.net.BaseAddress;
13
import com.stripe.net.RequestOptions;
14
import com.stripe.net.StripeResponseGetter;
15
import com.stripe.param.issuing.TokenListParams;
16
import com.stripe.param.issuing.TokenRetrieveParams;
17
import com.stripe.param.issuing.TokenUpdateParams;
18
import java.util.List;
19
import java.util.Map;
20
import lombok.EqualsAndHashCode;
21
import lombok.Getter;
22
import lombok.Setter;
23

24
/**
25
 * An issuing token object is created when an issued card is added to a digital wallet. As a <a
26
 * href="https://stripe.com/docs/issuing">card issuer</a>, you can view and manage these tokens
27
 * through Stripe.
28
 */
29
@Getter
30
@Setter
31
@EqualsAndHashCode(callSuper = false)
32
public class Token extends ApiResource implements HasId {
×
33
  /** Card associated with this token. */
34
  @SerializedName("card")
35
  @Getter(lombok.AccessLevel.NONE)
36
  @Setter(lombok.AccessLevel.NONE)
37
  ExpandableField<Card> card;
38

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

43
  /** The hashed ID derived from the device ID from the card network associated with the token. */
44
  @SerializedName("device_fingerprint")
45
  String deviceFingerprint;
46

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

52
  /** The last four digits of the token. */
53
  @SerializedName("last4")
54
  String last4;
55

56
  /**
57
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
58
   * object exists in test mode.
59
   */
60
  @SerializedName("livemode")
61
  Boolean livemode;
62

63
  /**
64
   * The token service provider / card network associated with the token.
65
   *
66
   * <p>One of {@code mastercard}, or {@code visa}.
67
   */
68
  @SerializedName("network")
69
  String network;
70

71
  @SerializedName("network_data")
72
  NetworkData networkData;
73

74
  /**
75
   * Time at which the token was last updated by the card network. Measured in seconds since the
76
   * Unix epoch.
77
   */
78
  @SerializedName("network_updated_at")
79
  Long networkUpdatedAt;
80

81
  /**
82
   * String representing the object's type. Objects of the same type share the same value.
83
   *
84
   * <p>Equal to {@code issuing.token}.
85
   */
86
  @SerializedName("object")
87
  String object;
88

89
  /**
90
   * The usage state of the token.
91
   *
92
   * <p>One of {@code active}, {@code deleted}, {@code requested}, or {@code suspended}.
93
   */
94
  @SerializedName("status")
95
  String status;
96

97
  /**
98
   * The digital wallet for this token, if one was used.
99
   *
100
   * <p>One of {@code apple_pay}, {@code google_pay}, or {@code samsung_pay}.
101
   */
102
  @SerializedName("wallet_provider")
103
  String walletProvider;
104

105
  /** Get ID of expandable {@code card} object. */
106
  public String getCard() {
107
    return (this.card != null) ? this.card.getId() : null;
×
108
  }
109

110
  public void setCard(String id) {
111
    this.card = ApiResource.setExpandableFieldId(id, this.card);
×
112
  }
×
113

114
  /** Get expanded {@code card}. */
115
  public Card getCardObject() {
116
    return (this.card != null) ? this.card.getExpanded() : null;
×
117
  }
118

119
  public void setCardObject(Card expandableObject) {
120
    this.card = new ExpandableField<Card>(expandableObject.getId(), expandableObject);
×
121
  }
×
122

123
  /** Lists all Issuing {@code Token} objects for a given card. */
124
  public static TokenCollection list(Map<String, Object> params) throws StripeException {
125
    return list(params, (RequestOptions) null);
×
126
  }
127

128
  /** Lists all Issuing {@code Token} objects for a given card. */
129
  public static TokenCollection list(Map<String, Object> params, RequestOptions options)
130
      throws StripeException {
131
    String path = "/v1/issuing/tokens";
×
132
    return getGlobalResponseGetter()
×
133
        .request(
×
134
            BaseAddress.API,
135
            ApiResource.RequestMethod.GET,
136
            path,
137
            params,
138
            TokenCollection.class,
139
            options,
140
            ApiMode.V1);
141
  }
142

143
  /** Lists all Issuing {@code Token} objects for a given card. */
144
  public static TokenCollection list(TokenListParams params) throws StripeException {
145
    return list(params, (RequestOptions) null);
×
146
  }
147

148
  /** Lists all Issuing {@code Token} objects for a given card. */
149
  public static TokenCollection list(TokenListParams params, RequestOptions options)
150
      throws StripeException {
151
    String path = "/v1/issuing/tokens";
×
152
    ApiResource.checkNullTypedParams(path, params);
×
153
    return getGlobalResponseGetter()
×
154
        .request(
×
155
            BaseAddress.API,
156
            ApiResource.RequestMethod.GET,
157
            path,
158
            ApiRequestParams.paramsToMap(params),
×
159
            TokenCollection.class,
160
            options,
161
            ApiMode.V1);
162
  }
163

164
  /** Retrieves an Issuing {@code Token} object. */
165
  public static Token retrieve(String token) throws StripeException {
166
    return retrieve(token, (Map<String, Object>) null, (RequestOptions) null);
×
167
  }
168

169
  /** Retrieves an Issuing {@code Token} object. */
170
  public static Token retrieve(String token, RequestOptions options) throws StripeException {
171
    return retrieve(token, (Map<String, Object>) null, options);
×
172
  }
173

174
  /** Retrieves an Issuing {@code Token} object. */
175
  public static Token retrieve(String token, Map<String, Object> params, RequestOptions options)
176
      throws StripeException {
177
    String path = String.format("/v1/issuing/tokens/%s", ApiResource.urlEncodeId(token));
×
178
    return getGlobalResponseGetter()
×
179
        .request(
×
180
            BaseAddress.API,
181
            ApiResource.RequestMethod.GET,
182
            path,
183
            params,
184
            Token.class,
185
            options,
186
            ApiMode.V1);
187
  }
188

189
  /** Retrieves an Issuing {@code Token} object. */
190
  public static Token retrieve(String token, TokenRetrieveParams params, RequestOptions options)
191
      throws StripeException {
192
    String path = String.format("/v1/issuing/tokens/%s", ApiResource.urlEncodeId(token));
×
193
    ApiResource.checkNullTypedParams(path, params);
×
194
    return getGlobalResponseGetter()
×
195
        .request(
×
196
            BaseAddress.API,
197
            ApiResource.RequestMethod.GET,
198
            path,
199
            ApiRequestParams.paramsToMap(params),
×
200
            Token.class,
201
            options,
202
            ApiMode.V1);
203
  }
204

205
  /** Attempts to update the specified Issuing {@code Token} object to the status specified. */
206
  public Token update(Map<String, Object> params) throws StripeException {
207
    return update(params, (RequestOptions) null);
×
208
  }
209

210
  /** Attempts to update the specified Issuing {@code Token} object to the status specified. */
211
  public Token update(Map<String, Object> params, RequestOptions options) throws StripeException {
212
    String path = String.format("/v1/issuing/tokens/%s", ApiResource.urlEncodeId(this.getId()));
×
213
    return getResponseGetter()
×
214
        .request(
×
215
            BaseAddress.API,
216
            ApiResource.RequestMethod.POST,
217
            path,
218
            params,
219
            Token.class,
220
            options,
221
            ApiMode.V1);
222
  }
223

224
  /** Attempts to update the specified Issuing {@code Token} object to the status specified. */
225
  public Token update(TokenUpdateParams params) throws StripeException {
226
    return update(params, (RequestOptions) null);
×
227
  }
228

229
  /** Attempts to update the specified Issuing {@code Token} object to the status specified. */
230
  public Token update(TokenUpdateParams params, RequestOptions options) throws StripeException {
231
    String path = String.format("/v1/issuing/tokens/%s", ApiResource.urlEncodeId(this.getId()));
×
232
    ApiResource.checkNullTypedParams(path, params);
×
233
    return getResponseGetter()
×
234
        .request(
×
235
            BaseAddress.API,
236
            ApiResource.RequestMethod.POST,
237
            path,
238
            ApiRequestParams.paramsToMap(params),
×
239
            Token.class,
240
            options,
241
            ApiMode.V1);
242
  }
243

244
  @Getter
245
  @Setter
246
  @EqualsAndHashCode(callSuper = false)
247
  public static class NetworkData extends StripeObject {
×
248
    @SerializedName("device")
249
    Device device;
250

251
    @SerializedName("mastercard")
252
    Mastercard mastercard;
253

254
    /**
255
     * The network that the token is associated with. An additional hash is included with a name
256
     * matching this value, containing tokenization data specific to the card network.
257
     *
258
     * <p>One of {@code mastercard}, or {@code visa}.
259
     */
260
    @SerializedName("type")
261
    String type;
262

263
    @SerializedName("visa")
264
    Visa visa;
265

266
    @SerializedName("wallet_provider")
267
    WalletProvider walletProvider;
268

269
    @Getter
270
    @Setter
271
    @EqualsAndHashCode(callSuper = false)
272
    public static class Device extends StripeObject {
×
273
      /** An obfuscated ID derived from the device ID. */
274
      @SerializedName("device_fingerprint")
275
      String deviceFingerprint;
276

277
      /** The IP address of the device at provisioning time. */
278
      @SerializedName("ip_address")
279
      String ipAddress;
280

281
      /**
282
       * The geographic latitude/longitude coordinates of the device at provisioning time. The
283
       * format is [+-]decimal/[+-]decimal.
284
       */
285
      @SerializedName("location")
286
      String location;
287

288
      /** The name of the device used for tokenization. */
289
      @SerializedName("name")
290
      String name;
291

292
      /** The phone number of the device used for tokenization. */
293
      @SerializedName("phone_number")
294
      String phoneNumber;
295

296
      /**
297
       * The type of device used for tokenization.
298
       *
299
       * <p>One of {@code other}, {@code phone}, or {@code watch}.
300
       */
301
      @SerializedName("type")
302
      String type;
303
    }
304

305
    @Getter
306
    @Setter
307
    @EqualsAndHashCode(callSuper = false)
308
    public static class Mastercard extends StripeObject {
×
309
      /** A unique reference ID from MasterCard to represent the card account number. */
310
      @SerializedName("card_reference_id")
311
      String cardReferenceId;
312

313
      /** The network-unique identifier for the token. */
314
      @SerializedName("token_reference_id")
315
      String tokenReferenceId;
316

317
      /** The ID of the entity requesting tokenization, specific to MasterCard. */
318
      @SerializedName("token_requestor_id")
319
      String tokenRequestorId;
320

321
      /**
322
       * The name of the entity requesting tokenization, if known. This is directly provided from
323
       * MasterCard.
324
       */
325
      @SerializedName("token_requestor_name")
326
      String tokenRequestorName;
327
    }
328

329
    @Getter
330
    @Setter
331
    @EqualsAndHashCode(callSuper = false)
332
    public static class Visa extends StripeObject {
×
333
      /** A unique reference ID from Visa to represent the card account number. */
334
      @SerializedName("card_reference_id")
335
      String cardReferenceId;
336

337
      /** The network-unique identifier for the token. */
338
      @SerializedName("token_reference_id")
339
      String tokenReferenceId;
340

341
      /** The ID of the entity requesting tokenization, specific to Visa. */
342
      @SerializedName("token_requestor_id")
343
      String tokenRequestorId;
344

345
      /**
346
       * Degree of risk associated with the token between {@code 01} and {@code 99}, with higher
347
       * number indicating higher risk. A {@code 00} value indicates the token was not scored by
348
       * Visa.
349
       */
350
      @SerializedName("token_risk_score")
351
      String tokenRiskScore;
352
    }
353

354
    @Getter
355
    @Setter
356
    @EqualsAndHashCode(callSuper = false)
357
    public static class WalletProvider extends StripeObject {
×
358
      /** The wallet provider-given account ID of the digital wallet the token belongs to. */
359
      @SerializedName("account_id")
360
      String accountId;
361

362
      /**
363
       * An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher score
364
       * indicates more trustworthy.
365
       */
366
      @SerializedName("account_trust_score")
367
      Long accountTrustScore;
368

369
      /**
370
       * The method used for tokenizing a card.
371
       *
372
       * <p>One of {@code app}, {@code manual}, {@code on_file}, or {@code other}.
373
       */
374
      @SerializedName("card_number_source")
375
      String cardNumberSource;
376

377
      @SerializedName("cardholder_address")
378
      CardholderAddress cardholderAddress;
379

380
      /** The name of the cardholder tokenizing the card. */
381
      @SerializedName("cardholder_name")
382
      String cardholderName;
383

384
      /**
385
       * An evaluation on the trustworthiness of the device. A higher score indicates more
386
       * trustworthy.
387
       */
388
      @SerializedName("device_trust_score")
389
      Long deviceTrustScore;
390

391
      /** The hashed email address of the cardholder's account with the wallet provider. */
392
      @SerializedName("hashed_account_email_address")
393
      String hashedAccountEmailAddress;
394

395
      /** The reasons for suggested tokenization given by the card network. */
396
      @SerializedName("reason_codes")
397
      List<String> reasonCodes;
398

399
      /**
400
       * The recommendation on responding to the tokenization request.
401
       *
402
       * <p>One of {@code approve}, {@code decline}, or {@code require_auth}.
403
       */
404
      @SerializedName("suggested_decision")
405
      String suggestedDecision;
406

407
      /** The version of the standard for mapping reason codes followed by the wallet provider. */
408
      @SerializedName("suggested_decision_version")
409
      String suggestedDecisionVersion;
410

411
      @Getter
412
      @Setter
413
      @EqualsAndHashCode(callSuper = false)
414
      public static class CardholderAddress extends StripeObject {
×
415
        /** The street address of the cardholder tokenizing the card. */
416
        @SerializedName("line1")
417
        String line1;
418

419
        /** The postal code of the cardholder tokenizing the card. */
420
        @SerializedName("postal_code")
421
        String postalCode;
422
      }
423
    }
424
  }
425

426
  @Override
427
  public void setResponseGetter(StripeResponseGetter responseGetter) {
428
    super.setResponseGetter(responseGetter);
×
429
    trySetResponseGetter(card, responseGetter);
×
430
    trySetResponseGetter(networkData, responseGetter);
×
431
  }
×
432
}
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