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

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

22 Sep 2023 11:24AM UTC coverage: 12.611%. First build
#2661

push

web-flow
Merge 251f6ff51 into 9e36e9c01

9262 of 9262 new or added lines in 142 files covered. (100.0%)

11033 of 87486 relevant lines covered (12.61%)

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/marketpayhop/AbstractOpenApiSchema.java
1
/*
2
 * Hosted onboarding API
3
 * This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead.  The Hosted onboarding API provides endpoints that you can use to generate links to Adyen-hosted pages, such as an [onboarding page](https://docs.adyen.com/marketplaces-and-platforms/classic/hosted-onboarding-page) or a [PCI compliance questionnaire](https://docs.adyen.com/marketplaces-and-platforms/classic/platforms-for-partners). You can provide these links to your account holders so that they can complete their onboarding.  ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example:   ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ```  Alternatively, you can use the username and password to connect to the API using basic authentication. For example:  ``` curl -U \"ws@MarketPlace.YOUR_PLATFORM_ACCOUNT\":\"YOUR_WS_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` 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 The Hosted onboarding 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://cal-test.adyen.com/cal/services/Hop/v6/getOnboardingUrl ```
4
 *
5
 * The version of the OpenAPI document: 6
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.marketpayhop;
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

© 2025 Coveralls, Inc