Skip to content

Commit a0c3169

Browse files
authored
Merge pull request #170 from ConsumerDataStandardsAustralia/feature/2.4.0
Update to CDS 1.29.0
2 parents ee7723b + 80bdf7b commit a0c3169

37 files changed

+1848
-778
lines changed

client-cli/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ or, if you want to point to your own keystore:
2929

3030
docker run -p 8686:8686 -it -v /your/local/path/to/java-artefacts/client-cli/keystore:/keystore consumerdatastandardsaustralia/client-cli:x.x.x
3131

32-
Where `x.x.x` is the version, say, `2.3.0`
32+
Where `x.x.x` is the version, say, `2.4.0`
3333

3434
Run locally-built image:
3535

36-
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.3.1-SNAPSHOT
36+
docker run -p 8383:8383 consumerdatastandardsaustralia/data-holder:2.4.1-SNAPSHOT
3737

3838
### Command Reference
3939

@@ -183,8 +183,8 @@ or in the application.properties file before launching the application with `mvn
183183

184184
Example:
185185

186-
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.3.0.jar
186+
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.4.0.jar
187187

188188
or
189189

190-
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.3.1-SNAPSHOT.jar
190+
java -Dserver=http://localhost:8383/cds-au/v1 -jar target/client-cli-2.4.1-SNAPSHOT.jar

client-cli/src/main/java/au/org/consumerdatastandards/client/cli/energy/EnergyAccounts.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import au.org.consumerdatastandards.client.model.energy.EnergyBalanceListResponse;
1313
import au.org.consumerdatastandards.client.model.energy.EnergyBalanceResponse;
1414
import au.org.consumerdatastandards.client.model.energy.EnergyBillingListResponse;
15+
import au.org.consumerdatastandards.client.model.energy.EnergyBillingTransactionBase;
1516
import au.org.consumerdatastandards.client.model.energy.EnergyConcessionsResponse;
1617
import au.org.consumerdatastandards.client.model.energy.EnergyInvoiceListResponse;
1718
import au.org.consumerdatastandards.client.model.energy.EnergyPaymentScheduleResponse;
@@ -283,14 +284,14 @@ public String getBillingForEnergyAccount(@ShellOption(defaultValue = "false") bo
283284
@ShellOption(defaultValue = ShellOption.NULL) OffsetDateTime newestTime,
284285
@ShellOption(defaultValue = ShellOption.NULL) Integer page,
285286
@ShellOption(defaultValue = ShellOption.NULL) Integer pageSize,
286-
@ShellOption(defaultValue = "2") Integer version) throws Exception {
287+
@ShellOption(defaultValue = "3") Integer version) throws Exception {
287288

288289
LOGGER.info("Get billing for Energy account CLI initiated with accountId: {}, oldest-time: {}, newest-time: {}, page: {}, page-size: {}, version: {}",
289290
accountId, oldestTime, newestTime, page, pageSize, version);
290291

291292
api.setApiClient(clientFactory.create(true, check));
292-
ApiResult<EnergyBillingListResponse> result = api.getBillingForAccount(accountId, oldestTime, newestTime, page, pageSize, version);
293-
ApiResponse<EnergyBillingListResponse> response = result.getResponse();
293+
ApiResult<EnergyBillingListResponse<EnergyBillingTransactionBase>> result = api.getBillingForAccount(accountId, oldestTime, newestTime, page, pageSize, version);
294+
ApiResponse<EnergyBillingListResponse<EnergyBillingTransactionBase>> response = result.getResponse();
294295

295296
if (clientFactory.isValidationEnabled() || check) {
296297
LOGGER.info("Payload validation is enabled");
@@ -309,14 +310,14 @@ public String listEnergyBillingBulk(@ShellOption(defaultValue = "false") boolean
309310
@ShellOption(defaultValue = ShellOption.NULL) OffsetDateTime newestTime,
310311
@ShellOption(defaultValue = ShellOption.NULL) Integer page,
311312
@ShellOption(defaultValue = ShellOption.NULL) Integer pageSize,
312-
@ShellOption(defaultValue = "2") Integer version) throws Exception {
313+
@ShellOption(defaultValue = "3") Integer version) throws Exception {
313314

314315
LOGGER.info("Get Energy bulk billing CLI initiated with oldest-time: {}, newest-time: {}, page: {}, page-size: {}, version: {}",
315316
oldestTime, newestTime, page, pageSize, version);
316317

317318
api.setApiClient(clientFactory.create(true, check));
318-
ApiResult<EnergyBillingListResponse> result = api.listBillingBulk(oldestTime, newestTime, page, pageSize, version);
319-
ApiResponse<EnergyBillingListResponse> response = result.getResponse();
319+
ApiResult<EnergyBillingListResponse<EnergyBillingTransactionBase>> result = api.listBillingBulk(oldestTime, newestTime, page, pageSize, version);
320+
ApiResponse<EnergyBillingListResponse<EnergyBillingTransactionBase>> response = result.getResponse();
320321

321322
if (clientFactory.isValidationEnabled() || check) {
322323
LOGGER.info("Payload validation is enabled");
@@ -337,7 +338,7 @@ public String listBillingForEnergyAccounts(@ShellOption(defaultValue = "false")
337338
@ShellOption(defaultValue = ShellOption.NULL) Integer page,
338339
@ShellOption(defaultValue = ShellOption.NULL) Integer pageSize,
339340
@ShellOption(defaultValue = ShellOption.NULL) ParamIntervalReadsEnum intervalReads,
340-
@ShellOption(defaultValue = "2") Integer version) throws Exception {
341+
@ShellOption(defaultValue = "3") Integer version) throws Exception {
341342

342343
LOGGER.info("Get billing for specific Energy accounts CLI initiated with accountIds: {}, oldest-time: {}, newest-time: {}, page: {}, page-size: {}, interval-reads: {}, version: {}",
343344
accountIds, oldestTime, newestTime, page, pageSize, intervalReads, version);
@@ -347,8 +348,8 @@ public String listBillingForEnergyAccounts(@ShellOption(defaultValue = "false")
347348
RequestAccountIdsData data = new RequestAccountIdsData();
348349
data.setAccountIds(accountIds);
349350
requestAccountIds.setData(data);
350-
ApiResult<EnergyBillingListResponse> result = api.listBillingForAccounts(requestAccountIds, oldestTime, newestTime, page, pageSize, intervalReads, version);
351-
ApiResponse<EnergyBillingListResponse> response = result.getResponse();
351+
ApiResult<EnergyBillingListResponse<EnergyBillingTransactionBase>> result = api.listBillingForAccounts(requestAccountIds, oldestTime, newestTime, page, pageSize, intervalReads, version);
352+
ApiResponse<EnergyBillingListResponse<EnergyBillingTransactionBase>> response = result.getResponse();
352353

353354
if (clientFactory.isValidationEnabled() || check) {
354355
LOGGER.info("Payload validation is enabled");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
spring.freemarker.checkTemplateLocation=false
22
spring.main.allow-bean-definition-overriding=true
33
server.port=8686
4-
4+
spring.main.allow-circular-references=true

client/src/main/java/au/org/consumerdatastandards/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ApiClient(boolean validating) {
6565
json = new JSON(validating);
6666

6767
// Set default User-Agent.
68-
setUserAgent("CDS Client/2.3.0/java");
68+
setUserAgent("CDS Client/2.4.0/java");
6969

7070
addDefaultHeader("Accept", "application/json");
7171
addDefaultHeader("Content-Type", "application/json");

client/src/main/java/au/org/consumerdatastandards/client/api/CommonCustomerAPI.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
22
* Consumer Data Standards
33
* Sample client library to Demonstrate the Consumer Data Right APIs
4-
*
5-
* NOTE: This class is auto generated
64
*/
75
package au.org.consumerdatastandards.client.api;
86

@@ -72,7 +70,7 @@ private okhttp3.Call getCustomerValidateBeforeCall(final ApiCallback _callback)
7270

7371
/**
7472
* Get Customer
75-
* Obtain basic information on the customer that has authorised the current session
73+
* Obtain basic information on the customer that has authorised the current session\n\n<h3 id='cdr-common-api_get-customer_conventions'>Conventions</h3>\nIn the customer payloads relevant conventions are explained here, in one place.\n\n#### Given Names\n\n`firstName` represents the first of a person's given names.\n\n`middleNames` represents a collection of given names if the person has more than one given name.\n\nWhere a data holder holds a person's given names as a single string in source systems, it may not possible in some situations to reliably split these given names into their component first and middle names. In these situations, data holders MAY use the `firstName` field to return the single string of given names and an empty `middleNames` array.\n\nFor example, a person whose given names are \"John Paul Winston\" but the data holder cannot determine what is the first name, can return `\"firstName\": \"John Paul Winston\"`.
7674
* @return ResponseCommonCustomer
7775
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
7876
* http.response.details
@@ -88,8 +86,7 @@ private okhttp3.Call getCustomerValidateBeforeCall(final ApiCallback _callback)
8886
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> </td>
8987
* </tr>
9088
* </table>
91-
92-
*/
89+
*/
9390
public ResponseCommonCustomer getCustomer() throws ApiException {
9491

9592
LOGGER.trace("getCustomer");
@@ -100,7 +97,7 @@ public ResponseCommonCustomer getCustomer() throws ApiException {
10097

10198
/**
10299
* Get Customer
103-
* Obtain basic information on the customer that has authorised the current session
100+
* Obtain basic information on the customer that has authorised the current session\n\n<h3 id='cdr-common-api_get-customer_conventions'>Conventions</h3>\nIn the customer payloads relevant conventions are explained here, in one place.\n\n#### Given Names\n\n`firstName` represents the first of a person's given names.\n\n`middleNames` represents a collection of given names if the person has more than one given name.\n\nWhere a data holder holds a person's given names as a single string in source systems, it may not possible in some situations to reliably split these given names into their component first and middle names. In these situations, data holders MAY use the `firstName` field to return the single string of given names and an empty `middleNames` array.\n\nFor example, a person whose given names are \"John Paul Winston\" but the data holder cannot determine what is the first name, can return `\"firstName\": \"John Paul Winston\"`.
104101
* @return ApiResponse&lt;ResponseCommonCustomer&gt;
105102
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
106103
* http.response.details
@@ -116,8 +113,7 @@ public ResponseCommonCustomer getCustomer() throws ApiException {
116113
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> </td>
117114
* </tr>
118115
* </table>
119-
120-
*/
116+
*/
121117
public ApiResponse<ResponseCommonCustomer> getCustomerWithHttpInfo() throws ApiException {
122118
okhttp3.Call call = getCustomerValidateBeforeCall(null);
123119
Type returnType = new TypeToken<ResponseCommonCustomer>(){}.getType();
@@ -126,7 +122,7 @@ public ApiResponse<ResponseCommonCustomer> getCustomerWithHttpInfo() throws ApiE
126122

127123
/**
128124
* Get Customer (asynchronously)
129-
* Obtain basic information on the customer that has authorised the current session
125+
* Obtain basic information on the customer that has authorised the current session\n\n<h3 id='cdr-common-api_get-customer_conventions'>Conventions</h3>\nIn the customer payloads relevant conventions are explained here, in one place.\n\n#### Given Names\n\n`firstName` represents the first of a person's given names.\n\n`middleNames` represents a collection of given names if the person has more than one given name.\n\nWhere a data holder holds a person's given names as a single string in source systems, it may not possible in some situations to reliably split these given names into their component first and middle names. In these situations, data holders MAY use the `firstName` field to return the single string of given names and an empty `middleNames` array.\n\nFor example, a person whose given names are \"John Paul Winston\" but the data holder cannot determine what is the first name, can return `\"firstName\": \"John Paul Winston\"`.
130126
* @param _callback The callback to be executed when the API call finishes
131127
* @return The request call
132128
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -143,9 +139,7 @@ public ApiResponse<ResponseCommonCustomer> getCustomerWithHttpInfo() throws ApiE
143139
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> </td>
144140
* </tr>
145141
* </table>
146-
147-
148-
*/
142+
*/
149143
public okhttp3.Call getCustomerAsync(final ApiCallback<ResponseCommonCustomer> _callback) throws ApiException {
150144

151145
LOGGER.trace("Asynchronously getCustomer");
@@ -173,7 +167,7 @@ public okhttp3.Call getCustomerAsync(final ApiCallback<ResponseCommonCustomer> _
173167
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> * x-fapi-interaction-id - An [RFC4122](https://tools.ietf.org/html/rfc4122) UUID used as a correlation id. If provided, the data holder must play back this value in the x-fapi-interaction-id response header. If not provided a [RFC4122] UUID value is required to be provided in the response header to track the interaction. <br> </td>
174168
* </tr>
175169
* </table>
176-
*/
170+
*/
177171
public okhttp3.Call getCustomerDetailCall(final ApiCallback _callback) throws ApiException {
178172

179173
Object postBody = null;
@@ -217,7 +211,7 @@ private okhttp3.Call getCustomerDetailValidateBeforeCall(final ApiCallback _call
217211
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> * x-fapi-interaction-id - An [RFC4122](https://tools.ietf.org/html/rfc4122) UUID used as a correlation id. If provided, the data holder must play back this value in the x-fapi-interaction-id response header. If not provided a [RFC4122] UUID value is required to be provided in the response header to track the interaction. <br> </td>
218212
* </tr>
219213
* </table>
220-
*/
214+
*/
221215
public ResponseCommonCustomerDetail getCustomerDetail() throws ApiException {
222216

223217
LOGGER.trace("getCustomerDetail");
@@ -244,7 +238,7 @@ public ResponseCommonCustomerDetail getCustomerDetail() throws ApiException {
244238
* <td> * x-v - The [version](#response-headers) of the API end point that the data holder has responded with. <br> * x-fapi-interaction-id - An [RFC4122](https://tools.ietf.org/html/rfc4122) UUID used as a correlation id. If provided, the data holder must play back this value in the x-fapi-interaction-id response header. If not provided a [RFC4122] UUID value is required to be provided in the response header to track the interaction. <br> </td>
245239
* </tr>
246240
* </table>
247-
*/
241+
*/
248242
public ApiResponse<ResponseCommonCustomerDetail> getCustomerDetailWithHttpInfo() throws ApiException {
249243
okhttp3.Call call = getCustomerDetailValidateBeforeCall(null);
250244
Type returnType = new TypeToken<ResponseCommonCustomerDetail>(){}.getType();

client/src/main/java/au/org/consumerdatastandards/client/api/energy/EnergyAccountsAPI.java

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
import au.org.consumerdatastandards.client.model.energy.EnergyBalanceListResponse;
1616
import au.org.consumerdatastandards.client.model.energy.EnergyBalanceResponse;
1717
import au.org.consumerdatastandards.client.model.energy.EnergyBillingListResponse;
18+
import au.org.consumerdatastandards.client.model.energy.EnergyBillingTransactionBase;
19+
import au.org.consumerdatastandards.client.model.energy.EnergyBillingTransactionV2;
20+
import au.org.consumerdatastandards.client.model.energy.EnergyBillingTransactionV3;
1821
import au.org.consumerdatastandards.client.model.energy.EnergyConcessionsResponse;
1922
import au.org.consumerdatastandards.client.model.energy.EnergyInvoiceListResponse;
2023
import au.org.consumerdatastandards.client.model.energy.EnergyPaymentScheduleResponse;
@@ -299,7 +302,7 @@ public ApiResult<EnergyInvoiceListResponse> listInvoicesForAccounts(RequestAccou
299302
return new ApiResult<>(call.request().url().toString(), apiClient.execute(call, returnType));
300303
}
301304

302-
public ApiResult<EnergyBillingListResponse> getBillingForAccount(String accountId,
305+
public <T extends EnergyBillingTransactionBase> ApiResult<EnergyBillingListResponse<T>> getBillingForAccount(String accountId,
303306
OffsetDateTime oldestTime, OffsetDateTime newestTime, Integer page, Integer pageSize, Integer version) throws ApiException {
304307

305308
if (accountId == null) {
@@ -327,12 +330,22 @@ public ApiResult<EnergyBillingListResponse> getBillingForAccount(String accountI
327330
addCdsProtectedApiHeaders(headerParams);
328331
String[] authNames = new String[] { };
329332
Call call = apiClient.buildCall(path, METHOD_GET, queryParams, null, null, headerParams, authNames, null);
330-
Type returnType = new TypeToken<EnergyBillingListResponse>(){}.getType();
333+
334+
Type returnType;
335+
336+
switch (version) {
337+
case 1:
338+
case 2:
339+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV2>>(){}.getType();
340+
break;
341+
default:
342+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV3>>(){}.getType();
343+
}
331344

332345
return new ApiResult<>(call.request().url().toString(), apiClient.execute(call, returnType));
333346
}
334347

335-
public ApiResult<EnergyBillingListResponse> listBillingBulk(
348+
public ApiResult<EnergyBillingListResponse<EnergyBillingTransactionBase>> listBillingBulk(
336349
OffsetDateTime oldestTime, OffsetDateTime newestTime, Integer page, Integer pageSize, Integer version) throws ApiException {
337350

338351
String path = "/energy/accounts/billing";
@@ -355,12 +368,22 @@ public ApiResult<EnergyBillingListResponse> listBillingBulk(
355368
addCdsProtectedApiHeaders(headerParams);
356369
String[] authNames = new String[] { };
357370
Call call = apiClient.buildCall(path, METHOD_GET, queryParams, null, null, headerParams, authNames, null);
358-
Type returnType = new TypeToken<EnergyBillingListResponse>(){}.getType();
371+
372+
Type returnType;
373+
374+
switch (version) {
375+
case 1:
376+
case 2:
377+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV2>>(){}.getType();
378+
break;
379+
default:
380+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV3>>(){}.getType();
381+
}
359382

360383
return new ApiResult<>(call.request().url().toString(), apiClient.execute(call, returnType));
361384
}
362385

363-
public ApiResult<EnergyBillingListResponse> listBillingForAccounts(RequestAccountIds accountIds,
386+
public ApiResult<EnergyBillingListResponse<EnergyBillingTransactionBase>> listBillingForAccounts(RequestAccountIds accountIds,
364387
OffsetDateTime oldestTime, OffsetDateTime newestTime, Integer page, Integer pageSize,
365388
ParamIntervalReadsEnum intervalReads, Integer version) throws ApiException {
366389

@@ -387,7 +410,17 @@ public ApiResult<EnergyBillingListResponse> listBillingForAccounts(RequestAccoun
387410
addCdsProtectedApiHeaders(headerParams);
388411
String[] authNames = new String[] { };
389412
Call call = apiClient.buildCall(path, METHOD_POST, queryParams, null, accountIds, headerParams, authNames, null);
390-
Type returnType = new TypeToken<EnergyBillingListResponse>(){}.getType();
413+
414+
Type returnType;
415+
416+
switch (version) {
417+
case 1:
418+
case 2:
419+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV2>>(){}.getType();
420+
break;
421+
default:
422+
returnType = new TypeToken<EnergyBillingListResponse<EnergyBillingTransactionV3>>(){}.getType();
423+
}
391424

392425
return new ApiResult<>(call.request().url().toString(), apiClient.execute(call, returnType));
393426
}

0 commit comments

Comments
 (0)