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

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

16 Oct 2023 09:08AM UTC coverage: 12.744%. First build
#2700

push

web-flow
Merge 5a09e72da into b9e6d393c

744 of 744 new or added lines in 20 files covered. (100.0%)

11251 of 88288 relevant lines covered (12.74%)

0.13 hits per line

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

27.91
/src/main/java/com/adyen/model/disputes/DefenseReason.java
1
/*
2
 * Disputes API
3
 * You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes.  ## Authentication Each request to the Disputes API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example:  ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).  ## Versioning Disputes API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number.  For example: ``` https://ca-test.adyen.com/ca/services/DisputeService/v30/defendDispute ```
4
 *
5
 * The version of the OpenAPI document: 30
6
 * 
7
 *
8
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
 * https://openapi-generator.tech
10
 * Do not edit the class manually.
11
 */
12

13

14
package com.adyen.model.disputes;
15

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

33

34
/**
35
 * DefenseReason
36
 */
37
@JsonPropertyOrder({
38
  DefenseReason.JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES,
39
  DefenseReason.JSON_PROPERTY_DEFENSE_REASON_CODE,
40
  DefenseReason.JSON_PROPERTY_SATISFIED
41
})
42

43
public class DefenseReason {
44
  public static final String JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES = "defenseDocumentTypes";
45
  private List<DefenseDocumentType> defenseDocumentTypes = null;
1✔
46

47
  public static final String JSON_PROPERTY_DEFENSE_REASON_CODE = "defenseReasonCode";
48
  private String defenseReasonCode;
49

50
  public static final String JSON_PROPERTY_SATISFIED = "satisfied";
51
  private Boolean satisfied;
52

53
  public DefenseReason() { 
1✔
54
  }
1✔
55

56
  public DefenseReason defenseDocumentTypes(List<DefenseDocumentType> defenseDocumentTypes) {
57
    this.defenseDocumentTypes = defenseDocumentTypes;
×
58
    return this;
×
59
  }
60

61
  public DefenseReason addDefenseDocumentTypesItem(DefenseDocumentType defenseDocumentTypesItem) {
62
    if (this.defenseDocumentTypes == null) {
×
63
      this.defenseDocumentTypes = new ArrayList<>();
×
64
    }
65
    this.defenseDocumentTypes.add(defenseDocumentTypesItem);
×
66
    return this;
×
67
  }
68

69
   /**
70
   * Array of defense document types for a specific defense reason. Indicates the document types that you can submit to the schemes to defend this dispute, and whether they are required.
71
   * @return defenseDocumentTypes
72
  **/
73
  @ApiModelProperty(value = "Array of defense document types for a specific defense reason. Indicates the document types that you can submit to the schemes to defend this dispute, and whether they are required.")
74
  @JsonProperty(JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES)
75
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
76

77
  public List<DefenseDocumentType> getDefenseDocumentTypes() {
78
    return defenseDocumentTypes;
1✔
79
  }
80

81

82
  @JsonProperty(JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES)
83
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
84
  public void setDefenseDocumentTypes(List<DefenseDocumentType> defenseDocumentTypes) {
85
    this.defenseDocumentTypes = defenseDocumentTypes;
1✔
86
  }
1✔
87

88

89
  public DefenseReason defenseReasonCode(String defenseReasonCode) {
90
    this.defenseReasonCode = defenseReasonCode;
×
91
    return this;
×
92
  }
93

94
   /**
95
   * The defense reason code that was selected to defend this dispute.
96
   * @return defenseReasonCode
97
  **/
98
  @ApiModelProperty(required = true, value = "The defense reason code that was selected to defend this dispute.")
99
  @JsonProperty(JSON_PROPERTY_DEFENSE_REASON_CODE)
100
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
101

102
  public String getDefenseReasonCode() {
103
    return defenseReasonCode;
1✔
104
  }
105

106

107
  @JsonProperty(JSON_PROPERTY_DEFENSE_REASON_CODE)
108
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
109
  public void setDefenseReasonCode(String defenseReasonCode) {
110
    this.defenseReasonCode = defenseReasonCode;
1✔
111
  }
1✔
112

113

114
  public DefenseReason satisfied(Boolean satisfied) {
115
    this.satisfied = satisfied;
×
116
    return this;
×
117
  }
118

119
   /**
120
   * Indicates if sufficient defense material has been supplied.
121
   * @return satisfied
122
  **/
123
  @ApiModelProperty(required = true, value = "Indicates if sufficient defense material has been supplied.")
124
  @JsonProperty(JSON_PROPERTY_SATISFIED)
125
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
126

127
  public Boolean getSatisfied() {
128
    return satisfied;
1✔
129
  }
130

131

132
  @JsonProperty(JSON_PROPERTY_SATISFIED)
133
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
134
  public void setSatisfied(Boolean satisfied) {
135
    this.satisfied = satisfied;
1✔
136
  }
1✔
137

138

139
  /**
140
   * Return true if this DefenseReason object is equal to o.
141
   */
142
  @Override
143
  public boolean equals(Object o) {
144
    if (this == o) {
×
145
      return true;
×
146
    }
147
    if (o == null || getClass() != o.getClass()) {
×
148
      return false;
×
149
    }
150
    DefenseReason defenseReason = (DefenseReason) o;
×
151
    return Objects.equals(this.defenseDocumentTypes, defenseReason.defenseDocumentTypes) &&
×
152
        Objects.equals(this.defenseReasonCode, defenseReason.defenseReasonCode) &&
×
153
        Objects.equals(this.satisfied, defenseReason.satisfied);
×
154
  }
155

156
  @Override
157
  public int hashCode() {
158
    return Objects.hash(defenseDocumentTypes, defenseReasonCode, satisfied);
×
159
  }
160

161
  @Override
162
  public String toString() {
163
    StringBuilder sb = new StringBuilder();
×
164
    sb.append("class DefenseReason {\n");
×
165
    sb.append("    defenseDocumentTypes: ").append(toIndentedString(defenseDocumentTypes)).append("\n");
×
166
    sb.append("    defenseReasonCode: ").append(toIndentedString(defenseReasonCode)).append("\n");
×
167
    sb.append("    satisfied: ").append(toIndentedString(satisfied)).append("\n");
×
168
    sb.append("}");
×
169
    return sb.toString();
×
170
  }
171

172
  /**
173
   * Convert the given object to string with each line indented by 4 spaces
174
   * (except the first line).
175
   */
176
  private String toIndentedString(Object o) {
177
    if (o == null) {
×
178
      return "null";
×
179
    }
180
    return o.toString().replace("\n", "\n    ");
×
181
  }
182

183
/**
184
   * Create an instance of DefenseReason given an JSON string
185
   *
186
   * @param jsonString JSON string
187
   * @return An instance of DefenseReason
188
   * @throws JsonProcessingException if the JSON string is invalid with respect to DefenseReason
189
   */
190
  public static DefenseReason fromJson(String jsonString) throws JsonProcessingException {
191
    return JSON.getMapper().readValue(jsonString, DefenseReason.class);
×
192
  }
193
/**
194
  * Convert an instance of DefenseReason to an JSON string
195
  *
196
  * @return JSON string
197
  */
198
  public String toJson() throws JsonProcessingException {
199
    return JSON.getMapper().writeValueAsString(this);
×
200
  }
201
}
202

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