【发布时间】:2021-07-19 12:44:39
【问题描述】:
我已按照所有步骤生成 SDK 和 .jar 文件。 .我已将外部 jar 包含到我的项目中,并逐步浏览了文档“[使用生成的 Java SDK https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md#connecting-to-the-selling-partner-api-using-a-generated-java-sdk 连接到销售伙伴 API
第 1 步:
AWSAuthenticationCredentials awsAuthenticationCredentials=AWSAuthenticationCredentials.builder()
.accessKeyId("myAccessKeyId")
.secretKey("mySecretId")
.region("us-east-1")
.build();
第 2 步:
AWSAuthenticationCredentialsProvider awsAuthenticationCredentialsProvider=AWSAuthenticationCredentialsProvider.builder()
.roleArn("myroleARN")
.roleSessionName("myrolesessioname")
.build();
第 3 步:
LWAAuthorizationCredentials lwaAuthorizationCredentials = LWAAuthorizationCredentials.builder()
.clientId("myClientId")
.clientSecret("myClientSecret")
.refreshToken("Aztr|...")
.endpoint("https://api.amazon.com/auth/o2/token")
.build();
第 4 步:
SellersApi sellersApi = new SellersApi.Builder()
.awsAuthenticationCredentials(awsAuthenticationCredentials)
.lwaAuthorizationCredentials(lwaAuthorizationCredentials)
.awsAuthenticationCredentialsProvider(awsAuthenticationCredentialsProvider)
.endpoint("https://sellingpartnerapi-na.amazon.com")
.build();
问题出现在第 4 步。SellersAPI 类没有方法 Builder,因此 SellersApi.Builder() 无法解决。
【问题讨论】:
标签: java amazon-web-services sdk amazonsellercentral