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

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

22 Sep 2023 11:24AM UTC coverage: 12.611%. First build
#2661

push

web-flow
Merge 251f6ff51 into 9e36e9c01

9262 of 9262 new or added lines in 142 files covered. (100.0%)

11033 of 87486 relevant lines covered (12.61%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

22.86
/src/main/java/com/adyen/service/classicplatforms/ClassicPlatformConfigurationApi.java
1
/*
2
 * Notification Configuration API
3
 * This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead.  The Notification Configuration API provides endpoints for setting up and testing notifications that inform you of events on your platform, for example when a verification check or a payout has been completed.  For more information, refer to our [documentation](https://docs.adyen.com/marketplaces-and-platforms/classic/notifications). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example:   ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ```  Alternatively, you can use the username and password to connect to the API using basic authentication. For example:  ``` curl -U \"ws@MarketPlace.YOUR_PLATFORM_ACCOUNT\":\"YOUR_WS_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` When going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).  ## Versioning The Notification Configuration API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number.  For example: ``` https://cal-test.adyen.com/cal/services/Notification/v6/createNotificationConfiguration ```
4
 *
5
 * The version of the OpenAPI document: 6
6
 * 
7
 *
8
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
 * https://openapi-generator.tech
10
 * Do not edit the class manually.
11
 */
12

13
package com.adyen.service.classicplatforms;
14

15
import com.adyen.Client;
16
import com.adyen.Service;
17
import com.adyen.constants.ApiConstants;
18
import com.adyen.model.marketpayconfiguration.CreateNotificationConfigurationRequest;
19
import com.adyen.model.marketpayconfiguration.DeleteNotificationConfigurationRequest;
20
import com.adyen.model.marketpayconfiguration.GenericResponse;
21
import com.adyen.model.marketpayconfiguration.GetNotificationConfigurationListResponse;
22
import com.adyen.model.marketpayconfiguration.GetNotificationConfigurationRequest;
23
import com.adyen.model.marketpayconfiguration.GetNotificationConfigurationResponse;
24
import com.adyen.model.marketpayconfiguration.ServiceError;
25
import com.adyen.model.marketpayconfiguration.TestNotificationConfigurationRequest;
26
import com.adyen.model.marketpayconfiguration.TestNotificationConfigurationResponse;
27
import com.adyen.model.marketpayconfiguration.UpdateNotificationConfigurationRequest;
28
import com.adyen.model.RequestOptions;
29
import com.adyen.service.exception.ApiException;
30
import com.adyen.service.resource.Resource;
31

32
import java.io.IOException;
33
import java.util.HashMap;
34
import java.util.Map;
35

36
public class ClassicPlatformConfigurationApi extends Service {
37

38
    public static final String API_VERSION = "6";
39

40
    protected String baseURL;
41

42
    /**
43
    * General constructor in {@link com.adyen.service package}.
44
    * @param client {@link Client }  (required)
45
    */
46
    public ClassicPlatformConfigurationApi(Client client) {
47
        super(client);
1✔
48
        this.baseURL = createBaseURL("https://cal-test.adyen.com/cal/services/Notification/v6");
1✔
49
    }
1✔
50

51
    /**
52
    * General constructor in {@link com.adyen.service package}.
53
    * 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.
54
    * @param client {@link Client }  (required)
55
    * @param baseURL {@link String }  (required)
56
    */
57
    public ClassicPlatformConfigurationApi(Client client, String baseURL) {
58
        super(client);
×
59
        this.baseURL = baseURL;
×
60
    }
×
61

62
    /**
63
    * Subscribe to notifications
64
    *
65
    * @param createNotificationConfigurationRequest {@link CreateNotificationConfigurationRequest }  (required)
66
    * @return {@link GetNotificationConfigurationResponse }
67
    * @throws ApiException if fails to make API call
68
    */
69
    public GetNotificationConfigurationResponse createNotificationConfiguration(CreateNotificationConfigurationRequest createNotificationConfigurationRequest) throws ApiException, IOException {
70
        return createNotificationConfiguration(createNotificationConfigurationRequest, null);
1✔
71
    }
72

73
    /**
74
    * Subscribe to notifications
75
    *
76
    * @param createNotificationConfigurationRequest {@link CreateNotificationConfigurationRequest }  (required)
77
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
78
    * @return {@link GetNotificationConfigurationResponse }
79
    * @throws ApiException if fails to make API call
80
    */
81
    public GetNotificationConfigurationResponse createNotificationConfiguration(CreateNotificationConfigurationRequest createNotificationConfigurationRequest, RequestOptions requestOptions) throws ApiException, IOException {
82

83
        String requestBody = createNotificationConfigurationRequest.toJson();
1✔
84
        Resource resource = new Resource(this, this.baseURL + "/createNotificationConfiguration", null);
1✔
85
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
1✔
86
        return GetNotificationConfigurationResponse.fromJson(jsonResult);
1✔
87
    }
88

89
    /**
90
    * Delete a notification subscription configuration
91
    *
92
    * @param deleteNotificationConfigurationRequest {@link DeleteNotificationConfigurationRequest }  (required)
93
    * @return {@link GenericResponse }
94
    * @throws ApiException if fails to make API call
95
    */
96
    public GenericResponse deleteNotificationConfigurations(DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest) throws ApiException, IOException {
97
        return deleteNotificationConfigurations(deleteNotificationConfigurationRequest, null);
×
98
    }
99

100
    /**
101
    * Delete a notification subscription configuration
102
    *
103
    * @param deleteNotificationConfigurationRequest {@link DeleteNotificationConfigurationRequest }  (required)
104
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
105
    * @return {@link GenericResponse }
106
    * @throws ApiException if fails to make API call
107
    */
108
    public GenericResponse deleteNotificationConfigurations(DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest, RequestOptions requestOptions) throws ApiException, IOException {
109

110
        String requestBody = deleteNotificationConfigurationRequest.toJson();
×
111
        Resource resource = new Resource(this, this.baseURL + "/deleteNotificationConfigurations", null);
×
112
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
113
        return GenericResponse.fromJson(jsonResult);
×
114
    }
115

116
    /**
117
    * Get a notification subscription configuration
118
    *
119
    * @param getNotificationConfigurationRequest {@link GetNotificationConfigurationRequest }  (required)
120
    * @return {@link GetNotificationConfigurationResponse }
121
    * @throws ApiException if fails to make API call
122
    */
123
    public GetNotificationConfigurationResponse getNotificationConfiguration(GetNotificationConfigurationRequest getNotificationConfigurationRequest) throws ApiException, IOException {
124
        return getNotificationConfiguration(getNotificationConfigurationRequest, null);
×
125
    }
126

127
    /**
128
    * Get a notification subscription configuration
129
    *
130
    * @param getNotificationConfigurationRequest {@link GetNotificationConfigurationRequest }  (required)
131
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
132
    * @return {@link GetNotificationConfigurationResponse }
133
    * @throws ApiException if fails to make API call
134
    */
135
    public GetNotificationConfigurationResponse getNotificationConfiguration(GetNotificationConfigurationRequest getNotificationConfigurationRequest, RequestOptions requestOptions) throws ApiException, IOException {
136

137
        String requestBody = getNotificationConfigurationRequest.toJson();
×
138
        Resource resource = new Resource(this, this.baseURL + "/getNotificationConfiguration", null);
×
139
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
140
        return GetNotificationConfigurationResponse.fromJson(jsonResult);
×
141
    }
142

143
    /**
144
    * Get a list of notification subscription configurations
145
    *
146
    * @param body {@link Object }  (required)
147
    * @return {@link GetNotificationConfigurationListResponse }
148
    * @throws ApiException if fails to make API call
149
    */
150
    public GetNotificationConfigurationListResponse getNotificationConfigurationList(Object body) throws ApiException, IOException {
151
        return getNotificationConfigurationList(null);
×
152
    }
153

154
    /**
155
    * Get a list of notification subscription configurations
156
    *
157
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
158
    * @return {@link GetNotificationConfigurationListResponse }
159
    * @throws ApiException if fails to make API call
160
    */
161
    public GetNotificationConfigurationListResponse getNotificationConfigurationList(RequestOptions requestOptions) throws ApiException, IOException {
162

163
        Resource resource = new Resource(this, this.baseURL + "/getNotificationConfigurationList", null);
×
164
        String jsonResult = resource.request("{}", requestOptions, ApiConstants.HttpMethod.POST, null);
×
165
        return GetNotificationConfigurationListResponse.fromJson(jsonResult);
×
166
    }
167

168
    /**
169
    * Test a notification configuration
170
    *
171
    * @param testNotificationConfigurationRequest {@link TestNotificationConfigurationRequest }  (required)
172
    * @return {@link TestNotificationConfigurationResponse }
173
    * @throws ApiException if fails to make API call
174
    */
175
    public TestNotificationConfigurationResponse testNotificationConfiguration(TestNotificationConfigurationRequest testNotificationConfigurationRequest) throws ApiException, IOException {
176
        return testNotificationConfiguration(testNotificationConfigurationRequest, null);
×
177
    }
178

179
    /**
180
    * Test a notification configuration
181
    *
182
    * @param testNotificationConfigurationRequest {@link TestNotificationConfigurationRequest }  (required)
183
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
184
    * @return {@link TestNotificationConfigurationResponse }
185
    * @throws ApiException if fails to make API call
186
    */
187
    public TestNotificationConfigurationResponse testNotificationConfiguration(TestNotificationConfigurationRequest testNotificationConfigurationRequest, RequestOptions requestOptions) throws ApiException, IOException {
188

189
        String requestBody = testNotificationConfigurationRequest.toJson();
×
190
        Resource resource = new Resource(this, this.baseURL + "/testNotificationConfiguration", null);
×
191
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
192
        return TestNotificationConfigurationResponse.fromJson(jsonResult);
×
193
    }
194

195
    /**
196
    * Update a notification subscription configuration
197
    *
198
    * @param updateNotificationConfigurationRequest {@link UpdateNotificationConfigurationRequest }  (required)
199
    * @return {@link GetNotificationConfigurationResponse }
200
    * @throws ApiException if fails to make API call
201
    */
202
    public GetNotificationConfigurationResponse updateNotificationConfiguration(UpdateNotificationConfigurationRequest updateNotificationConfigurationRequest) throws ApiException, IOException {
203
        return updateNotificationConfiguration(updateNotificationConfigurationRequest, null);
×
204
    }
205

206
    /**
207
    * Update a notification subscription configuration
208
    *
209
    * @param updateNotificationConfigurationRequest {@link UpdateNotificationConfigurationRequest }  (required)
210
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
211
    * @return {@link GetNotificationConfigurationResponse }
212
    * @throws ApiException if fails to make API call
213
    */
214
    public GetNotificationConfigurationResponse updateNotificationConfiguration(UpdateNotificationConfigurationRequest updateNotificationConfigurationRequest, RequestOptions requestOptions) throws ApiException, IOException {
215

216
        String requestBody = updateNotificationConfigurationRequest.toJson();
×
217
        Resource resource = new Resource(this, this.baseURL + "/updateNotificationConfiguration", null);
×
218
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
219
        return GetNotificationConfigurationResponse.fromJson(jsonResult);
×
220
    }
221
}
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