• 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

28.21
/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.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.Company;
18
import com.adyen.model.management.ListCompanyResponse;
19
import com.adyen.model.management.ListMerchantResponse;
20
import com.adyen.model.management.RestServiceError;
21
import com.adyen.model.RequestOptions;
22
import com.adyen.service.exception.ApiException;
23
import com.adyen.service.resource.Resource;
24

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

29
public class AccountCompanyLevelApi extends Service {
30

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

33
    protected String baseURL;
34

35
    /**
36
    *  constructor in {@link com.adyen.service.management package}.
37
    * @param client {@link Client } (required)
38
    */
39
    public AccountCompanyLevelApi(Client client) {
40
        super(client);
1✔
41
        this.baseURL = createBaseURL("https://management-test.adyen.com/v3");
1✔
42
    }
1✔
43

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

55
    /**
56
    * Get a company account
57
    *
58
    * @param companyId {@link String } The unique identifier of the company account. (required)
59
    * @return {@link Company }
60
    * @throws ApiException if fails to make API call
61
    */
62
    public Company getCompanyAccount(String companyId) throws ApiException, IOException {
NEW
63
        return getCompanyAccount(companyId, null);
×
64
    }
65

66
    /**
67
    * Get a company account
68
    *
69
    * @param companyId {@link String } The unique identifier of the company account. (required)
70
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
71
    * @return {@link Company }
72
    * @throws ApiException if fails to make API call
73
    */
74
    public Company getCompanyAccount(String companyId, RequestOptions requestOptions) throws ApiException, IOException {
75
        //Add path params
NEW
76
        Map<String, String> pathParams = new HashMap<>();
×
NEW
77
        if (companyId == null) {
×
NEW
78
            throw new IllegalArgumentException("Please provide the companyId path parameter");
×
79
        }
NEW
80
        pathParams.put("companyId", companyId);
×
81

NEW
82
        String requestBody = null;
×
NEW
83
        Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}", null);
×
NEW
84
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
NEW
85
        return Company.fromJson(jsonResult);
×
86
    }
87

88
    /**
89
    * Get a list of company accounts
90
    *
91
    * @return {@link ListCompanyResponse }
92
    * @throws ApiException if fails to make API call
93
    */
94
    public ListCompanyResponse listCompanyAccounts() throws ApiException, IOException {
95
        return listCompanyAccounts(null,  null,  null);
1✔
96
    }
97

98
    /**
99
    * Get a list of company accounts
100
    *
101
    * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional)
102
    * @param pageSize {@link Integer } Query: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional)
103
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
104
    * @return {@link ListCompanyResponse }
105
    * @throws ApiException if fails to make API call
106
    */
107
    public ListCompanyResponse listCompanyAccounts(Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException {
108
        //Add query params
109
        Map<String, String> queryParams = new HashMap<>();
1✔
110
        if (pageNumber != null) {
1✔
111
        queryParams.put("pageNumber", pageNumber.toString());
×
112
        }
113
        if (pageSize != null) {
1✔
114
        queryParams.put("pageSize", pageSize.toString());
×
115
        }
116

117
        String requestBody = null;
1✔
118
        Resource resource = new Resource(this, this.baseURL + "/companies", null);
1✔
119
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams);
1✔
120
        return ListCompanyResponse.fromJson(jsonResult);
1✔
121
    }
122

123
    /**
124
    * Get a list of merchant accounts
125
    *
126
    * @param companyId {@link String } The unique identifier of the company account. (required)
127
    * @return {@link ListMerchantResponse }
128
    * @throws ApiException if fails to make API call
129
    */
130
    public ListMerchantResponse listMerchantAccounts(String companyId) throws ApiException, IOException {
131
        return listMerchantAccounts(companyId, null,  null,  null);
×
132
    }
133

134
    /**
135
    * Get a list of merchant accounts
136
    *
137
    * @param companyId {@link String } The unique identifier of the company account. (required)
138
    * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional)
139
    * @param pageSize {@link Integer } Query: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional)
140
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
141
    * @return {@link ListMerchantResponse }
142
    * @throws ApiException if fails to make API call
143
    */
144
    public ListMerchantResponse listMerchantAccounts(String companyId, Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException {
145
        //Add path params
146
        Map<String, String> pathParams = new HashMap<>();
×
147
        if (companyId == null) {
×
148
            throw new IllegalArgumentException("Please provide the companyId path parameter");
×
149
        }
150
        pathParams.put("companyId", companyId);
×
151
        //Add query params
152
        Map<String, String> queryParams = new HashMap<>();
×
153
        if (pageNumber != null) {
×
154
        queryParams.put("pageNumber", pageNumber.toString());
×
155
        }
156
        if (pageSize != null) {
×
157
        queryParams.put("pageSize", pageSize.toString());
×
158
        }
159

160
        String requestBody = null;
×
161
        Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/merchants", null);
×
162
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams);
×
163
        return ListMerchantResponse.fromJson(jsonResult);
×
164
    }
165
}
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