com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sellingpartnerapi-aa-java Show documentation
Show all versions of sellingpartnerapi-aa-java Show documentation
A build of Amazon sellingpartnerapi-aa-java client
The newest version!
package com.amazon.SellingPartnerAPIAA;
import lombok.Builder;
import lombok.Data;
import lombok.NonNull;
import java.util.Arrays;
import java.util.HashSet;
/**
* LWAAuthorizationCredentials
*/
@Data
@Builder
public class LWAAuthorizationCredentials {
/**
* LWA Client Id
*/
@NonNull
private String clientId;
/**
* LWA Client Secret
*/
@NonNull
private String clientSecret;
/**
* LWA Refresh Token
*/
private String refreshToken;
/**
* LWA Authorization Server Endpoint
*/
@NonNull
private String endpoint;
/**
* LWA Client Scopes
*/
private LWAClientScopes scopes;
public static class LWAAuthorizationCredentialsBuilder {
{
scopes = new LWAClientScopes(new HashSet<>());
}
public LWAAuthorizationCredentialsBuilder withScope(String scope) {
return withScopes(scope);
}
public LWAAuthorizationCredentialsBuilder withScopes(String... scopes) {
if (scopes != null) {
Arrays.stream(scopes)
.forEach(this.scopes::addScope);
}
return this;
}
}
}