Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ git_push.sh
build.sbt
AndroidManifest.xml

travis-ci/accounts.json
travis-ci/accounts.json
.vscode
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Version 2.20190814.2 (2019-08-23)

* **Bug fix**: Fixed path parameters for `UpdateOrder`

## Version 2.20190814.1 (2018-08-16)

* **Bug fix**: Removed a currently unsupported API object type
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.squareup</groupId>
<artifactId>connect</artifactId>
<version>2.20190814.1</version>
<version>2.20190814.2</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -36,7 +36,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.squareup:connect:2.20190814.1"
compile "com.squareup:connect:2.20190814.2"
```

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

Then manually install the following JARs:

* target/connect-2.20190814.1.jar
* target/connect-2.20190814.2.jar
* target/lib/*.jar

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.squareup'
version = '2.20190814.1'
version = '2.20190814.2'

buildscript {
repositories {
Expand Down
8 changes: 6 additions & 2 deletions docs/OrdersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Name | Type | Description | Notes

<a name="updateOrder"></a>
# **updateOrder**
> UpdateOrderResponse updateOrder(body)
> UpdateOrderResponse updateOrder(locationId, orderId, body)

UpdateOrder

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

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

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

### Return type
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>connect</artifactId>
<packaging>jar</packaging>
<name>connect</name>
<version>2.20190814.1</version>
<version>2.20190814.2</version>
<url>https://github.com/square/connect-java-sdk/</url>
<description>Java client library for the Square Connect API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/squareup/connect/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ApiClient() {
this.dateFormat = new RFC3339DateFormat();

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

// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
Expand Down
36 changes: 32 additions & 4 deletions src/main/java/com/squareup/connect/api/OrdersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,19 +421,33 @@ public void setApiClient(ApiClient apiClient) {
/**
* UpdateOrder
* 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).
* @param locationId The ID of the order&#39;s associated location. (required)
* @param orderId The ID of the order to update. (required)
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
* @return UpdateOrderResponse
* @throws ApiException if fails to make API call
*/ public UpdateOrderResponse updateOrder(UpdateOrderRequest body) throws ApiException {
*/ public UpdateOrderResponse updateOrder(String locationId, String orderId, UpdateOrderRequest body) throws ApiException {
Object localVarPostBody = body;

// verify the required parameter 'locationId' is set
if (locationId == null) {
throw new ApiException(400, "Missing the required parameter 'locationId' when calling updateOrder");
}

// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling updateOrder");
}

// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updateOrder");
}

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

// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Expand Down Expand Up @@ -463,20 +477,34 @@ public void setApiClient(ApiClient apiClient) {
/**
* UpdateOrder
* 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).
* @param locationId The ID of the order&#39;s associated location. (required)
* @param orderId The ID of the order to update. (required)
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
* @return CompleteResponse<UpdateOrderResponse>
* @throws ApiException if fails to make API call
*/
public CompleteResponse<UpdateOrderResponse>updateOrderWithHttpInfo(UpdateOrderRequest body) throws ApiException {
public CompleteResponse<UpdateOrderResponse>updateOrderWithHttpInfo(String locationId, String orderId, UpdateOrderRequest body) throws ApiException {
Object localVarPostBody = body;

// verify the required parameter 'locationId' is set
if (locationId == null) {
throw new ApiException(400, "Missing the required parameter 'locationId' when calling updateOrder");
}

// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException(400, "Missing the required parameter 'orderId' when calling updateOrder");
}

// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updateOrder");
}

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

// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Expand Down