Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Optional parameters for authorization request added #109

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 12 additions & 0 deletions src/main/java/com/coinbase/api/CoinbaseImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,18 @@ public URI getAuthorizationUri(OAuthCodeRequest params) throws CoinbaseException
throw new CoinbaseException("scope is required");
}

if (params.getAccount() != null) {
uriBuilder.addParameter("account", params.getAccount().toString());
}

if (params.getReferral() != null) {
uriBuilder.addParameter("referral", params.getReferral());
}

if (params.getLayout() != null) {
uriBuilder.addParameter("layout", params.getLayout());
}

if (params.getMeta() != null) {
OAuthCodeRequest.Meta meta = params.getMeta();

Expand Down
44 changes: 44 additions & 0 deletions src/main/java/com/coinbase/api/entity/OAuthCodeRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,33 @@ public String getSendLimitCurrency() {
}
}

public enum Account {
SELECT("select"),
ALL("all");

private String _value;

Account(String value) {
this._value = value;
}

@Override
@JsonValue
public String toString() {
return this._value;
}
}

private String clientId;
private String clientSecret;
private String username;
private String password;
private String token;
private String scope;
private String redirectUri;
private Account account;
private String referral;
private String layout;

public String getRedirectUri() {
return redirectUri;
Expand Down Expand Up @@ -151,4 +171,28 @@ public String getClientSecret() {
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}

public Account getAccount() {
return account;
}

public void setAccount(Account account) {
this.account = account;
}

public String getReferral() {
return referral;
}

public void setReferral(String referral) {
this.referral = referral;
}

public String getLayout() {
return layout;
}

public void setLayout(String layout) {
this.layout = layout;
}
}