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

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

11 Oct 2023 10:00AM UTC coverage: 12.744%. First build
#2685

push

web-flow
Merge d19ee818b into 65ca8b246

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

0.0
/src/main/java/com/adyen/model/disputes/AbstractOpenApiSchema.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.lang.reflect.Type;
18
import java.util.Map;
19
import jakarta.ws.rs.core.GenericType;
20

21
import com.fasterxml.jackson.annotation.JsonValue;
22

23
/**
24
 * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
25
 */
26

27
public abstract class AbstractOpenApiSchema {
28

29
    // store the actual instance of the schema/object
30
    private Object instance;
31

32
    // is nullable
33
    private Boolean isNullable;
34

35
    // schema type (e.g. oneOf, anyOf)
36
    private final String schemaType;
37

38
    public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
×
39
        this.schemaType = schemaType;
×
40
        this.isNullable = isNullable;
×
41
    }
×
42

43
    /**
44
     * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
45
     *
46
     * @return an instance of the actual schema/object
47
     */
48
    public abstract Map<String, GenericType> getSchemas();
49

50
    /**
51
     * Get the actual instance
52
     *
53
     * @return an instance of the actual schema/object
54
     */
55
    @JsonValue
56
    public Object getActualInstance() {return instance;}
×
57

58
    /**
59
     * Set the actual instance
60
     *
61
     * @param instance the actual instance of the schema/object
62
     */
63
    public void setActualInstance(Object instance) {this.instance = instance;}
×
64

65
    /**
66
     * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
67
     *
68
     * @return an instance of the actual schema/object
69
     */
70
    public Object getActualInstanceRecursively() {
71
        return getActualInstanceRecursively(this);
×
72
    }
73

74
    private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
75
        if (object.getActualInstance() == null) {
×
76
            return null;
×
77
        } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
×
78
            return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
×
79
        } else {
80
            return object.getActualInstance();
×
81
        }
82
    }
83

84
    /**
85
     * Get the schema type (e.g. anyOf, oneOf)
86
     *
87
     * @return the schema type
88
     */
89
    public String getSchemaType() {
90
        return schemaType;
×
91
    }
92

93
    @Override
94
    public String toString() {
95
        StringBuilder sb = new StringBuilder();
×
96
        sb.append("class ").append(getClass()).append(" {\n");
×
97
        sb.append("    instance: ").append(toIndentedString(instance)).append("\n");
×
98
        sb.append("    isNullable: ").append(toIndentedString(isNullable)).append("\n");
×
99
        sb.append("    schemaType: ").append(toIndentedString(schemaType)).append("\n");
×
100
        sb.append("}");
×
101
        return sb.toString();
×
102
    }
103

104
    /**
105
     * Convert the given object to string with each line indented by 4 spaces
106
     * (except the first line).
107
     */
108
    private String toIndentedString(Object o) {
109
        if (o == null) {
×
110
            return "null";
×
111
        }
112
        return o.toString().replace("\n", "\n    ");
×
113
    }
114

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
        AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
×
123
        return Objects.equals(this.instance, a.instance) &&
×
124
            Objects.equals(this.isNullable, a.isNullable) &&
×
125
            Objects.equals(this.schemaType, a.schemaType);
×
126
    }
127

128
    @Override
129
    public int hashCode() {
130
        return Objects.hash(instance, isNullable, schemaType);
×
131
    }
132

133
    /**
134
     * Is nullable
135
     *
136
     * @return true if it's nullable
137
     */
138
    public Boolean isNullable() {
139
        if (Boolean.TRUE.equals(isNullable)) {
×
140
            return Boolean.TRUE;
×
141
        } else {
142
            return Boolean.FALSE;
×
143
        }
144
    }
145

146

147

148
}
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