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

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

20 Sep 2024 09:37AM UTC coverage: 11.825%. First build
#3534

push

web-flow
Merge a60f52f31 into 9bb424b6b

1 of 9 new or added lines in 2 files covered. (11.11%)

12592 of 106483 relevant lines covered (11.83%)

0.12 hits per line

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

0.0
/src/main/java/com/adyen/model/checkout/Mandate.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 71
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.checkout;
14

15
import java.util.Objects;
16
import java.util.Arrays;
17
import java.util.Map;
18
import java.util.HashMap;
19
import com.fasterxml.jackson.annotation.JsonInclude;
20
import com.fasterxml.jackson.annotation.JsonProperty;
21
import com.fasterxml.jackson.annotation.JsonCreator;
22
import com.fasterxml.jackson.annotation.JsonTypeName;
23
import com.fasterxml.jackson.annotation.JsonValue;
24
import io.swagger.annotations.ApiModel;
25
import io.swagger.annotations.ApiModelProperty;
26
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
27
import com.fasterxml.jackson.core.JsonProcessingException;
28

29

30
/**
31
 * Mandate
32
 */
33
@JsonPropertyOrder({
34
  Mandate.JSON_PROPERTY_AMOUNT,
35
  Mandate.JSON_PROPERTY_AMOUNT_RULE,
36
  Mandate.JSON_PROPERTY_BILLING_ATTEMPTS_RULE,
37
  Mandate.JSON_PROPERTY_BILLING_DAY,
38
  Mandate.JSON_PROPERTY_COUNT,
39
  Mandate.JSON_PROPERTY_ENDS_AT,
40
  Mandate.JSON_PROPERTY_FREQUENCY,
41
  Mandate.JSON_PROPERTY_REMARKS,
42
  Mandate.JSON_PROPERTY_STARTS_AT
43
})
44

45
public class Mandate {
46
  public static final String JSON_PROPERTY_AMOUNT = "amount";
47
  private String amount;
48

49
  /**
50
   * The limitation rule of the billing amount.  Possible values:  * **max**: The transaction amount can not exceed the `amount`.   * **exact**: The transaction amount should be the same as the `amount`.  
51
   */
52
  public enum AmountRuleEnum {
×
53
    MAX("max"),
×
54
    
55
    EXACT("exact");
×
56

57
    private String value;
58

59
    AmountRuleEnum(String value) {
×
60
      this.value = value;
×
61
    }
×
62

63
    @JsonValue
64
    public String getValue() {
65
      return value;
×
66
    }
67

68
    @Override
69
    public String toString() {
70
      return String.valueOf(value);
×
71
    }
72

73
    @JsonCreator
74
    public static AmountRuleEnum fromValue(String value) {
75
      for (AmountRuleEnum b : AmountRuleEnum.values()) {
×
76
        if (b.value.equals(value)) {
×
77
          return b;
×
78
        }
79
      }
80
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
81
    }
82
  }
83

84
  public static final String JSON_PROPERTY_AMOUNT_RULE = "amountRule";
85
  private AmountRuleEnum amountRule;
86

87
  /**
88
   * The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date.  Possible values:   * **on**: On a specific date.   * **before**:  Before and on a specific date.   * **after**: On and after a specific date.  
89
   */
90
  public enum BillingAttemptsRuleEnum {
×
91
    ON("on"),
×
92
    
93
    BEFORE("before"),
×
94
    
95
    AFTER("after");
×
96

97
    private String value;
98

99
    BillingAttemptsRuleEnum(String value) {
×
100
      this.value = value;
×
101
    }
×
102

103
    @JsonValue
104
    public String getValue() {
105
      return value;
×
106
    }
107

108
    @Override
109
    public String toString() {
110
      return String.valueOf(value);
×
111
    }
112

113
    @JsonCreator
114
    public static BillingAttemptsRuleEnum fromValue(String value) {
115
      for (BillingAttemptsRuleEnum b : BillingAttemptsRuleEnum.values()) {
×
116
        if (b.value.equals(value)) {
×
117
          return b;
×
118
        }
119
      }
120
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
121
    }
122
  }
123

124
  public static final String JSON_PROPERTY_BILLING_ATTEMPTS_RULE = "billingAttemptsRule";
125
  private BillingAttemptsRuleEnum billingAttemptsRule;
126

127
  public static final String JSON_PROPERTY_BILLING_DAY = "billingDay";
128
  private String billingDay;
129

130
  public static final String JSON_PROPERTY_COUNT = "count";
131
  private String count;
132

133
  public static final String JSON_PROPERTY_ENDS_AT = "endsAt";
134
  private String endsAt;
135

136
  /**
137
   * The frequency with which a shopper should be charged.  Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.
138
   */
139
  public enum FrequencyEnum {
×
140
    ADHOC("adhoc"),
×
141
    
142
    DAILY("daily"),
×
143
    
144
    WEEKLY("weekly"),
×
145
    
146
    BIWEEKLY("biWeekly"),
×
147
    
148
    MONTHLY("monthly"),
×
149
    
150
    QUARTERLY("quarterly"),
×
151
    
152
    HALFYEARLY("halfYearly"),
×
153
    
154
    YEARLY("yearly");
×
155

156
    private String value;
157

158
    FrequencyEnum(String value) {
×
159
      this.value = value;
×
160
    }
×
161

162
    @JsonValue
163
    public String getValue() {
164
      return value;
×
165
    }
166

167
    @Override
168
    public String toString() {
169
      return String.valueOf(value);
×
170
    }
171

172
    @JsonCreator
173
    public static FrequencyEnum fromValue(String value) {
174
      for (FrequencyEnum b : FrequencyEnum.values()) {
×
175
        if (b.value.equals(value)) {
×
176
          return b;
×
177
        }
178
      }
179
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
180
    }
181
  }
182

183
  public static final String JSON_PROPERTY_FREQUENCY = "frequency";
184
  private FrequencyEnum frequency;
185

186
  public static final String JSON_PROPERTY_REMARKS = "remarks";
187
  private String remarks;
188

189
  public static final String JSON_PROPERTY_STARTS_AT = "startsAt";
190
  private String startsAt;
191

192
  public Mandate() { 
×
193
  }
×
194

195
  public Mandate amount(String amount) {
196
    this.amount = amount;
×
197
    return this;
×
198
  }
199

200
   /**
201
   * The billing amount (in minor units) of the recurring transactions.
202
   * @return amount
203
  **/
204
  @ApiModelProperty(required = true, value = "The billing amount (in minor units) of the recurring transactions.")
205
  @JsonProperty(JSON_PROPERTY_AMOUNT)
206
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
207

208
  public String getAmount() {
209
    return amount;
×
210
  }
211

212

213
 /**
214
  * The billing amount (in minor units) of the recurring transactions.
215
  *
216
  * @param amount
217
  */ 
218
  @JsonProperty(JSON_PROPERTY_AMOUNT)
219
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
220
  public void setAmount(String amount) {
221
    this.amount = amount;
×
222
  }
×
223

224

225
  public Mandate amountRule(AmountRuleEnum amountRule) {
226
    this.amountRule = amountRule;
×
227
    return this;
×
228
  }
229

230
   /**
231
   * The limitation rule of the billing amount.  Possible values:  * **max**: The transaction amount can not exceed the `amount`.   * **exact**: The transaction amount should be the same as the `amount`.  
232
   * @return amountRule
233
  **/
234
  @ApiModelProperty(value = "The limitation rule of the billing amount.  Possible values:  * **max**: The transaction amount can not exceed the `amount`.   * **exact**: The transaction amount should be the same as the `amount`.  ")
235
  @JsonProperty(JSON_PROPERTY_AMOUNT_RULE)
236
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
237

238
  public AmountRuleEnum getAmountRule() {
239
    return amountRule;
×
240
  }
241

242

243
 /**
244
  * The limitation rule of the billing amount.  Possible values:  * **max**: The transaction amount can not exceed the `amount`.   * **exact**: The transaction amount should be the same as the `amount`.  
245
  *
246
  * @param amountRule
247
  */ 
248
  @JsonProperty(JSON_PROPERTY_AMOUNT_RULE)
249
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
250
  public void setAmountRule(AmountRuleEnum amountRule) {
251
    this.amountRule = amountRule;
×
252
  }
×
253

254

255
  public Mandate billingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) {
256
    this.billingAttemptsRule = billingAttemptsRule;
×
257
    return this;
×
258
  }
259

260
   /**
261
   * The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date.  Possible values:   * **on**: On a specific date.   * **before**:  Before and on a specific date.   * **after**: On and after a specific date.  
262
   * @return billingAttemptsRule
263
  **/
264
  @ApiModelProperty(value = "The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date.  Possible values:   * **on**: On a specific date.   * **before**:  Before and on a specific date.   * **after**: On and after a specific date.  ")
265
  @JsonProperty(JSON_PROPERTY_BILLING_ATTEMPTS_RULE)
266
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
267

268
  public BillingAttemptsRuleEnum getBillingAttemptsRule() {
269
    return billingAttemptsRule;
×
270
  }
271

272

273
 /**
274
  * The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date.  Possible values:   * **on**: On a specific date.   * **before**:  Before and on a specific date.   * **after**: On and after a specific date.  
275
  *
276
  * @param billingAttemptsRule
277
  */ 
278
  @JsonProperty(JSON_PROPERTY_BILLING_ATTEMPTS_RULE)
279
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
280
  public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) {
281
    this.billingAttemptsRule = billingAttemptsRule;
×
282
  }
×
283

284

285
  public Mandate billingDay(String billingDay) {
286
    this.billingDay = billingDay;
×
287
    return this;
×
288
  }
289

290
   /**
291
   * The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date.  Possible values: 1-31 based on the `frequency`.
292
   * @return billingDay
293
  **/
294
  @ApiModelProperty(value = "The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date.  Possible values: 1-31 based on the `frequency`.")
295
  @JsonProperty(JSON_PROPERTY_BILLING_DAY)
296
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
297

298
  public String getBillingDay() {
299
    return billingDay;
×
300
  }
301

302

303
 /**
304
  * The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date.  Possible values: 1-31 based on the `frequency`.
305
  *
306
  * @param billingDay
307
  */ 
308
  @JsonProperty(JSON_PROPERTY_BILLING_DAY)
309
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
310
  public void setBillingDay(String billingDay) {
311
    this.billingDay = billingDay;
×
312
  }
×
313

314

315
  public Mandate count(String count) {
NEW
316
    this.count = count;
×
NEW
317
    return this;
×
318
  }
319

320
   /**
321
   * The number of transactions that can be performed within the given frequency.
322
   * @return count
323
  **/
324
  @ApiModelProperty(value = "The number of transactions that can be performed within the given frequency.")
325
  @JsonProperty(JSON_PROPERTY_COUNT)
326
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
327

328
  public String getCount() {
NEW
329
    return count;
×
330
  }
331

332

333
 /**
334
  * The number of transactions that can be performed within the given frequency.
335
  *
336
  * @param count
337
  */ 
338
  @JsonProperty(JSON_PROPERTY_COUNT)
339
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
340
  public void setCount(String count) {
NEW
341
    this.count = count;
×
NEW
342
  }
×
343

344

345
  public Mandate endsAt(String endsAt) {
346
    this.endsAt = endsAt;
×
347
    return this;
×
348
  }
349

350
   /**
351
   * End date of the billing plan, in YYYY-MM-DD format.
352
   * @return endsAt
353
  **/
354
  @ApiModelProperty(required = true, value = "End date of the billing plan, in YYYY-MM-DD format.")
355
  @JsonProperty(JSON_PROPERTY_ENDS_AT)
356
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
357

358
  public String getEndsAt() {
359
    return endsAt;
×
360
  }
361

362

363
 /**
364
  * End date of the billing plan, in YYYY-MM-DD format.
365
  *
366
  * @param endsAt
367
  */ 
368
  @JsonProperty(JSON_PROPERTY_ENDS_AT)
369
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
370
  public void setEndsAt(String endsAt) {
371
    this.endsAt = endsAt;
×
372
  }
×
373

374

375
  public Mandate frequency(FrequencyEnum frequency) {
376
    this.frequency = frequency;
×
377
    return this;
×
378
  }
379

380
   /**
381
   * The frequency with which a shopper should be charged.  Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.
382
   * @return frequency
383
  **/
384
  @ApiModelProperty(required = true, value = "The frequency with which a shopper should be charged.  Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.")
385
  @JsonProperty(JSON_PROPERTY_FREQUENCY)
386
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
387

388
  public FrequencyEnum getFrequency() {
389
    return frequency;
×
390
  }
391

392

393
 /**
394
  * The frequency with which a shopper should be charged.  Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.
395
  *
396
  * @param frequency
397
  */ 
398
  @JsonProperty(JSON_PROPERTY_FREQUENCY)
399
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
400
  public void setFrequency(FrequencyEnum frequency) {
401
    this.frequency = frequency;
×
402
  }
×
403

404

405
  public Mandate remarks(String remarks) {
406
    this.remarks = remarks;
×
407
    return this;
×
408
  }
409

410
   /**
411
   * The message shown by UPI to the shopper on the approval screen.
412
   * @return remarks
413
  **/
414
  @ApiModelProperty(value = "The message shown by UPI to the shopper on the approval screen.")
415
  @JsonProperty(JSON_PROPERTY_REMARKS)
416
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
417

418
  public String getRemarks() {
419
    return remarks;
×
420
  }
421

422

423
 /**
424
  * The message shown by UPI to the shopper on the approval screen.
425
  *
426
  * @param remarks
427
  */ 
428
  @JsonProperty(JSON_PROPERTY_REMARKS)
429
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
430
  public void setRemarks(String remarks) {
431
    this.remarks = remarks;
×
432
  }
×
433

434

435
  public Mandate startsAt(String startsAt) {
436
    this.startsAt = startsAt;
×
437
    return this;
×
438
  }
439

440
   /**
441
   * Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.
442
   * @return startsAt
443
  **/
444
  @ApiModelProperty(value = "Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.")
445
  @JsonProperty(JSON_PROPERTY_STARTS_AT)
446
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
447

448
  public String getStartsAt() {
449
    return startsAt;
×
450
  }
451

452

453
 /**
454
  * Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.
455
  *
456
  * @param startsAt
457
  */ 
458
  @JsonProperty(JSON_PROPERTY_STARTS_AT)
459
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
460
  public void setStartsAt(String startsAt) {
461
    this.startsAt = startsAt;
×
462
  }
×
463

464

465
  /**
466
   * Return true if this Mandate object is equal to o.
467
   */
468
  @Override
469
  public boolean equals(Object o) {
470
    if (this == o) {
×
471
      return true;
×
472
    }
473
    if (o == null || getClass() != o.getClass()) {
×
474
      return false;
×
475
    }
476
    Mandate mandate = (Mandate) o;
×
477
    return Objects.equals(this.amount, mandate.amount) &&
×
478
        Objects.equals(this.amountRule, mandate.amountRule) &&
×
479
        Objects.equals(this.billingAttemptsRule, mandate.billingAttemptsRule) &&
×
480
        Objects.equals(this.billingDay, mandate.billingDay) &&
×
NEW
481
        Objects.equals(this.count, mandate.count) &&
×
482
        Objects.equals(this.endsAt, mandate.endsAt) &&
×
483
        Objects.equals(this.frequency, mandate.frequency) &&
×
484
        Objects.equals(this.remarks, mandate.remarks) &&
×
485
        Objects.equals(this.startsAt, mandate.startsAt);
×
486
  }
487

488
  @Override
489
  public int hashCode() {
NEW
490
    return Objects.hash(amount, amountRule, billingAttemptsRule, billingDay, count, endsAt, frequency, remarks, startsAt);
×
491
  }
492

493
  @Override
494
  public String toString() {
495
    StringBuilder sb = new StringBuilder();
×
496
    sb.append("class Mandate {\n");
×
497
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
498
    sb.append("    amountRule: ").append(toIndentedString(amountRule)).append("\n");
×
499
    sb.append("    billingAttemptsRule: ").append(toIndentedString(billingAttemptsRule)).append("\n");
×
500
    sb.append("    billingDay: ").append(toIndentedString(billingDay)).append("\n");
×
NEW
501
    sb.append("    count: ").append(toIndentedString(count)).append("\n");
×
502
    sb.append("    endsAt: ").append(toIndentedString(endsAt)).append("\n");
×
503
    sb.append("    frequency: ").append(toIndentedString(frequency)).append("\n");
×
504
    sb.append("    remarks: ").append(toIndentedString(remarks)).append("\n");
×
505
    sb.append("    startsAt: ").append(toIndentedString(startsAt)).append("\n");
×
506
    sb.append("}");
×
507
    return sb.toString();
×
508
  }
509

510
  /**
511
   * Convert the given object to string with each line indented by 4 spaces
512
   * (except the first line).
513
   */
514
  private String toIndentedString(Object o) {
515
    if (o == null) {
×
516
      return "null";
×
517
    }
518
    return o.toString().replace("\n", "\n    ");
×
519
  }
520

521
/**
522
   * Create an instance of Mandate given an JSON string
523
   *
524
   * @param jsonString JSON string
525
   * @return An instance of Mandate
526
   * @throws JsonProcessingException if the JSON string is invalid with respect to Mandate
527
   */
528
  public static Mandate fromJson(String jsonString) throws JsonProcessingException {
529
    return JSON.getMapper().readValue(jsonString, Mandate.class);
×
530
  }
531
/**
532
  * Convert an instance of Mandate to an JSON string
533
  *
534
  * @return JSON string
535
  */
536
  public String toJson() throws JsonProcessingException {
537
    return JSON.getMapper().writeValueAsString(this);
×
538
  }
539
}
540

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