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

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

08 Nov 2023 09:16AM CUT coverage: 12.837%. First build
#2829

push

web-flow
Merge 828273160 into b96088175

114 of 864 new or added lines in 50 files covered. (13.19%)

12393 of 96543 relevant lines covered (12.84%)

0.13 hits per line

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

26.67
/src/main/java/com/adyen/service/management/MyApiCredentialApi.java
1
/*
2
 * Management API
3
 *
4
 * The version of the OpenAPI document: 3
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
package com.adyen.service.management;
13

14
import com.adyen.Client;
15
import com.adyen.Service;
16
import com.adyen.constants.ApiConstants;
17
import com.adyen.model.management.AllowedOrigin;
18
import com.adyen.model.management.AllowedOriginsResponse;
19
import com.adyen.model.management.CreateAllowedOriginRequest;
20
import com.adyen.model.management.GenerateClientKeyResponse;
21
import com.adyen.model.management.MeApiCredential;
22
import com.adyen.model.management.RestServiceError;
23
import com.adyen.model.RequestOptions;
24
import com.adyen.service.exception.ApiException;
25
import com.adyen.service.resource.Resource;
26

27
import java.io.IOException;
28
import java.util.HashMap;
29
import java.util.Map;
30

31
public class MyApiCredentialApi extends Service {
32

33
    public static final String API_VERSION = "3";
34

35
    protected String baseURL;
36

37
    /**
38
    * My API credential constructor in {@link com.adyen.service.management package}.
39
    * @param client {@link Client } (required)
40
    */
41
    public MyApiCredentialApi(Client client) {
42
        super(client);
1✔
43
        this.baseURL = createBaseURL("https://management-test.adyen.com/v3");
1✔
44
    }
1✔
45

46
    /**
47
    * My API credential constructor in {@link com.adyen.service.management package}.
48
    * Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
49
    * @param client {@link Client } (required)
50
    * @param baseURL {@link String } (required)
51
    */
52
    public MyApiCredentialApi(Client client, String baseURL) {
53
        super(client);
×
54
        this.baseURL = baseURL;
×
55
    }
×
56

57
    /**
58
    * Remove allowed origin
59
    *
60
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
61
    * @throws ApiException if fails to make API call
62
    */
63
    public void removeAllowedOrigin(String originId) throws ApiException, IOException {
64
        removeAllowedOrigin(originId, null);
1✔
65
    }
1✔
66

67
    /**
68
    * Remove allowed origin
69
    *
70
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
71
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
72
    * @throws ApiException if fails to make API call
73
    */
74
    public void removeAllowedOrigin(String originId, RequestOptions requestOptions) throws ApiException, IOException {
75
        //Add path params
76
        Map<String, String> pathParams = new HashMap<>();
1✔
77
        if (originId == null) {
1✔
78
            throw new IllegalArgumentException("Please provide the originId path parameter");
×
79
        }
80
        pathParams.put("originId", originId);
1✔
81

82
        String requestBody = null;
1✔
83
        Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins/{originId}", null);
1✔
84
        resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams);
1✔
85
    }
1✔
86

87
    /**
88
    * Get API credential details
89
    *
90
    * @return {@link MeApiCredential }
91
    * @throws ApiException if fails to make API call
92
    */
93
    public MeApiCredential getApiCredentialDetails() throws ApiException, IOException {
94
        return getApiCredentialDetails(null);
×
95
    }
96

97
    /**
98
    * Get API credential details
99
    *
100
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
101
    * @return {@link MeApiCredential }
102
    * @throws ApiException if fails to make API call
103
    */
104
    public MeApiCredential getApiCredentialDetails(RequestOptions requestOptions) throws ApiException, IOException {
105

106
        String requestBody = null;
×
107
        Resource resource = new Resource(this, this.baseURL + "/me", null);
×
108
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null);
×
109
        return MeApiCredential.fromJson(jsonResult);
×
110
    }
111

112
    /**
113
    * Get allowed origins
114
    *
115
    * @return {@link AllowedOriginsResponse }
116
    * @throws ApiException if fails to make API call
117
    */
118
    public AllowedOriginsResponse getAllowedOrigins() throws ApiException, IOException {
119
        return getAllowedOrigins(null);
×
120
    }
121

122
    /**
123
    * Get allowed origins
124
    *
125
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
126
    * @return {@link AllowedOriginsResponse }
127
    * @throws ApiException if fails to make API call
128
    */
129
    public AllowedOriginsResponse getAllowedOrigins(RequestOptions requestOptions) throws ApiException, IOException {
130

131
        String requestBody = null;
×
132
        Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins", null);
×
133
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null);
×
134
        return AllowedOriginsResponse.fromJson(jsonResult);
×
135
    }
136

137
    /**
138
    * Get allowed origin details
139
    *
140
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
141
    * @return {@link AllowedOrigin }
142
    * @throws ApiException if fails to make API call
143
    */
144
    public AllowedOrigin getAllowedOriginDetails(String originId) throws ApiException, IOException {
145
        return getAllowedOriginDetails(originId, null);
×
146
    }
147

148
    /**
149
    * Get allowed origin details
150
    *
151
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
152
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
153
    * @return {@link AllowedOrigin }
154
    * @throws ApiException if fails to make API call
155
    */
156
    public AllowedOrigin getAllowedOriginDetails(String originId, RequestOptions requestOptions) throws ApiException, IOException {
157
        //Add path params
158
        Map<String, String> pathParams = new HashMap<>();
×
159
        if (originId == null) {
×
160
            throw new IllegalArgumentException("Please provide the originId path parameter");
×
161
        }
162
        pathParams.put("originId", originId);
×
163

164
        String requestBody = null;
×
165
        Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins/{originId}", null);
×
166
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
167
        return AllowedOrigin.fromJson(jsonResult);
×
168
    }
169

170
    /**
171
    * Add allowed origin
172
    *
173
    * @param createAllowedOriginRequest {@link CreateAllowedOriginRequest }  (required)
174
    * @return {@link AllowedOrigin }
175
    * @throws ApiException if fails to make API call
176
    */
177
    public AllowedOrigin addAllowedOrigin(CreateAllowedOriginRequest createAllowedOriginRequest) throws ApiException, IOException {
178
        return addAllowedOrigin(createAllowedOriginRequest, null);
×
179
    }
180

181
    /**
182
    * Add allowed origin
183
    *
184
    * @param createAllowedOriginRequest {@link CreateAllowedOriginRequest }  (required)
185
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
186
    * @return {@link AllowedOrigin }
187
    * @throws ApiException if fails to make API call
188
    */
189
    public AllowedOrigin addAllowedOrigin(CreateAllowedOriginRequest createAllowedOriginRequest, RequestOptions requestOptions) throws ApiException, IOException {
190

191
        String requestBody = createAllowedOriginRequest.toJson();
×
192
        Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins", null);
×
193
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
194
        return AllowedOrigin.fromJson(jsonResult);
×
195
    }
196

197
    /**
198
    * Generate a client key
199
    *
200
    * @return {@link GenerateClientKeyResponse }
201
    * @throws ApiException if fails to make API call
202
    */
203
    public GenerateClientKeyResponse generateClientKey() throws ApiException, IOException {
NEW
204
        return generateClientKey(null);
×
205
    }
206

207
    /**
208
    * Generate a client key
209
    *
210
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
211
    * @return {@link GenerateClientKeyResponse }
212
    * @throws ApiException if fails to make API call
213
    */
214
    public GenerateClientKeyResponse generateClientKey(RequestOptions requestOptions) throws ApiException, IOException {
215

216
        String requestBody = null;
×
217
        Resource resource = new Resource(this, this.baseURL + "/me/generateClientKey", null);
×
218
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
219
        return GenerateClientKeyResponse.fromJson(jsonResult);
×
220
    }
221
}
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