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

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

23 Oct 2023 01:52PM CUT coverage: 12.821%. First build
#2748

push

web-flow
Merge c6d37d76d into c99ba89a9

2931 of 2931 new or added lines in 118 files covered. (100.0%)

12345 of 96286 relevant lines covered (12.82%)

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/ApiKeyCompanyLevelApi.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.GenerateApiKeyResponse;
18
import com.adyen.model.management.RestServiceError;
19
import com.adyen.model.RequestOptions;
20
import com.adyen.service.exception.ApiException;
21
import com.adyen.service.resource.Resource;
22

23
import java.io.IOException;
24
import java.util.HashMap;
25
import java.util.Map;
26

27
public class ApiKeyCompanyLevelApi extends Service {
28

29
    public static final String API_VERSION = "3";
30

31
    protected String baseURL;
32

33
    /**
34
    * API key - company level constructor in {@link com.adyen.service.management package}.
35
    * @param client {@link Client } (required)
36
    */
37
    public ApiKeyCompanyLevelApi(Client client) {
38
        super(client);
×
39
        this.baseURL = createBaseURL("https://management-test.adyen.com/v3");
×
40
    }
×
41

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

53
    /**
54
    * Generate new API key
55
    *
56
    * @param companyId {@link String } The unique identifier of the company account. (required)
57
    * @param apiCredentialId {@link String } Unique identifier of the API credential. (required)
58
    * @return {@link GenerateApiKeyResponse }
59
    * @throws ApiException if fails to make API call
60
    */
61
    public GenerateApiKeyResponse generateNewApiKey(String companyId, String apiCredentialId) throws ApiException, IOException {
62
        return generateNewApiKey(companyId, apiCredentialId, null);
×
63
    }
64

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

86
        String requestBody = null;
×
87
        Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey", null);
×
88
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams);
×
89
        return GenerateApiKeyResponse.fromJson(jsonResult);
×
90
    }
91
}
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