• 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

0.0
/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.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.AcceptTermsOfServiceRequest;
18
import com.adyen.model.legalentitymanagement.AcceptTermsOfServiceResponse;
19
import com.adyen.model.legalentitymanagement.CalculateTermsOfServiceStatusResponse;
20
import com.adyen.model.legalentitymanagement.GetTermsOfServiceAcceptanceInfosResponse;
21
import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentRequest;
22
import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentResponse;
23
import com.adyen.model.legalentitymanagement.ServiceError;
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 TermsOfServiceApi extends Service {
33

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

36
    protected String baseURL;
37

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

47
    /**
48
    * Terms of Service 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 TermsOfServiceApi(Client client, String baseURL) {
54
        super(client);
×
55
        this.baseURL = baseURL;
×
56
    }
×
57

58
    /**
59
    * Accept Terms of Service
60
    *
61
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
62
    * @param termsofservicedocumentid {@link String } The unique identifier of the Terms of Service document. (required)
63
    * @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest }  (required)
64
    * @return {@link AcceptTermsOfServiceResponse }
65
    * @throws ApiException if fails to make API call
66
    */
67
    public AcceptTermsOfServiceResponse acceptTermsOfService(String id, String termsofservicedocumentid, AcceptTermsOfServiceRequest acceptTermsOfServiceRequest) throws ApiException, IOException {
NEW
68
        return acceptTermsOfService(id, termsofservicedocumentid, acceptTermsOfServiceRequest, null);
×
69
    }
70

71
    /**
72
    * Accept Terms of Service
73
    *
74
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
75
    * @param termsofservicedocumentid {@link String } The unique identifier of the Terms of Service document. (required)
76
    * @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest }  (required)
77
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
78
    * @return {@link AcceptTermsOfServiceResponse }
79
    * @throws ApiException if fails to make API call
80
    */
81
    public AcceptTermsOfServiceResponse acceptTermsOfService(String id, String termsofservicedocumentid, AcceptTermsOfServiceRequest acceptTermsOfServiceRequest, RequestOptions requestOptions) throws ApiException, IOException {
82
        //Add path params
83
        Map<String, String> pathParams = new HashMap<>();
×
84
        if (id == null) {
×
85
            throw new IllegalArgumentException("Please provide the id path parameter");
×
86
        }
87
        pathParams.put("id", id);
×
NEW
88
        if (termsofservicedocumentid == null) {
×
NEW
89
            throw new IllegalArgumentException("Please provide the termsofservicedocumentid path parameter");
×
90
        }
NEW
91
        pathParams.put("termsofservicedocumentid", termsofservicedocumentid);
×
92

NEW
93
        String requestBody = acceptTermsOfServiceRequest.toJson();
×
NEW
94
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}", null);
×
NEW
95
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams);
×
NEW
96
        return AcceptTermsOfServiceResponse.fromJson(jsonResult);
×
97
    }
98

99
    /**
100
    * Get Terms of Service document
101
    *
102
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
103
    * @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest }  (required)
104
    * @return {@link GetTermsOfServiceDocumentResponse }
105
    * @throws ApiException if fails to make API call
106
    */
107
    public GetTermsOfServiceDocumentResponse getTermsOfServiceDocument(String id, GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest) throws ApiException, IOException {
NEW
108
        return getTermsOfServiceDocument(id, getTermsOfServiceDocumentRequest, null);
×
109
    }
110

111
    /**
112
    * Get Terms of Service document
113
    *
114
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
115
    * @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest }  (required)
116
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
117
    * @return {@link GetTermsOfServiceDocumentResponse }
118
    * @throws ApiException if fails to make API call
119
    */
120
    public GetTermsOfServiceDocumentResponse getTermsOfServiceDocument(String id, GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest, RequestOptions requestOptions) throws ApiException, IOException {
121
        //Add path params
122
        Map<String, String> pathParams = new HashMap<>();
×
123
        if (id == null) {
×
124
            throw new IllegalArgumentException("Please provide the id path parameter");
×
125
        }
126
        pathParams.put("id", id);
×
127

NEW
128
        String requestBody = getTermsOfServiceDocumentRequest.toJson();
×
NEW
129
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfService", null);
×
NEW
130
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
NEW
131
        return GetTermsOfServiceDocumentResponse.fromJson(jsonResult);
×
132
    }
133

134
    /**
135
    * Get Terms of Service information for a legal entity
136
    *
137
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
138
    * @return {@link GetTermsOfServiceAcceptanceInfosResponse }
139
    * @throws ApiException if fails to make API call
140
    */
141
    public GetTermsOfServiceAcceptanceInfosResponse getTermsOfServiceInformationForLegalEntity(String id) throws ApiException, IOException {
NEW
142
        return getTermsOfServiceInformationForLegalEntity(id, null);
×
143
    }
144

145
    /**
146
    * Get Terms of Service information for a legal entity
147
    *
148
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
149
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
150
    * @return {@link GetTermsOfServiceAcceptanceInfosResponse }
151
    * @throws ApiException if fails to make API call
152
    */
153
    public GetTermsOfServiceAcceptanceInfosResponse getTermsOfServiceInformationForLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException {
154
        //Add path params
155
        Map<String, String> pathParams = new HashMap<>();
×
156
        if (id == null) {
×
157
            throw new IllegalArgumentException("Please provide the id path parameter");
×
158
        }
159
        pathParams.put("id", id);
×
160

NEW
161
        String requestBody = null;
×
NEW
162
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfServiceAcceptanceInfos", null);
×
NEW
163
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
NEW
164
        return GetTermsOfServiceAcceptanceInfosResponse.fromJson(jsonResult);
×
165
    }
166

167
    /**
168
    * Get Terms of Service status
169
    *
170
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
171
    * @return {@link CalculateTermsOfServiceStatusResponse }
172
    * @throws ApiException if fails to make API call
173
    */
174
    public CalculateTermsOfServiceStatusResponse getTermsOfServiceStatus(String id) throws ApiException, IOException {
NEW
175
        return getTermsOfServiceStatus(id, null);
×
176
    }
177

178
    /**
179
    * Get Terms of Service status
180
    *
181
    * @param id {@link String } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. (required)
182
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
183
    * @return {@link CalculateTermsOfServiceStatusResponse }
184
    * @throws ApiException if fails to make API call
185
    */
186
    public CalculateTermsOfServiceStatusResponse getTermsOfServiceStatus(String id, RequestOptions requestOptions) throws ApiException, IOException {
187
        //Add path params
188
        Map<String, String> pathParams = new HashMap<>();
×
189
        if (id == null) {
×
190
            throw new IllegalArgumentException("Please provide the id path parameter");
×
191
        }
192
        pathParams.put("id", id);
×
193

NEW
194
        String requestBody = null;
×
NEW
195
        Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfServiceStatus", null);
×
NEW
196
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
NEW
197
        return CalculateTermsOfServiceStatusResponse.fromJson(jsonResult);
×
198
    }
199
}
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