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

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

11 Dec 2023 05:06PM CUT coverage: 12.835%. First build
#2934

push

web-flow
Merge 0111dd892 into d70611050

173 of 797 new or added lines in 39 files covered. (21.71%)

12464 of 97111 relevant lines covered (12.83%)

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/service/management/AllowedOriginsMerchantLevelApi.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.RestServiceError;
20
import com.adyen.model.RequestOptions;
21
import com.adyen.service.exception.ApiException;
22
import com.adyen.service.resource.Resource;
23

24
import java.io.IOException;
25
import java.util.HashMap;
26
import java.util.Map;
27

28
public class AllowedOriginsMerchantLevelApi extends Service {
29

30
    public static final String API_VERSION = "3";
31

32
    protected String baseURL;
33

34
    /**
35
    *  constructor in {@link com.adyen.service.management package}.
36
    * @param client {@link Client } (required)
37
    */
38
    public AllowedOriginsMerchantLevelApi(Client client) {
39
        super(client);
×
40
        this.baseURL = createBaseURL("https://management-test.adyen.com/v3");
×
41
    }
×
42

43
    /**
44
    *  constructor in {@link com.adyen.service.management package}.
45
    * 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.
46
    * @param client {@link Client } (required)
47
    * @param baseURL {@link String } (required)
48
    */
49
    public AllowedOriginsMerchantLevelApi(Client client, String baseURL) {
50
        super(client);
×
51
        this.baseURL = baseURL;
×
52
    }
×
53

54
    /**
55
    * Create an allowed origin
56
    *
57
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
58
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
59
    * @param allowedOrigin {@link AllowedOrigin }  (required)
60
    * @return {@link AllowedOriginsResponse }
61
    * @throws ApiException if fails to make API call
62
    */
63
    public AllowedOriginsResponse createAllowedOrigin(String merchantId, String apiCredentialId, AllowedOrigin allowedOrigin) throws ApiException, IOException {
NEW
64
        return createAllowedOrigin(merchantId, apiCredentialId, allowedOrigin, null);
×
65
    }
66

67
    /**
68
    * Create an allowed origin
69
    *
70
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
71
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
72
    * @param allowedOrigin {@link AllowedOrigin }  (required)
73
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
74
    * @return {@link AllowedOriginsResponse }
75
    * @throws ApiException if fails to make API call
76
    */
77
    public AllowedOriginsResponse createAllowedOrigin(String merchantId, String apiCredentialId, AllowedOrigin allowedOrigin, RequestOptions requestOptions) throws ApiException, IOException {
78
        //Add path params
79
        Map<String, String> pathParams = new HashMap<>();
×
80
        if (merchantId == null) {
×
81
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
82
        }
83
        pathParams.put("merchantId", merchantId);
×
84
        if (apiCredentialId == null) {
×
85
            throw new IllegalArgumentException("Please provide the apiCredentialId path parameter");
×
86
        }
87
        pathParams.put("apiCredentialId", apiCredentialId);
×
88

NEW
89
        String requestBody = allowedOrigin.toJson();
×
NEW
90
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins", null);
×
NEW
91
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
NEW
92
        return AllowedOriginsResponse.fromJson(jsonResult);
×
93
    }
94

95
    /**
96
    * Delete an allowed origin
97
    *
98
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
99
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
100
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
101
    * @throws ApiException if fails to make API call
102
    */
103
    public void deleteAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException {
NEW
104
        deleteAllowedOrigin(merchantId, apiCredentialId, originId, null);
×
105
    }
×
106

107
    /**
108
    * Delete an allowed origin
109
    *
110
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
111
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
112
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
113
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
114
    * @throws ApiException if fails to make API call
115
    */
116
    public void deleteAllowedOrigin(String merchantId, String apiCredentialId, String originId, RequestOptions requestOptions) throws ApiException, IOException {
117
        //Add path params
118
        Map<String, String> pathParams = new HashMap<>();
×
119
        if (merchantId == null) {
×
120
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
121
        }
122
        pathParams.put("merchantId", merchantId);
×
123
        if (apiCredentialId == null) {
×
124
            throw new IllegalArgumentException("Please provide the apiCredentialId path parameter");
×
125
        }
126
        pathParams.put("apiCredentialId", apiCredentialId);
×
NEW
127
        if (originId == null) {
×
NEW
128
            throw new IllegalArgumentException("Please provide the originId path parameter");
×
129
        }
NEW
130
        pathParams.put("originId", originId);
×
131

132
        String requestBody = null;
×
NEW
133
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null);
×
NEW
134
        resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams);
×
135
    }
×
136

137
    /**
138
    * Get an allowed origin
139
    *
140
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
141
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
142
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
143
    * @return {@link AllowedOrigin }
144
    * @throws ApiException if fails to make API call
145
    */
146
    public AllowedOrigin getAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException {
147
        return getAllowedOrigin(merchantId, apiCredentialId, originId, null);
×
148
    }
149

150
    /**
151
    * Get an allowed origin
152
    *
153
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
154
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
155
    * @param originId {@link String } Unique identifier of the allowed origin. (required)
156
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
157
    * @return {@link AllowedOrigin }
158
    * @throws ApiException if fails to make API call
159
    */
160
    public AllowedOrigin getAllowedOrigin(String merchantId, String apiCredentialId, String originId, RequestOptions requestOptions) throws ApiException, IOException {
161
        //Add path params
162
        Map<String, String> pathParams = new HashMap<>();
×
163
        if (merchantId == null) {
×
164
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
165
        }
166
        pathParams.put("merchantId", merchantId);
×
167
        if (apiCredentialId == null) {
×
168
            throw new IllegalArgumentException("Please provide the apiCredentialId path parameter");
×
169
        }
170
        pathParams.put("apiCredentialId", apiCredentialId);
×
171
        if (originId == null) {
×
172
            throw new IllegalArgumentException("Please provide the originId path parameter");
×
173
        }
174
        pathParams.put("originId", originId);
×
175

176
        String requestBody = null;
×
177
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null);
×
178
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
179
        return AllowedOrigin.fromJson(jsonResult);
×
180
    }
181

182
    /**
183
    * Get a list of allowed origins
184
    *
185
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
186
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
187
    * @return {@link AllowedOriginsResponse }
188
    * @throws ApiException if fails to make API call
189
    */
190
    public AllowedOriginsResponse listAllowedOrigins(String merchantId, String apiCredentialId) throws ApiException, IOException {
NEW
191
        return listAllowedOrigins(merchantId, apiCredentialId, null);
×
192
    }
193

194
    /**
195
    * Get a list of allowed origins
196
    *
197
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
198
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
199
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
200
    * @return {@link AllowedOriginsResponse }
201
    * @throws ApiException if fails to make API call
202
    */
203
    public AllowedOriginsResponse listAllowedOrigins(String merchantId, String apiCredentialId, RequestOptions requestOptions) throws ApiException, IOException {
204
        //Add path params
205
        Map<String, String> pathParams = new HashMap<>();
×
206
        if (merchantId == null) {
×
207
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
208
        }
209
        pathParams.put("merchantId", merchantId);
×
210
        if (apiCredentialId == null) {
×
211
            throw new IllegalArgumentException("Please provide the apiCredentialId path parameter");
×
212
        }
213
        pathParams.put("apiCredentialId", apiCredentialId);
×
214

NEW
215
        String requestBody = null;
×
216
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins", null);
×
NEW
217
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
218
        return AllowedOriginsResponse.fromJson(jsonResult);
×
219
    }
220
}
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