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

Adyen / adyen-java-api-library / #2775

30 Oct 2023 03:06PM CUT coverage: 12.824%. First build
#2775

push

web-flow
Merge 9921af673 into 891748f22

112 of 112 new or added lines in 12 files covered. (100.0%)

12346 of 96273 relevant lines covered (12.82%)

0.13 hits per line

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

37.37
/src/main/java/com/adyen/model/transfers/Transaction.java
1
/*
2
 * Transfers API
3
 *
4
 * The version of the OpenAPI document: 4
5
 * 
6
 *
7
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
 * https://openapi-generator.tech
9
 * Do not edit the class manually.
10
 */
11

12

13
package com.adyen.model.transfers;
14

15
import java.util.Objects;
16
import java.util.Arrays;
17
import java.util.Map;
18
import java.util.HashMap;
19
import com.adyen.model.transfers.Amount;
20
import com.adyen.model.transfers.ResourceReference;
21
import com.adyen.model.transfers.TransferData;
22
import com.fasterxml.jackson.annotation.JsonInclude;
23
import com.fasterxml.jackson.annotation.JsonProperty;
24
import com.fasterxml.jackson.annotation.JsonCreator;
25
import com.fasterxml.jackson.annotation.JsonTypeName;
26
import com.fasterxml.jackson.annotation.JsonValue;
27
import io.swagger.annotations.ApiModel;
28
import io.swagger.annotations.ApiModelProperty;
29
import java.time.OffsetDateTime;
30
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
31
import com.fasterxml.jackson.core.JsonProcessingException;
32

33

34
/**
35
 * Transaction
36
 */
37
@JsonPropertyOrder({
38
  Transaction.JSON_PROPERTY_ACCOUNT_HOLDER,
39
  Transaction.JSON_PROPERTY_AMOUNT,
40
  Transaction.JSON_PROPERTY_BALANCE_ACCOUNT,
41
  Transaction.JSON_PROPERTY_BALANCE_PLATFORM,
42
  Transaction.JSON_PROPERTY_BOOKING_DATE,
43
  Transaction.JSON_PROPERTY_CREATION_DATE,
44
  Transaction.JSON_PROPERTY_ID,
45
  Transaction.JSON_PROPERTY_STATUS,
46
  Transaction.JSON_PROPERTY_TRANSFER,
47
  Transaction.JSON_PROPERTY_VALUE_DATE
48
})
49

50
public class Transaction {
51
  public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder";
52
  private ResourceReference accountHolder;
53

54
  public static final String JSON_PROPERTY_AMOUNT = "amount";
55
  private Amount amount;
56

57
  public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount";
58
  private ResourceReference balanceAccount;
59

60
  public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform";
61
  private String balancePlatform;
62

63
  public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate";
64
  private OffsetDateTime bookingDate;
65

66
  public static final String JSON_PROPERTY_CREATION_DATE = "creationDate";
67
  private OffsetDateTime creationDate;
68

69
  public static final String JSON_PROPERTY_ID = "id";
70
  private String id;
71

72
  /**
73
   * The status of the transaction.   Possible values:  * **pending**: The transaction is still pending.  * **booked**: The transaction has been booked to the balance account.  
74
   */
75
  public enum StatusEnum {
1✔
76
    BOOKED("booked"),
1✔
77
    
78
    PENDING("pending");
1✔
79

80
    private String value;
81

82
    StatusEnum(String value) {
1✔
83
      this.value = value;
1✔
84
    }
1✔
85

86
    @JsonValue
87
    public String getValue() {
88
      return value;
×
89
    }
90

91
    @Override
92
    public String toString() {
93
      return String.valueOf(value);
×
94
    }
95

96
    @JsonCreator
97
    public static StatusEnum fromValue(String value) {
98
      for (StatusEnum b : StatusEnum.values()) {
1✔
99
        if (b.value.equals(value)) {
1✔
100
          return b;
1✔
101
        }
102
      }
103
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
104
    }
105
  }
106

107
  public static final String JSON_PROPERTY_STATUS = "status";
108
  private StatusEnum status;
109

110
  public static final String JSON_PROPERTY_TRANSFER = "transfer";
111
  private TransferData transfer;
112

113
  public static final String JSON_PROPERTY_VALUE_DATE = "valueDate";
114
  private OffsetDateTime valueDate;
115

116
  public Transaction() { 
1✔
117
  }
1✔
118

119
  public Transaction accountHolder(ResourceReference accountHolder) {
120
    this.accountHolder = accountHolder;
×
121
    return this;
×
122
  }
123

124
   /**
125
   * Get accountHolder
126
   * @return accountHolder
127
  **/
128
  @ApiModelProperty(required = true, value = "")
129
  @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER)
130
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
131

132
  public ResourceReference getAccountHolder() {
133
    return accountHolder;
1✔
134
  }
135

136

137
  @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER)
138
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
139
  public void setAccountHolder(ResourceReference accountHolder) {
140
    this.accountHolder = accountHolder;
1✔
141
  }
1✔
142

143

144
  public Transaction amount(Amount amount) {
145
    this.amount = amount;
×
146
    return this;
×
147
  }
148

149
   /**
150
   * Get amount
151
   * @return amount
152
  **/
153
  @ApiModelProperty(required = true, value = "")
154
  @JsonProperty(JSON_PROPERTY_AMOUNT)
155
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
156

157
  public Amount getAmount() {
158
    return amount;
×
159
  }
160

161

162
  @JsonProperty(JSON_PROPERTY_AMOUNT)
163
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
164
  public void setAmount(Amount amount) {
165
    this.amount = amount;
1✔
166
  }
1✔
167

168

169
  public Transaction balanceAccount(ResourceReference balanceAccount) {
170
    this.balanceAccount = balanceAccount;
×
171
    return this;
×
172
  }
173

174
   /**
175
   * Get balanceAccount
176
   * @return balanceAccount
177
  **/
178
  @ApiModelProperty(required = true, value = "")
179
  @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT)
180
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
181

182
  public ResourceReference getBalanceAccount() {
183
    return balanceAccount;
1✔
184
  }
185

186

187
  @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT)
188
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
189
  public void setBalanceAccount(ResourceReference balanceAccount) {
190
    this.balanceAccount = balanceAccount;
1✔
191
  }
1✔
192

193

194
  public Transaction balancePlatform(String balancePlatform) {
195
    this.balancePlatform = balancePlatform;
×
196
    return this;
×
197
  }
198

199
   /**
200
   * The unique identifier of the balance platform.
201
   * @return balancePlatform
202
  **/
203
  @ApiModelProperty(required = true, value = "The unique identifier of the balance platform.")
204
  @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM)
205
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
206

207
  public String getBalancePlatform() {
208
    return balancePlatform;
×
209
  }
210

211

212
  @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM)
213
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
214
  public void setBalancePlatform(String balancePlatform) {
215
    this.balancePlatform = balancePlatform;
1✔
216
  }
1✔
217

218

219
  public Transaction bookingDate(OffsetDateTime bookingDate) {
220
    this.bookingDate = bookingDate;
×
221
    return this;
×
222
  }
223

224
   /**
225
   * The date the transaction was booked into the balance account.
226
   * @return bookingDate
227
  **/
228
  @ApiModelProperty(required = true, value = "The date the transaction was booked into the balance account.")
229
  @JsonProperty(JSON_PROPERTY_BOOKING_DATE)
230
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
231

232
  public OffsetDateTime getBookingDate() {
233
    return bookingDate;
×
234
  }
235

236

237
  @JsonProperty(JSON_PROPERTY_BOOKING_DATE)
238
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
239
  public void setBookingDate(OffsetDateTime bookingDate) {
240
    this.bookingDate = bookingDate;
1✔
241
  }
1✔
242

243

244
  public Transaction creationDate(OffsetDateTime creationDate) {
245
    this.creationDate = creationDate;
×
246
    return this;
×
247
  }
248

249
   /**
250
   * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.
251
   * @return creationDate
252
  **/
253
  @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.")
254
  @JsonProperty(JSON_PROPERTY_CREATION_DATE)
255
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
256

257
  public OffsetDateTime getCreationDate() {
258
    return creationDate;
×
259
  }
260

261

262
  @JsonProperty(JSON_PROPERTY_CREATION_DATE)
263
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
264
  public void setCreationDate(OffsetDateTime creationDate) {
265
    this.creationDate = creationDate;
1✔
266
  }
1✔
267

268

269
  public Transaction id(String id) {
270
    this.id = id;
×
271
    return this;
×
272
  }
273

274
   /**
275
   * The unique identifier of the transaction.
276
   * @return id
277
  **/
278
  @ApiModelProperty(required = true, value = "The unique identifier of the transaction.")
279
  @JsonProperty(JSON_PROPERTY_ID)
280
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
281

282
  public String getId() {
283
    return id;
1✔
284
  }
285

286

287
  @JsonProperty(JSON_PROPERTY_ID)
288
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
289
  public void setId(String id) {
290
    this.id = id;
1✔
291
  }
1✔
292

293

294
  public Transaction status(StatusEnum status) {
295
    this.status = status;
×
296
    return this;
×
297
  }
298

299
   /**
300
   * The status of the transaction.   Possible values:  * **pending**: The transaction is still pending.  * **booked**: The transaction has been booked to the balance account.  
301
   * @return status
302
  **/
303
  @ApiModelProperty(required = true, value = "The status of the transaction.   Possible values:  * **pending**: The transaction is still pending.  * **booked**: The transaction has been booked to the balance account.  ")
304
  @JsonProperty(JSON_PROPERTY_STATUS)
305
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
306

307
  public StatusEnum getStatus() {
308
    return status;
1✔
309
  }
310

311

312
  @JsonProperty(JSON_PROPERTY_STATUS)
313
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
314
  public void setStatus(StatusEnum status) {
315
    this.status = status;
1✔
316
  }
1✔
317

318

319
  public Transaction transfer(TransferData transfer) {
320
    this.transfer = transfer;
×
321
    return this;
×
322
  }
323

324
   /**
325
   * Get transfer
326
   * @return transfer
327
  **/
328
  @ApiModelProperty(value = "")
329
  @JsonProperty(JSON_PROPERTY_TRANSFER)
330
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
331

332
  public TransferData getTransfer() {
333
    return transfer;
1✔
334
  }
335

336

337
  @JsonProperty(JSON_PROPERTY_TRANSFER)
338
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
339
  public void setTransfer(TransferData transfer) {
340
    this.transfer = transfer;
1✔
341
  }
1✔
342

343

344
  public Transaction valueDate(OffsetDateTime valueDate) {
345
    this.valueDate = valueDate;
×
346
    return this;
×
347
  }
348

349
   /**
350
   * The date the transfer amount becomes available in the balance account.
351
   * @return valueDate
352
  **/
353
  @ApiModelProperty(required = true, value = "The date the transfer amount becomes available in the balance account.")
354
  @JsonProperty(JSON_PROPERTY_VALUE_DATE)
355
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
356

357
  public OffsetDateTime getValueDate() {
358
    return valueDate;
×
359
  }
360

361

362
  @JsonProperty(JSON_PROPERTY_VALUE_DATE)
363
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
364
  public void setValueDate(OffsetDateTime valueDate) {
365
    this.valueDate = valueDate;
1✔
366
  }
1✔
367

368

369
  /**
370
   * Return true if this Transaction object is equal to o.
371
   */
372
  @Override
373
  public boolean equals(Object o) {
374
    if (this == o) {
×
375
      return true;
×
376
    }
377
    if (o == null || getClass() != o.getClass()) {
×
378
      return false;
×
379
    }
380
    Transaction transaction = (Transaction) o;
×
381
    return Objects.equals(this.accountHolder, transaction.accountHolder) &&
×
382
        Objects.equals(this.amount, transaction.amount) &&
×
383
        Objects.equals(this.balanceAccount, transaction.balanceAccount) &&
×
384
        Objects.equals(this.balancePlatform, transaction.balancePlatform) &&
×
385
        Objects.equals(this.bookingDate, transaction.bookingDate) &&
×
386
        Objects.equals(this.creationDate, transaction.creationDate) &&
×
387
        Objects.equals(this.id, transaction.id) &&
×
388
        Objects.equals(this.status, transaction.status) &&
×
389
        Objects.equals(this.transfer, transaction.transfer) &&
×
390
        Objects.equals(this.valueDate, transaction.valueDate);
×
391
  }
392

393
  @Override
394
  public int hashCode() {
395
    return Objects.hash(accountHolder, amount, balanceAccount, balancePlatform, bookingDate, creationDate, id, status, transfer, valueDate);
×
396
  }
397

398
  @Override
399
  public String toString() {
400
    StringBuilder sb = new StringBuilder();
×
401
    sb.append("class Transaction {\n");
×
402
    sb.append("    accountHolder: ").append(toIndentedString(accountHolder)).append("\n");
×
403
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
404
    sb.append("    balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n");
×
405
    sb.append("    balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n");
×
406
    sb.append("    bookingDate: ").append(toIndentedString(bookingDate)).append("\n");
×
407
    sb.append("    creationDate: ").append(toIndentedString(creationDate)).append("\n");
×
408
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
×
409
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
×
410
    sb.append("    transfer: ").append(toIndentedString(transfer)).append("\n");
×
411
    sb.append("    valueDate: ").append(toIndentedString(valueDate)).append("\n");
×
412
    sb.append("}");
×
413
    return sb.toString();
×
414
  }
415

416
  /**
417
   * Convert the given object to string with each line indented by 4 spaces
418
   * (except the first line).
419
   */
420
  private String toIndentedString(Object o) {
421
    if (o == null) {
×
422
      return "null";
×
423
    }
424
    return o.toString().replace("\n", "\n    ");
×
425
  }
426

427
/**
428
   * Create an instance of Transaction given an JSON string
429
   *
430
   * @param jsonString JSON string
431
   * @return An instance of Transaction
432
   * @throws JsonProcessingException if the JSON string is invalid with respect to Transaction
433
   */
434
  public static Transaction fromJson(String jsonString) throws JsonProcessingException {
435
    return JSON.getMapper().readValue(jsonString, Transaction.class);
1✔
436
  }
437
/**
438
  * Convert an instance of Transaction to an JSON string
439
  *
440
  * @return JSON string
441
  */
442
  public String toJson() throws JsonProcessingException {
443
    return JSON.getMapper().writeValueAsString(this);
×
444
  }
445
}
446

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