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

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

11 Dec 2023 05:06PM CUT 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/management/TerminalActionsCompanyLevelApi.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.ExternalTerminalAction;
18
import com.adyen.model.management.ListExternalTerminalActionsResponse;
19
import com.adyen.model.management.RestServiceError;
20
import com.adyen.model.RequestOptions;
21
import com.adyen.service.exception.ApiException;
22
import com.adyen.service.resource.Resource;
23

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

28
public class TerminalActionsCompanyLevelApi extends Service {
29

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

32
    protected String baseURL;
33

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

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

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

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

NEW
87
        String requestBody = null;
×
NEW
88
        Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalActions/{actionId}", null);
×
NEW
89
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
×
NEW
90
        return ExternalTerminalAction.fromJson(jsonResult);
×
91
    }
92

93
    /**
94
    * Get a list of terminal actions
95
    *
96
    * @param companyId {@link String } The unique identifier of the company account. (required)
97
    * @return {@link ListExternalTerminalActionsResponse }
98
    * @throws ApiException if fails to make API call
99
    */
100
    public ListExternalTerminalActionsResponse listTerminalActions(String companyId) throws ApiException, IOException {
101
        return listTerminalActions(companyId, null,  null,  null,  null,  null);
×
102
    }
103

104
    /**
105
    * Get a list of terminal actions
106
    *
107
    * @param companyId {@link String } The unique identifier of the company account. (required)
108
    * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional)
109
    * @param pageSize {@link Integer } Query: The number of items to have on a page, maximum 100. The default is 20 items on a page. (optional)
110
    * @param status {@link String } Query: Returns terminal actions with the specified status.  Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**. (optional)
111
    * @param type {@link String } Query: Returns terminal actions of the specified type.  Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**. (optional)
112
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
113
    * @return {@link ListExternalTerminalActionsResponse }
114
    * @throws ApiException if fails to make API call
115
    */
116
    public ListExternalTerminalActionsResponse listTerminalActions(String companyId, Integer pageNumber, Integer pageSize, String status, String type, RequestOptions requestOptions) throws ApiException, IOException {
117
        //Add path params
118
        Map<String, String> pathParams = new HashMap<>();
×
119
        if (companyId == null) {
×
120
            throw new IllegalArgumentException("Please provide the companyId path parameter");
×
121
        }
122
        pathParams.put("companyId", companyId);
×
123
        //Add query params
124
        Map<String, String> queryParams = new HashMap<>();
×
125
        if (pageNumber != null) {
×
126
        queryParams.put("pageNumber", pageNumber.toString());
×
127
        }
128
        if (pageSize != null) {
×
129
        queryParams.put("pageSize", pageSize.toString());
×
130
        }
131
        if (status != null) {
×
132
        queryParams.put("status", status);
×
133
        }
134
        if (type != null) {
×
135
        queryParams.put("type", type);
×
136
        }
137

138
        String requestBody = null;
×
139
        Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalActions", null);
×
140
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams);
×
141
        return ListExternalTerminalActionsResponse.fromJson(jsonResult);
×
142
    }
143
}
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