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

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

16 Oct 2023 09:23AM UTC coverage: 12.568%. First build
#2707

push

web-flow
Merge d6cc1d707 into b9e6d393c

6758 of 6758 new or added lines in 106 files covered. (100.0%)

11852 of 94302 relevant lines covered (12.57%)

0.13 hits per line

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

27.78
/src/main/java/com/adyen/model/disputes/DefenseReasonsResponse.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.DefenseReason;
21
import com.adyen.model.disputes.DisputeServiceResult;
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.util.ArrayList;
30
import java.util.List;
31
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
32
import com.fasterxml.jackson.core.JsonProcessingException;
33

34

35
/**
36
 * DefenseReasonsResponse
37
 */
38
@JsonPropertyOrder({
39
  DefenseReasonsResponse.JSON_PROPERTY_DEFENSE_REASONS,
40
  DefenseReasonsResponse.JSON_PROPERTY_DISPUTE_SERVICE_RESULT
41
})
42

43
public class DefenseReasonsResponse {
44
  public static final String JSON_PROPERTY_DEFENSE_REASONS = "defenseReasons";
45
  private List<DefenseReason> defenseReasons = null;
1✔
46

47
  public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult";
48
  private DisputeServiceResult disputeServiceResult;
49

50
  public DefenseReasonsResponse() { 
1✔
51
  }
1✔
52

53
  public DefenseReasonsResponse defenseReasons(List<DefenseReason> defenseReasons) {
54
    this.defenseReasons = defenseReasons;
×
55
    return this;
×
56
  }
57

58
  public DefenseReasonsResponse addDefenseReasonsItem(DefenseReason defenseReasonsItem) {
59
    if (this.defenseReasons == null) {
×
60
      this.defenseReasons = new ArrayList<>();
×
61
    }
62
    this.defenseReasons.add(defenseReasonsItem);
×
63
    return this;
×
64
  }
65

66
   /**
67
   * The defense reasons that can be used to defend the dispute.
68
   * @return defenseReasons
69
  **/
70
  @ApiModelProperty(value = "The defense reasons that can be used to defend the dispute.")
71
  @JsonProperty(JSON_PROPERTY_DEFENSE_REASONS)
72
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
73

74
  public List<DefenseReason> getDefenseReasons() {
75
    return defenseReasons;
1✔
76
  }
77

78

79
  @JsonProperty(JSON_PROPERTY_DEFENSE_REASONS)
80
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
81
  public void setDefenseReasons(List<DefenseReason> defenseReasons) {
82
    this.defenseReasons = defenseReasons;
1✔
83
  }
1✔
84

85

86
  public DefenseReasonsResponse disputeServiceResult(DisputeServiceResult disputeServiceResult) {
87
    this.disputeServiceResult = disputeServiceResult;
×
88
    return this;
×
89
  }
90

91
   /**
92
   * Get disputeServiceResult
93
   * @return disputeServiceResult
94
  **/
95
  @ApiModelProperty(required = true, value = "")
96
  @JsonProperty(JSON_PROPERTY_DISPUTE_SERVICE_RESULT)
97
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
98

99
  public DisputeServiceResult getDisputeServiceResult() {
100
    return disputeServiceResult;
1✔
101
  }
102

103

104
  @JsonProperty(JSON_PROPERTY_DISPUTE_SERVICE_RESULT)
105
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
106
  public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) {
107
    this.disputeServiceResult = disputeServiceResult;
1✔
108
  }
1✔
109

110

111
  /**
112
   * Return true if this DefenseReasonsResponse object is equal to o.
113
   */
114
  @Override
115
  public boolean equals(Object o) {
116
    if (this == o) {
×
117
      return true;
×
118
    }
119
    if (o == null || getClass() != o.getClass()) {
×
120
      return false;
×
121
    }
122
    DefenseReasonsResponse defenseReasonsResponse = (DefenseReasonsResponse) o;
×
123
    return Objects.equals(this.defenseReasons, defenseReasonsResponse.defenseReasons) &&
×
124
        Objects.equals(this.disputeServiceResult, defenseReasonsResponse.disputeServiceResult);
×
125
  }
126

127
  @Override
128
  public int hashCode() {
129
    return Objects.hash(defenseReasons, disputeServiceResult);
×
130
  }
131

132
  @Override
133
  public String toString() {
134
    StringBuilder sb = new StringBuilder();
×
135
    sb.append("class DefenseReasonsResponse {\n");
×
136
    sb.append("    defenseReasons: ").append(toIndentedString(defenseReasons)).append("\n");
×
137
    sb.append("    disputeServiceResult: ").append(toIndentedString(disputeServiceResult)).append("\n");
×
138
    sb.append("}");
×
139
    return sb.toString();
×
140
  }
141

142
  /**
143
   * Convert the given object to string with each line indented by 4 spaces
144
   * (except the first line).
145
   */
146
  private String toIndentedString(Object o) {
147
    if (o == null) {
×
148
      return "null";
×
149
    }
150
    return o.toString().replace("\n", "\n    ");
×
151
  }
152

153
/**
154
   * Create an instance of DefenseReasonsResponse given an JSON string
155
   *
156
   * @param jsonString JSON string
157
   * @return An instance of DefenseReasonsResponse
158
   * @throws JsonProcessingException if the JSON string is invalid with respect to DefenseReasonsResponse
159
   */
160
  public static DefenseReasonsResponse fromJson(String jsonString) throws JsonProcessingException {
161
    return JSON.getMapper().readValue(jsonString, DefenseReasonsResponse.class);
1✔
162
  }
163
/**
164
  * Convert an instance of DefenseReasonsResponse to an JSON string
165
  *
166
  * @return JSON string
167
  */
168
  public String toJson() throws JsonProcessingException {
169
    return JSON.getMapper().writeValueAsString(this);
×
170
  }
171
}
172

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