Skip to content

Commit

Permalink
Merge pull request #12 from square/release/5.2.2.20200422
Browse files Browse the repository at this point in the history
5.2.2.20200422 release
  • Loading branch information
lindzeng authored Apr 25, 2020
2 parents 2086973 + 71c8787 commit 8c0ac78
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 45 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<version>5.2.1.20200422</version>
<version>5.2.2.20200422</version>
<packaging>jar</packaging>

<name>Square</name>
Expand Down Expand Up @@ -214,4 +214,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
4 changes: 2 additions & 2 deletions src/main/java/com/squareup/square/SquareClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public Headers getAdditionalHeaders() {
* @return sdkVersion
*/
public String getSdkVersion() {
return "5.2.1.20200422";
return "5.2.2.20200422";
}

/**
Expand Down Expand Up @@ -586,4 +586,4 @@ public SquareClient build() {
authManagers, httpCallback);
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/squareup/square/api/BaseApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class BaseApi {
* Protected variables to hold an instance of Configuration
*/
protected final Configuration config;
protected static final String userAgent = "Square-Java-SDK/5.2.1.20200422";
protected static final String userAgent = "Square-Java-SDK/5.2.2.20200422";

/**
* Protected variable to hold an instance of HttpCallback if the user provides it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,4 @@ private UpdateCustomerGroupResponse handleUpdateCustomerGroupResponse(HttpContex
return result;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ private RetrieveCustomerSegmentResponse handleRetrieveCustomerSegmentResponse(Ht
return result;
}

}
}
2 changes: 1 addition & 1 deletion src/main/java/com/squareup/square/api/CustomersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1045,4 +1045,4 @@ private AddGroupToCustomerResponse handleAddGroupToCustomerResponse(HttpContext
return result;
}

}
}
42 changes: 5 additions & 37 deletions src/main/java/com/squareup/square/models/ObtainTokenRequest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.squareup.square.models;

import java.util.List;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -21,7 +20,6 @@ public class ObtainTokenRequest {
* @param redirectUri
* @param refreshToken
* @param migrationToken
* @param scopes
*/
@JsonCreator
public ObtainTokenRequest(
Expand All @@ -31,16 +29,14 @@ public ObtainTokenRequest(
@JsonProperty("code") String code,
@JsonProperty("redirect_uri") String redirectUri,
@JsonProperty("refresh_token") String refreshToken,
@JsonProperty("migration_token") String migrationToken,
@JsonProperty("scopes") List<String> scopes) {
@JsonProperty("migration_token") String migrationToken) {
this.clientId = clientId;
this.clientSecret = clientSecret;
this.code = code;
this.redirectUri = redirectUri;
this.grantType = grantType;
this.refreshToken = refreshToken;
this.migrationToken = migrationToken;
this.scopes = scopes;
}

private final String clientId;
Expand All @@ -50,7 +46,6 @@ public ObtainTokenRequest(
private final String grantType;
private final String refreshToken;
private final String migrationToken;
private final List<String> scopes;
/**
* Getter for ClientId.
* The Square-issued ID of your application, available from the
Expand Down Expand Up @@ -125,25 +120,11 @@ public String getMigrationToken() {
return this.migrationToken;
}

/**
* Getter for Scopes.
* __OPTIONAL__
* A JSON list of strings that are the permissions the application is requesting.
* For example: "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`"
* The access token returned in the response will be granted the permissions
* that comprise the intersection between the given list of permissions, and those
* that belong to the provided refresh token.
*/
@JsonGetter("scopes")
public List<String> getScopes() {
return this.scopes;
}


@Override
public int hashCode() {
return Objects.hash(clientId, clientSecret, code, redirectUri, grantType, refreshToken,
migrationToken, scopes);
migrationToken);
}

@Override
Expand All @@ -161,8 +142,7 @@ public boolean equals(Object obj) {
Objects.equals(redirectUri, obtainTokenRequest.redirectUri) &&
Objects.equals(grantType, obtainTokenRequest.grantType) &&
Objects.equals(refreshToken, obtainTokenRequest.refreshToken) &&
Objects.equals(migrationToken, obtainTokenRequest.migrationToken) &&
Objects.equals(scopes, obtainTokenRequest.scopes);
Objects.equals(migrationToken, obtainTokenRequest.migrationToken);
}

/**
Expand All @@ -177,8 +157,7 @@ public Builder toBuilder() {
.code(getCode())
.redirectUri(getRedirectUri())
.refreshToken(getRefreshToken())
.migrationToken(getMigrationToken())
.scopes(getScopes());
.migrationToken(getMigrationToken());
return builder;
}

Expand All @@ -193,7 +172,6 @@ public static class Builder {
private String redirectUri;
private String refreshToken;
private String migrationToken;
private List<String> scopes;

/**
* Initialization constructor
Expand Down Expand Up @@ -269,15 +247,6 @@ public Builder migrationToken(String migrationToken) {
this.migrationToken = migrationToken;
return this;
}
/**
* Setter for scopes
* @param scopes
* @return Builder
*/
public Builder scopes(List<String> scopes) {
this.scopes = scopes;
return this;
}

/**
* Builds a new {@link ObtainTokenRequest} object using the set fields.
Expand All @@ -290,8 +259,7 @@ public ObtainTokenRequest build() {
code,
redirectUri,
refreshToken,
migrationToken,
scopes);
migrationToken);
}
}
}

0 comments on commit 8c0ac78

Please sign in to comment.