• 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/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
    *  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
    *  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
    * Add a payout setting
58
    *
59
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
60
    * @param payoutSettingsRequest {@link PayoutSettingsRequest }  (required)
61
    * @return {@link PayoutSettings }
62
    * @throws ApiException if fails to make API call
63
    */
64
    public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest) throws ApiException, IOException {
NEW
65
        return addPayoutSetting(merchantId, payoutSettingsRequest, null);
×
66
    }
67

68
    /**
69
    * Add a payout setting
70
    *
71
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
72
    * @param payoutSettingsRequest {@link PayoutSettingsRequest }  (required)
73
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
74
    * @return {@link PayoutSettings }
75
    * @throws ApiException if fails to make API call
76
    */
77
    public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest, 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

NEW
85
        String requestBody = payoutSettingsRequest.toJson();
×
NEW
86
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null);
×
NEW
87
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
NEW
88
        return PayoutSettings.fromJson(jsonResult);
×
89
    }
90

91
    /**
92
    * Delete a payout setting
93
    *
94
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
95
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
96
    * @throws ApiException if fails to make API call
97
    */
98
    public void deletePayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException {
NEW
99
        deletePayoutSetting(merchantId, payoutSettingsId, null);
×
100
    }
×
101

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

122
        String requestBody = null;
×
NEW
123
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null);
×
NEW
124
        resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams);
×
125
    }
×
126

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

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

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

166
    /**
167
    * Get a list of payout settings
168
    *
169
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
170
    * @return {@link PayoutSettingsResponse }
171
    * @throws ApiException if fails to make API call
172
    */
173
    public PayoutSettingsResponse listPayoutSettings(String merchantId) throws ApiException, IOException {
NEW
174
        return listPayoutSettings(merchantId, null);
×
175
    }
176

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

NEW
193
        String requestBody = null;
×
NEW
194
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null);
×
NEW
195
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
NEW
196
        return PayoutSettingsResponse.fromJson(jsonResult);
×
197
    }
198

199
    /**
200
    * Update a payout setting
201
    *
202
    * @param merchantId {@link String } The unique identifier of the merchant account. (required)
203
    * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required)
204
    * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest }  (required)
205
    * @return {@link PayoutSettings }
206
    * @throws ApiException if fails to make API call
207
    */
208
    public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest) throws ApiException, IOException {
NEW
209
        return updatePayoutSetting(merchantId, payoutSettingsId, updatePayoutSettingsRequest, null);
×
210
    }
211

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

NEW
234
        String requestBody = updatePayoutSettingsRequest.toJson();
×
NEW
235
        Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null);
×
NEW
236
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, 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