• 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

24.72
/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 70
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.adyen.model.checkout.Amount;
20
import com.adyen.model.checkout.ApplicationInfo;
21
import com.adyen.model.checkout.LineItem;
22
import com.adyen.model.checkout.Split;
23
import com.fasterxml.jackson.annotation.JsonInclude;
24
import com.fasterxml.jackson.annotation.JsonProperty;
25
import com.fasterxml.jackson.annotation.JsonCreator;
26
import com.fasterxml.jackson.annotation.JsonTypeName;
27
import com.fasterxml.jackson.annotation.JsonValue;
28
import io.swagger.annotations.ApiModel;
29
import io.swagger.annotations.ApiModelProperty;
30
import java.util.ArrayList;
31
import java.util.List;
32
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
33
import com.fasterxml.jackson.core.JsonProcessingException;
34

35

36
/**
37
 * PaymentAmountUpdateRequest
38
 */
39
@JsonPropertyOrder({
40
  PaymentAmountUpdateRequest.JSON_PROPERTY_AMOUNT,
41
  PaymentAmountUpdateRequest.JSON_PROPERTY_APPLICATION_INFO,
42
  PaymentAmountUpdateRequest.JSON_PROPERTY_INDUSTRY_USAGE,
43
  PaymentAmountUpdateRequest.JSON_PROPERTY_LINE_ITEMS,
44
  PaymentAmountUpdateRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
45
  PaymentAmountUpdateRequest.JSON_PROPERTY_REFERENCE,
46
  PaymentAmountUpdateRequest.JSON_PROPERTY_SPLITS
47
})
48

49
public class PaymentAmountUpdateRequest {
50
  public static final String JSON_PROPERTY_AMOUNT = "amount";
51
  private Amount amount;
52

53
  public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo";
54
  private ApplicationInfo applicationInfo;
55

56
  /**
57
   * The reason for the amount update. Possible values:  * **delayedCharge**  * **noShow**  * **installment**
58
   */
59
  public enum IndustryUsageEnum {
1✔
60
    DELAYEDCHARGE("delayedCharge"),
1✔
61
    
62
    INSTALLMENT("installment"),
1✔
63
    
64
    NOSHOW("noShow");
1✔
65

66
    private String value;
67

68
    IndustryUsageEnum(String value) {
1✔
69
      this.value = value;
1✔
70
    }
1✔
71

72
    @JsonValue
73
    public String getValue() {
74
      return value;
1✔
75
    }
76

77
    @Override
78
    public String toString() {
79
      return String.valueOf(value);
×
80
    }
81

82
    @JsonCreator
83
    public static IndustryUsageEnum fromValue(String value) {
84
      for (IndustryUsageEnum b : IndustryUsageEnum.values()) {
×
85
        if (b.value.equals(value)) {
×
86
          return b;
×
87
        }
88
      }
89
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
90
    }
91
  }
92

93
  public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage";
94
  private IndustryUsageEnum industryUsage;
95

96
  public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems";
97
  private List<LineItem> lineItems = null;
1✔
98

99
  public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
100
  private String merchantAccount;
101

102
  public static final String JSON_PROPERTY_REFERENCE = "reference";
103
  private String reference;
104

105
  public static final String JSON_PROPERTY_SPLITS = "splits";
106
  private List<Split> splits = null;
1✔
107

108
  public PaymentAmountUpdateRequest() { 
1✔
109
  }
1✔
110

111
  public PaymentAmountUpdateRequest amount(Amount amount) {
112
    this.amount = amount;
×
113
    return this;
×
114
  }
115

116
   /**
117
   * Get amount
118
   * @return amount
119
  **/
120
  @ApiModelProperty(required = true, value = "")
121
  @JsonProperty(JSON_PROPERTY_AMOUNT)
122
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
123

124
  public Amount getAmount() {
125
    return amount;
1✔
126
  }
127

128

129
  @JsonProperty(JSON_PROPERTY_AMOUNT)
130
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
131
  public void setAmount(Amount amount) {
132
    this.amount = amount;
×
133
  }
×
134

135

136
  public PaymentAmountUpdateRequest applicationInfo(ApplicationInfo applicationInfo) {
137
    this.applicationInfo = applicationInfo;
×
138
    return this;
×
139
  }
140

141
   /**
142
   * Get applicationInfo
143
   * @return applicationInfo
144
  **/
145
  @ApiModelProperty(value = "")
146
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
147
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
148

149
  public ApplicationInfo getApplicationInfo() {
150
    return applicationInfo;
1✔
151
  }
152

153

154
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
155
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
156
  public void setApplicationInfo(ApplicationInfo applicationInfo) {
157
    this.applicationInfo = applicationInfo;
×
158
  }
×
159

160

161
  public PaymentAmountUpdateRequest industryUsage(IndustryUsageEnum industryUsage) {
162
    this.industryUsage = industryUsage;
×
163
    return this;
×
164
  }
165

166
   /**
167
   * The reason for the amount update. Possible values:  * **delayedCharge**  * **noShow**  * **installment**
168
   * @return industryUsage
169
  **/
170
  @ApiModelProperty(value = "The reason for the amount update. Possible values:  * **delayedCharge**  * **noShow**  * **installment**")
171
  @JsonProperty(JSON_PROPERTY_INDUSTRY_USAGE)
172
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
173

174
  public IndustryUsageEnum getIndustryUsage() {
175
    return industryUsage;
1✔
176
  }
177

178

179
  @JsonProperty(JSON_PROPERTY_INDUSTRY_USAGE)
180
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
181
  public void setIndustryUsage(IndustryUsageEnum industryUsage) {
182
    this.industryUsage = industryUsage;
1✔
183
  }
1✔
184

185

186
  public PaymentAmountUpdateRequest lineItems(List<LineItem> lineItems) {
187
    this.lineItems = lineItems;
×
188
    return this;
×
189
  }
190

191
  public PaymentAmountUpdateRequest addLineItemsItem(LineItem lineItemsItem) {
192
    if (this.lineItems == null) {
×
193
      this.lineItems = new ArrayList<>();
×
194
    }
195
    this.lineItems.add(lineItemsItem);
×
196
    return this;
×
197
  }
198

199
   /**
200
   * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). &gt; This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.
201
   * @return lineItems
202
  **/
203
  @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.")
204
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
205
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
206

207
  public List<LineItem> getLineItems() {
208
    return lineItems;
1✔
209
  }
210

211

212
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
213
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
214
  public void setLineItems(List<LineItem> lineItems) {
215
    this.lineItems = lineItems;
×
216
  }
×
217

218

219
  public PaymentAmountUpdateRequest merchantAccount(String merchantAccount) {
220
    this.merchantAccount = merchantAccount;
×
221
    return this;
×
222
  }
223

224
   /**
225
   * The merchant account that is used to process the payment.
226
   * @return merchantAccount
227
  **/
228
  @ApiModelProperty(required = true, value = "The merchant account that is used to process the payment.")
229
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
230
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
231

232
  public String getMerchantAccount() {
233
    return merchantAccount;
1✔
234
  }
235

236

237
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
238
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
239
  public void setMerchantAccount(String merchantAccount) {
240
    this.merchantAccount = merchantAccount;
×
241
  }
×
242

243

244
  public PaymentAmountUpdateRequest reference(String reference) {
245
    this.reference = reference;
×
246
    return this;
×
247
  }
248

249
   /**
250
   * Your reference for the amount update request. Maximum length: 80 characters.
251
   * @return reference
252
  **/
253
  @ApiModelProperty(value = "Your reference for the amount update request. Maximum length: 80 characters.")
254
  @JsonProperty(JSON_PROPERTY_REFERENCE)
255
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
256

257
  public String getReference() {
258
    return reference;
1✔
259
  }
260

261

262
  @JsonProperty(JSON_PROPERTY_REFERENCE)
263
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
264
  public void setReference(String reference) {
265
    this.reference = reference;
×
266
  }
×
267

268

269
  public PaymentAmountUpdateRequest splits(List<Split> splits) {
270
    this.splits = splits;
×
271
    return this;
×
272
  }
273

274
  public PaymentAmountUpdateRequest addSplitsItem(Split splitsItem) {
275
    if (this.splits == null) {
×
276
      this.splits = new ArrayList<>();
×
277
    }
278
    this.splits.add(splitsItem);
×
279
    return this;
×
280
  }
281

282
   /**
283
   * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).
284
   * @return splits
285
  **/
286
  @ApiModelProperty(value = "An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).")
287
  @JsonProperty(JSON_PROPERTY_SPLITS)
288
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
289

290
  public List<Split> getSplits() {
291
    return splits;
1✔
292
  }
293

294

295
  @JsonProperty(JSON_PROPERTY_SPLITS)
296
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
297
  public void setSplits(List<Split> splits) {
298
    this.splits = splits;
×
299
  }
×
300

301

302
  /**
303
   * Return true if this PaymentAmountUpdateRequest object is equal to o.
304
   */
305
  @Override
306
  public boolean equals(Object o) {
307
    if (this == o) {
×
308
      return true;
×
309
    }
310
    if (o == null || getClass() != o.getClass()) {
×
311
      return false;
×
312
    }
313
    PaymentAmountUpdateRequest paymentAmountUpdateRequest = (PaymentAmountUpdateRequest) o;
×
314
    return Objects.equals(this.amount, paymentAmountUpdateRequest.amount) &&
×
315
        Objects.equals(this.applicationInfo, paymentAmountUpdateRequest.applicationInfo) &&
×
316
        Objects.equals(this.industryUsage, paymentAmountUpdateRequest.industryUsage) &&
×
317
        Objects.equals(this.lineItems, paymentAmountUpdateRequest.lineItems) &&
×
318
        Objects.equals(this.merchantAccount, paymentAmountUpdateRequest.merchantAccount) &&
×
319
        Objects.equals(this.reference, paymentAmountUpdateRequest.reference) &&
×
320
        Objects.equals(this.splits, paymentAmountUpdateRequest.splits);
×
321
  }
322

323
  @Override
324
  public int hashCode() {
325
    return Objects.hash(amount, applicationInfo, industryUsage, lineItems, merchantAccount, reference, splits);
×
326
  }
327

328
  @Override
329
  public String toString() {
330
    StringBuilder sb = new StringBuilder();
×
331
    sb.append("class PaymentAmountUpdateRequest {\n");
×
332
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
333
    sb.append("    applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
×
334
    sb.append("    industryUsage: ").append(toIndentedString(industryUsage)).append("\n");
×
335
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
×
336
    sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
×
337
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
338
    sb.append("    splits: ").append(toIndentedString(splits)).append("\n");
×
339
    sb.append("}");
×
340
    return sb.toString();
×
341
  }
342

343
  /**
344
   * Convert the given object to string with each line indented by 4 spaces
345
   * (except the first line).
346
   */
347
  private String toIndentedString(Object o) {
348
    if (o == null) {
×
349
      return "null";
×
350
    }
351
    return o.toString().replace("\n", "\n    ");
×
352
  }
353

354
/**
355
   * Create an instance of PaymentAmountUpdateRequest given an JSON string
356
   *
357
   * @param jsonString JSON string
358
   * @return An instance of PaymentAmountUpdateRequest
359
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentAmountUpdateRequest
360
   */
361
  public static PaymentAmountUpdateRequest fromJson(String jsonString) throws JsonProcessingException {
362
    return JSON.getMapper().readValue(jsonString, PaymentAmountUpdateRequest.class);
×
363
  }
364
/**
365
  * Convert an instance of PaymentAmountUpdateRequest to an JSON string
366
  *
367
  * @return JSON string
368
  */
369
  public String toJson() throws JsonProcessingException {
370
    return JSON.getMapper().writeValueAsString(this);
1✔
371
  }
372
}
373

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