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

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

11 Dec 2023 05:06PM UTC 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

57.14
/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java
1
/*
2
 * Legal Entity 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.legalentitymanagement;
13

14
import com.adyen.Client;
15
import com.adyen.Service;
16
import com.adyen.constants.ApiConstants;
17
import com.adyen.model.legalentitymanagement.BusinessLines;
18
import com.adyen.model.legalentitymanagement.DataReviewConfirmationResponse;
19
import com.adyen.model.legalentitymanagement.LegalEntity;
20
import com.adyen.model.legalentitymanagement.LegalEntityInfo;
21
import com.adyen.model.legalentitymanagement.LegalEntityInfoRequiredType;
22
import com.adyen.model.legalentitymanagement.ServiceError;
23
import com.adyen.model.legalentitymanagement.VerificationErrors;
24
import com.adyen.model.RequestOptions;
25
import com.adyen.service.exception.ApiException;
26
import com.adyen.service.resource.Resource;
27

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

32
public class LegalEntitiesApi extends Service {
33

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

36
    protected String baseURL;
37

38
    /**
39
    * Legal entities constructor in {@link com.adyen.service.legalentitymanagement package}.
40
    * @param client {@link Client } (required)
41
    */
42
    public LegalEntitiesApi(Client client) {
43
        super(client);
1✔
44
        this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3");
1✔
45
    }
1✔
46

47
    /**
48
    * Legal entities constructor in {@link com.adyen.service.legalentitymanagement package}.
49
    * 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.
50
    * @param client {@link Client } (required)
51
    * @param baseURL {@link String } (required)
52
    */
53
    public LegalEntitiesApi(Client client, String baseURL) {
54
        super(client);
×
55
        this.baseURL = baseURL;
×
56
    }
×
57

58
    /**
59
    * Check a legal entity's verification errors
60
    *
61
    * @param id {@link String } The unique identifier of the legal entity. (required)
62
    * @return {@link VerificationErrors }
63
    * @throws ApiException if fails to make API call
64
    */
65
    public VerificationErrors checkLegalEntitysVerificationErrors(String id) throws ApiException, IOException {
NEW
66
        return checkLegalEntitysVerificationErrors(id, null);
×
67
    }
68

69
    /**
70
    * Check a legal entity's verification errors
71
    *
72
    * @param id {@link String } The unique identifier of the legal entity. (required)
73
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
74
    * @return {@link VerificationErrors }
75
    * @throws ApiException if fails to make API call
76
    */
77
    public VerificationErrors checkLegalEntitysVerificationErrors(String id, RequestOptions requestOptions) throws ApiException, IOException {
78
        //Add path params
79
        Map<String, String> pathParams = new HashMap<>();
×
80
        if (id == null) {
×
81
            throw new IllegalArgumentException("Please provide the id path parameter");
×
82
        }
83
        pathParams.put("id", id);
×
84

85
        String requestBody = null;
×
NEW
86
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/checkVerificationErrors", null);
×
NEW
87
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
NEW
88
        return VerificationErrors.fromJson(jsonResult);
×
89
    }
90

91
    /**
92
    * Confirm data review
93
    *
94
    * @param id {@link String } The unique identifier of the legal entity. (required)
95
    * @return {@link DataReviewConfirmationResponse }
96
    * @throws ApiException if fails to make API call
97
    */
98
    public DataReviewConfirmationResponse confirmDataReview(String id) throws ApiException, IOException {
NEW
99
        return confirmDataReview(id, null);
×
100
    }
101

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

118
        String requestBody = null;
×
NEW
119
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/confirmDataReview", null);
×
NEW
120
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
NEW
121
        return DataReviewConfirmationResponse.fromJson(jsonResult);
×
122
    }
123

124
    /**
125
    * Create a legal entity
126
    *
127
    * @param legalEntityInfoRequiredType {@link LegalEntityInfoRequiredType }  (required)
128
    * @return {@link LegalEntity }
129
    * @throws ApiException if fails to make API call
130
    */
131
    public LegalEntity createLegalEntity(LegalEntityInfoRequiredType legalEntityInfoRequiredType) throws ApiException, IOException {
132
        return createLegalEntity(legalEntityInfoRequiredType, null);
1✔
133
    }
134

135
    /**
136
    * Create a legal entity
137
    *
138
    * @param legalEntityInfoRequiredType {@link LegalEntityInfoRequiredType }  (required)
139
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
140
    * @return {@link LegalEntity }
141
    * @throws ApiException if fails to make API call
142
    */
143
    public LegalEntity createLegalEntity(LegalEntityInfoRequiredType legalEntityInfoRequiredType, RequestOptions requestOptions) throws ApiException, IOException {
144

145
        String requestBody = legalEntityInfoRequiredType.toJson();
1✔
146
        Resource resource = new Resource(this, this.baseURL + "/legalEntities", null);
1✔
147
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
1✔
148
        return LegalEntity.fromJson(jsonResult);
1✔
149
    }
150

151
    /**
152
    * Get all business lines under a legal entity
153
    *
154
    * @param id {@link String } The unique identifier of the legal entity. (required)
155
    * @return {@link BusinessLines }
156
    * @throws ApiException if fails to make API call
157
    */
158
    public BusinessLines getAllBusinessLinesUnderLegalEntity(String id) throws ApiException, IOException {
159
        return getAllBusinessLinesUnderLegalEntity(id, null);
1✔
160
    }
161

162
    /**
163
    * Get all business lines under a legal entity
164
    *
165
    * @param id {@link String } The unique identifier of the legal entity. (required)
166
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
167
    * @return {@link BusinessLines }
168
    * @throws ApiException if fails to make API call
169
    */
170
    public BusinessLines getAllBusinessLinesUnderLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException {
171
        //Add path params
172
        Map<String, String> pathParams = new HashMap<>();
1✔
173
        if (id == null) {
1✔
NEW
174
            throw new IllegalArgumentException("Please provide the id path parameter");
×
175
        }
176
        pathParams.put("id", id);
1✔
177

178
        String requestBody = null;
1✔
179
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/businessLines", null);
1✔
180
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
1✔
181
        return BusinessLines.fromJson(jsonResult);
1✔
182
    }
183

184
    /**
185
    * Get a legal entity
186
    *
187
    * @param id {@link String } The unique identifier of the legal entity. (required)
188
    * @return {@link LegalEntity }
189
    * @throws ApiException if fails to make API call
190
    */
191
    public LegalEntity getLegalEntity(String id) throws ApiException, IOException {
192
        return getLegalEntity(id, null);
1✔
193
    }
194

195
    /**
196
    * Get a legal entity
197
    *
198
    * @param id {@link String } The unique identifier of the legal entity. (required)
199
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
200
    * @return {@link LegalEntity }
201
    * @throws ApiException if fails to make API call
202
    */
203
    public LegalEntity getLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException {
204
        //Add path params
205
        Map<String, String> pathParams = new HashMap<>();
1✔
206
        if (id == null) {
1✔
207
            throw new IllegalArgumentException("Please provide the id path parameter");
×
208
        }
209
        pathParams.put("id", id);
1✔
210

211
        String requestBody = null;
1✔
212
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}", null);
1✔
213
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
1✔
214
        return LegalEntity.fromJson(jsonResult);
1✔
215
    }
216

217
    /**
218
    * Update a legal entity
219
    *
220
    * @param id {@link String } The unique identifier of the legal entity. (required)
221
    * @param legalEntityInfo {@link LegalEntityInfo }  (required)
222
    * @return {@link LegalEntity }
223
    * @throws ApiException if fails to make API call
224
    */
225
    public LegalEntity updateLegalEntity(String id, LegalEntityInfo legalEntityInfo) throws ApiException, IOException {
226
        return updateLegalEntity(id, legalEntityInfo, null);
1✔
227
    }
228

229
    /**
230
    * Update a legal entity
231
    *
232
    * @param id {@link String } The unique identifier of the legal entity. (required)
233
    * @param legalEntityInfo {@link LegalEntityInfo }  (required)
234
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
235
    * @return {@link LegalEntity }
236
    * @throws ApiException if fails to make API call
237
    */
238
    public LegalEntity updateLegalEntity(String id, LegalEntityInfo legalEntityInfo, RequestOptions requestOptions) throws ApiException, IOException {
239
        //Add path params
240
        Map<String, String> pathParams = new HashMap<>();
1✔
241
        if (id == null) {
1✔
242
            throw new IllegalArgumentException("Please provide the id path parameter");
×
243
        }
244
        pathParams.put("id", id);
1✔
245

246
        String requestBody = legalEntityInfo.toJson();
1✔
247
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}", null);
1✔
248
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams);
1✔
249
        return LegalEntity.fromJson(jsonResult);
1✔
250
    }
251
}
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