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

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

23 Oct 2023 11:39AM UTC coverage: 12.821%. First build
#2740

push

web-flow
Merge 1e802aba6 into c99ba89a9

2930 of 2930 new or added lines in 117 files covered. (100.0%)

12345 of 96285 relevant lines covered (12.82%)

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/PayoutSettingsMerchantLevelApi.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.PayoutSettings;
18
import com.adyen.model.management.PayoutSettingsRequest;
19
import com.adyen.model.management.PayoutSettingsResponse;
20
import com.adyen.model.management.RestServiceError;
21
import com.adyen.model.management.UpdatePayoutSettingsRequest;
22
import com.adyen.model.RequestOptions;
23
import com.adyen.service.exception.ApiException;
24
import com.adyen.service.resource.Resource;
25

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

30
public class PayoutSettingsMerchantLevelApi extends Service {
31

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

34
    protected String baseURL;
35

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

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

56
    /**
57
    * Delete a payout setting
58
    *
59
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
60
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
61
    * @throws ApiException if fails to make API call
62
    */
63
    public void deletePayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException {
64
        deletePayoutSetting(merchantId, payoutSettingsId, null);
×
65
    }
×
66

67
    /**
68
    * Delete a payout setting
69
    *
70
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
71
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
72
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
73
    * @throws ApiException if fails to make API call
74
    */
75
    public void deletePayoutSetting(String merchantId, String payoutSettingsId, RequestOptions requestOptions) throws ApiException, IOException {
76
        //Add path params
77
        Map<String, String> pathParams = new HashMap<>();
×
78
        if (merchantId == null) {
×
79
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
80
        }
81
        pathParams.put("merchantId", merchantId);
×
82
        if (payoutSettingsId == null) {
×
83
            throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter");
×
84
        }
85
        pathParams.put("payoutSettingsId", payoutSettingsId);
×
86

87
        String requestBody = null;
×
88
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null);
×
89
        resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams);
×
90
    }
×
91

92
    /**
93
    * Get a list of payout settings
94
    *
95
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
96
    * @return {@link PayoutSettingsResponse }
97
    * @throws ApiException if fails to make API call
98
    */
99
    public PayoutSettingsResponse listPayoutSettings(String merchantId) throws ApiException, IOException {
100
        return listPayoutSettings(merchantId, null);
×
101
    }
102

103
    /**
104
    * Get a list of payout settings
105
    *
106
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
107
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
108
    * @return {@link PayoutSettingsResponse }
109
    * @throws ApiException if fails to make API call
110
    */
111
    public PayoutSettingsResponse listPayoutSettings(String merchantId, RequestOptions requestOptions) throws ApiException, IOException {
112
        //Add path params
113
        Map<String, String> pathParams = new HashMap<>();
×
114
        if (merchantId == null) {
×
115
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
116
        }
117
        pathParams.put("merchantId", merchantId);
×
118

119
        String requestBody = null;
×
120
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null);
×
121
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
122
        return PayoutSettingsResponse.fromJson(jsonResult);
×
123
    }
124

125
    /**
126
    * Get a payout setting
127
    *
128
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
129
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
130
    * @return {@link PayoutSettings }
131
    * @throws ApiException if fails to make API call
132
    */
133
    public PayoutSettings getPayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException {
134
        return getPayoutSetting(merchantId, payoutSettingsId, null);
×
135
    }
136

137
    /**
138
    * Get a payout setting
139
    *
140
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
141
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
142
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
143
    * @return {@link PayoutSettings }
144
    * @throws ApiException if fails to make API call
145
    */
146
    public PayoutSettings getPayoutSetting(String merchantId, String payoutSettingsId, RequestOptions requestOptions) throws ApiException, IOException {
147
        //Add path params
148
        Map<String, String> pathParams = new HashMap<>();
×
149
        if (merchantId == null) {
×
150
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
151
        }
152
        pathParams.put("merchantId", merchantId);
×
153
        if (payoutSettingsId == null) {
×
154
            throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter");
×
155
        }
156
        pathParams.put("payoutSettingsId", payoutSettingsId);
×
157

158
        String requestBody = null;
×
159
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null);
×
160
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
161
        return PayoutSettings.fromJson(jsonResult);
×
162
    }
163

164
    /**
165
    * Update a payout setting
166
    *
167
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
168
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
169
    * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest }  (required)
170
    * @return {@link PayoutSettings }
171
    * @throws ApiException if fails to make API call
172
    */
173
    public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest) throws ApiException, IOException {
174
        return updatePayoutSetting(merchantId, payoutSettingsId, updatePayoutSettingsRequest, null);
×
175
    }
176

177
    /**
178
    * Update a payout setting
179
    *
180
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
181
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
182
    * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest }  (required)
183
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
184
    * @return {@link PayoutSettings }
185
    * @throws ApiException if fails to make API call
186
    */
187
    public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest, RequestOptions requestOptions) throws ApiException, IOException {
188
        //Add path params
189
        Map<String, String> pathParams = new HashMap<>();
×
190
        if (merchantId == null) {
×
191
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
192
        }
193
        pathParams.put("merchantId", merchantId);
×
194
        if (payoutSettingsId == null) {
×
195
            throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter");
×
196
        }
197
        pathParams.put("payoutSettingsId", payoutSettingsId);
×
198

199
        String requestBody = updatePayoutSettingsRequest.toJson();
×
200
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null);
×
201
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams);
×
202
        return PayoutSettings.fromJson(jsonResult);
×
203
    }
204

205
    /**
206
    * Add a payout setting
207
    *
208
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
209
    * @param payoutSettingsRequest {@link PayoutSettingsRequest }  (required)
210
    * @return {@link PayoutSettings }
211
    * @throws ApiException if fails to make API call
212
    */
213
    public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest) throws ApiException, IOException {
214
        return addPayoutSetting(merchantId, payoutSettingsRequest, null);
×
215
    }
216

217
    /**
218
    * Add a payout setting
219
    *
220
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
221
    * @param payoutSettingsRequest {@link PayoutSettingsRequest }  (required)
222
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
223
    * @return {@link PayoutSettings }
224
    * @throws ApiException if fails to make API call
225
    */
226
    public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest, RequestOptions requestOptions) throws ApiException, IOException {
227
        //Add path params
228
        Map<String, String> pathParams = new HashMap<>();
×
229
        if (merchantId == null) {
×
230
            throw new IllegalArgumentException("Please provide the merchantId path parameter");
×
231
        }
232
        pathParams.put("merchantId", merchantId);
×
233

234
        String requestBody = payoutSettingsRequest.toJson();
×
235
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null);
×
236
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
237
        return PayoutSettings.fromJson(jsonResult);
×
238
    }
239
}
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