Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit bdab990

Browse files
authored
Release 2.20190814.2 (#80)
1 parent 3e53205 commit bdab990

File tree

8 files changed

+50
-13
lines changed

8 files changed

+50
-13
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ git_push.sh
2020
build.sbt
2121
AndroidManifest.xml
2222

23-
travis-ci/accounts.json
23+
travis-ci/accounts.json
24+
.vscode

Diff for: CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Version 2.20190814.2 (2019-08-23)
4+
5+
* **Bug fix**: Fixed path parameters for `UpdateOrder`
6+
37
## Version 2.20190814.1 (2018-08-16)
48

59
* **Bug fix**: Removed a currently unsupported API object type

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Add this dependency to your project's POM:
2626
<dependency>
2727
<groupId>com.squareup</groupId>
2828
<artifactId>connect</artifactId>
29-
<version>2.20190814.1</version>
29+
<version>2.20190814.2</version>
3030
<scope>compile</scope>
3131
</dependency>
3232
```
@@ -36,7 +36,7 @@ Add this dependency to your project's POM:
3636
Add this dependency to your project's build file:
3737

3838
```groovy
39-
compile "com.squareup:connect:2.20190814.1"
39+
compile "com.squareup:connect:2.20190814.2"
4040
```
4141

4242
### Option 3: Build and Install locally
@@ -78,7 +78,7 @@ At first generate the JAR by executing:
7878

7979
Then manually install the following JARs:
8080

81-
* target/connect-2.20190814.1.jar
81+
* target/connect-2.20190814.2.jar
8282
* target/lib/*.jar
8383

8484
## Getting Started

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.squareup'
5-
version = '2.20190814.1'
5+
version = '2.20190814.2'
66

77
buildscript {
88
repositories {

Diff for: docs/OrdersApi.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Name | Type | Description | Notes
231231

232232
<a name="updateOrder"></a>
233233
# **updateOrder**
234-
> UpdateOrderResponse updateOrder(body)
234+
> UpdateOrderResponse updateOrder(locationId, orderId, body)
235235
236236
UpdateOrder
237237

@@ -253,9 +253,11 @@ OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
253253
oauth2.setAccessToken("YOUR ACCESS TOKEN");
254254

255255
OrdersApi apiInstance = new OrdersApi();
256+
String locationId = "locationId_example"; // String | The ID of the order's associated location.
257+
String orderId = "orderId_example"; // String | The ID of the order to update.
256258
UpdateOrderRequest body = new UpdateOrderRequest(); // UpdateOrderRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
257259
try {
258-
UpdateOrderResponse result = apiInstance.updateOrder(body);
260+
UpdateOrderResponse result = apiInstance.updateOrder(locationId, orderId, body);
259261
System.out.println(result);
260262
} catch (ApiException e) {
261263
System.err.println("Exception when calling OrdersApi#updateOrder");
@@ -267,6 +269,8 @@ try {
267269

268270
Name | Type | Description | Notes
269271
------------- | ------------- | ------------- | -------------
272+
**locationId** | **String**| The ID of the order&#39;s associated location. |
273+
**orderId** | **String**| The ID of the order to update. |
270274
**body** | [**UpdateOrderRequest**](UpdateOrderRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
271275

272276
### Return type

Diff for: pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>connect</artifactId>
66
<packaging>jar</packaging>
77
<name>connect</name>
8-
<version>2.20190814.1</version>
8+
<version>2.20190814.2</version>
99
<url>https://github.com/square/connect-java-sdk/</url>
1010
<description>Java client library for the Square Connect API</description>
1111
<scm>

Diff for: src/main/java/com/squareup/connect/ApiClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ApiClient() {
7373
this.dateFormat = new RFC3339DateFormat();
7474

7575
// Set default User-Agent.
76-
setUserAgent("Square-Connect-Java/2.20190814.1");
76+
setUserAgent("Square-Connect-Java/2.20190814.2");
7777

7878
// Setup authentications (key: authentication name, value: authentication).
7979
authentications = new HashMap<String, Authentication>();

Diff for: src/main/java/com/squareup/connect/api/OrdersApi.java

+32-4
Original file line numberDiff line numberDiff line change
@@ -421,19 +421,33 @@ public void setApiClient(ApiClient apiClient) {
421421
/**
422422
* UpdateOrder
423423
* Updates an open [Order](#type-order) by adding, replacing, or deleting fields. Orders with a &#x60;COMPLETED&#x60; or &#x60;CANCELED&#x60; state cannot be updated. An UpdateOrder request requires the following: - The &#x60;order_id&#x60; in the endpoint path, identifying the order to update. - The latest &#x60;version&#x60; of the order to update. - The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to. - If deleting fields, the [dot notation paths](/orders-api/manage-orders#on-dot-notation) identifying fields to clear. To pay for an order, please refer to the [Pay for Orders](/orders-api/pay-for-orders) guide. To learn more about the Orders API, see the [Orders API Overview](/orders-api/what-it-does).
424+
* @param locationId The ID of the order&#39;s associated location. (required)
425+
* @param orderId The ID of the order to update. (required)
424426
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
425427
* @return UpdateOrderResponse
426428
* @throws ApiException if fails to make API call
427-
*/ public UpdateOrderResponse updateOrder(UpdateOrderRequest body) throws ApiException {
429+
*/ public UpdateOrderResponse updateOrder(String locationId, String orderId, UpdateOrderRequest body) throws ApiException {
428430
Object localVarPostBody = body;
429431

432+
// verify the required parameter 'locationId' is set
433+
if (locationId == null) {
434+
throw new ApiException(400, "Missing the required parameter 'locationId' when calling updateOrder");
435+
}
436+
437+
// verify the required parameter 'orderId' is set
438+
if (orderId == null) {
439+
throw new ApiException(400, "Missing the required parameter 'orderId' when calling updateOrder");
440+
}
441+
430442
// verify the required parameter 'body' is set
431443
if (body == null) {
432444
throw new ApiException(400, "Missing the required parameter 'body' when calling updateOrder");
433445
}
434446

435447
// create path and map variables
436-
String localVarPath = "/v2/locations/{location_id}/orders/{order_id}";
448+
String localVarPath = "/v2/locations/{location_id}/orders/{order_id}"
449+
.replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
450+
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
437451

438452
// query params
439453
List<Pair> localVarQueryParams = new ArrayList<Pair>();
@@ -463,20 +477,34 @@ public void setApiClient(ApiClient apiClient) {
463477
/**
464478
* UpdateOrder
465479
* Updates an open [Order](#type-order) by adding, replacing, or deleting fields. Orders with a &#x60;COMPLETED&#x60; or &#x60;CANCELED&#x60; state cannot be updated. An UpdateOrder request requires the following: - The &#x60;order_id&#x60; in the endpoint path, identifying the order to update. - The latest &#x60;version&#x60; of the order to update. - The [sparse order](/orders-api/manage-orders#sparse-order-objects) containing only the fields to update and the version the update is being applied to. - If deleting fields, the [dot notation paths](/orders-api/manage-orders#on-dot-notation) identifying fields to clear. To pay for an order, please refer to the [Pay for Orders](/orders-api/pay-for-orders) guide. To learn more about the Orders API, see the [Orders API Overview](/orders-api/what-it-does).
480+
* @param locationId The ID of the order&#39;s associated location. (required)
481+
* @param orderId The ID of the order to update. (required)
466482
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
467483
* @return CompleteResponse<UpdateOrderResponse>
468484
* @throws ApiException if fails to make API call
469485
*/
470-
public CompleteResponse<UpdateOrderResponse>updateOrderWithHttpInfo(UpdateOrderRequest body) throws ApiException {
486+
public CompleteResponse<UpdateOrderResponse>updateOrderWithHttpInfo(String locationId, String orderId, UpdateOrderRequest body) throws ApiException {
471487
Object localVarPostBody = body;
472488

489+
// verify the required parameter 'locationId' is set
490+
if (locationId == null) {
491+
throw new ApiException(400, "Missing the required parameter 'locationId' when calling updateOrder");
492+
}
493+
494+
// verify the required parameter 'orderId' is set
495+
if (orderId == null) {
496+
throw new ApiException(400, "Missing the required parameter 'orderId' when calling updateOrder");
497+
}
498+
473499
// verify the required parameter 'body' is set
474500
if (body == null) {
475501
throw new ApiException(400, "Missing the required parameter 'body' when calling updateOrder");
476502
}
477503

478504
// create path and map variables
479-
String localVarPath = "/v2/locations/{location_id}/orders/{order_id}";
505+
String localVarPath = "/v2/locations/{location_id}/orders/{order_id}"
506+
.replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
507+
.replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
480508

481509
// query params
482510
List<Pair> localVarQueryParams = new ArrayList<Pair>();

0 commit comments

Comments
 (0)