• 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

82.76
/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java
1
/*
2
 * Configuration API
3
 *
4
 * The version of the OpenAPI document: 2
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.balanceplatform;
13

14
import com.adyen.Client;
15
import com.adyen.Service;
16
import com.adyen.constants.ApiConstants;
17
import com.adyen.model.balanceplatform.PaymentInstrumentGroup;
18
import com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo;
19
import com.adyen.model.balanceplatform.RestServiceError;
20
import com.adyen.model.balanceplatform.TransactionRulesResponse;
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 PaymentInstrumentGroupsApi extends Service {
30

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

33
    protected String baseURL;
34

35
    /**
36
    * Payment instrument groups constructor in {@link com.adyen.service.balanceplatform package}.
37
    * @param client {@link Client } (required)
38
    */
39
    public PaymentInstrumentGroupsApi(Client client) {
40
        super(client);
1✔
41
        this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2");
1✔
42
    }
1✔
43

44
    /**
45
    * Payment instrument groups constructor in {@link com.adyen.service.balanceplatform 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 PaymentInstrumentGroupsApi(Client client, String baseURL) {
51
        super(client);
×
52
        this.baseURL = baseURL;
×
53
    }
×
54

55
    /**
56
    * Create a payment instrument group
57
    *
58
    * @param paymentInstrumentGroupInfo {@link PaymentInstrumentGroupInfo }  (required)
59
    * @return {@link PaymentInstrumentGroup }
60
    * @throws ApiException if fails to make API call
61
    */
62
    public PaymentInstrumentGroup createPaymentInstrumentGroup(PaymentInstrumentGroupInfo paymentInstrumentGroupInfo) throws ApiException, IOException {
63
        return createPaymentInstrumentGroup(paymentInstrumentGroupInfo, null);
1✔
64
    }
65

66
    /**
67
    * Create a payment instrument group
68
    *
69
    * @param paymentInstrumentGroupInfo {@link PaymentInstrumentGroupInfo }  (required)
70
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
71
    * @return {@link PaymentInstrumentGroup }
72
    * @throws ApiException if fails to make API call
73
    */
74
    public PaymentInstrumentGroup createPaymentInstrumentGroup(PaymentInstrumentGroupInfo paymentInstrumentGroupInfo, RequestOptions requestOptions) throws ApiException, IOException {
75

76
        String requestBody = paymentInstrumentGroupInfo.toJson();
1✔
77
        Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups", null);
1✔
78
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
1✔
79
        return PaymentInstrumentGroup.fromJson(jsonResult);
1✔
80
    }
81

82
    /**
83
    * Get all transaction rules for a payment instrument group
84
    *
85
    * @param id {@link String } The unique identifier of the payment instrument group. (required)
86
    * @return {@link TransactionRulesResponse }
87
    * @throws ApiException if fails to make API call
88
    */
89
    public TransactionRulesResponse getAllTransactionRulesForPaymentInstrumentGroup(String id) throws ApiException, IOException {
90
        return getAllTransactionRulesForPaymentInstrumentGroup(id, null);
1✔
91
    }
92

93
    /**
94
    * Get all transaction rules for a payment instrument group
95
    *
96
    * @param id {@link String } The unique identifier of the payment instrument group. (required)
97
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
98
    * @return {@link TransactionRulesResponse }
99
    * @throws ApiException if fails to make API call
100
    */
101
    public TransactionRulesResponse getAllTransactionRulesForPaymentInstrumentGroup(String id, RequestOptions requestOptions) throws ApiException, IOException {
102
        //Add path params
103
        Map<String, String> pathParams = new HashMap<>();
1✔
104
        if (id == null) {
1✔
105
            throw new IllegalArgumentException("Please provide the id path parameter");
×
106
        }
107
        pathParams.put("id", id);
1✔
108

109
        String requestBody = null;
1✔
110
        Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups/{id}/transactionRules", null);
1✔
111
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
1✔
112
        return TransactionRulesResponse.fromJson(jsonResult);
1✔
113
    }
114

115
    /**
116
    * Get a payment instrument group
117
    *
118
    * @param id {@link String } The unique identifier of the payment instrument group. (required)
119
    * @return {@link PaymentInstrumentGroup }
120
    * @throws ApiException if fails to make API call
121
    */
122
    public PaymentInstrumentGroup getPaymentInstrumentGroup(String id) throws ApiException, IOException {
123
        return getPaymentInstrumentGroup(id, null);
1✔
124
    }
125

126
    /**
127
    * Get a payment instrument group
128
    *
129
    * @param id {@link String } The unique identifier of the payment instrument group. (required)
130
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
131
    * @return {@link PaymentInstrumentGroup }
132
    * @throws ApiException if fails to make API call
133
    */
134
    public PaymentInstrumentGroup getPaymentInstrumentGroup(String id, RequestOptions requestOptions) throws ApiException, IOException {
135
        //Add path params
136
        Map<String, String> pathParams = new HashMap<>();
1✔
137
        if (id == null) {
1✔
NEW
138
            throw new IllegalArgumentException("Please provide the id path parameter");
×
139
        }
140
        pathParams.put("id", id);
1✔
141

142
        String requestBody = null;
1✔
143
        Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups/{id}", null);
1✔
144
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams);
1✔
145
        return PaymentInstrumentGroup.fromJson(jsonResult);
1✔
146
    }
147
}
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