├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cdk ├── .gitignore ├── .npmignore ├── README.md ├── bin │ └── cdk.ts ├── cdk.json ├── jest.config.js ├── lib │ ├── cdk-stack.ts │ ├── commonParameter.ts │ ├── finances-stack.ts │ └── order-stack.ts ├── package-lock.json ├── package.json ├── test │ └── cdk.test.ts └── tsconfig.json ├── doc └── credentials.png └── lambda ├── .gitignore ├── README.cn.md ├── build.gradle └── src ├── main ├── java │ └── cn │ │ └── amazon │ │ └── aws │ │ └── rp │ │ └── spapi │ │ ├── aa │ │ ├── AWSAuthenticationCredentials.java │ │ ├── AWSAuthenticationCredentialsProvider.java │ │ ├── AWSSigV4Signer.java │ │ ├── LWAAccessTokenCache.java │ │ ├── LWAAccessTokenCacheImpl.java │ │ ├── LWAAccessTokenCacheItem.java │ │ ├── LWAAccessTokenRequestMeta.java │ │ ├── LWAAuthorizationCredentials.java │ │ ├── LWAAuthorizationSigner.java │ │ ├── LWAClient.java │ │ ├── LWAClientScopes.java │ │ ├── LWAClientScopesSerializerDeserializer.java │ │ ├── ScopeConstants.java │ │ └── SignableRequestImpl.java │ │ ├── clients │ │ ├── ApiCallback.java │ │ ├── ApiClient.java │ │ ├── ApiException.java │ │ ├── ApiResponse.java │ │ ├── Configuration.java │ │ ├── GzipRequestInterceptor.java │ │ ├── JSON.java │ │ ├── Pair.java │ │ ├── ProgressRequestBody.java │ │ ├── ProgressResponseBody.java │ │ ├── StringUtil.java │ │ ├── api │ │ │ ├── CatalogApi.java │ │ │ ├── FinancesApi.java │ │ │ ├── NotificationsApi.java │ │ │ ├── OrdersApi.java │ │ │ ├── ReportsApi.java │ │ │ ├── SPAPIBuilder.java │ │ │ └── SellersApi.java │ │ ├── auth │ │ │ ├── ApiKeyAuth.java │ │ │ ├── Authentication.java │ │ │ ├── HttpBasicAuth.java │ │ │ ├── OAuth.java │ │ │ └── OAuthFlow.java │ │ └── model │ │ │ ├── ASINIdentifier.java │ │ │ ├── Address.java │ │ │ ├── AdjustmentEvent.java │ │ │ ├── AdjustmentEventList.java │ │ │ ├── AdjustmentItem.java │ │ │ ├── AdjustmentItemList.java │ │ │ ├── AffordabilityExpenseEvent.java │ │ │ ├── AffordabilityExpenseEventList.java │ │ │ ├── AttributeSetList.java │ │ │ ├── AttributeSetListType.java │ │ │ ├── BuyerCustomizedInfoDetail.java │ │ │ ├── BuyerTaxInfo.java │ │ │ ├── CancelReportResponse.java │ │ │ ├── CancelReportScheduleResponse.java │ │ │ ├── Categories.java │ │ │ ├── ChargeComponent.java │ │ │ ├── ChargeComponentList.java │ │ │ ├── ChargeInstrument.java │ │ │ ├── ChargeInstrumentList.java │ │ │ ├── CouponPaymentEvent.java │ │ │ ├── CouponPaymentEventList.java │ │ │ ├── CreateDestinationRequest.java │ │ │ ├── CreateDestinationResponse.java │ │ │ ├── CreateReportResponse.java │ │ │ ├── CreateReportResult.java │ │ │ ├── CreateReportScheduleResponse.java │ │ │ ├── CreateReportScheduleResult.java │ │ │ ├── CreateReportScheduleSpecification.java │ │ │ ├── CreateReportSpecification.java │ │ │ ├── CreateSubscriptionRequest.java │ │ │ ├── CreateSubscriptionResponse.java │ │ │ ├── CreatorType.java │ │ │ ├── Currency.java │ │ │ ├── DebtRecoveryEvent.java │ │ │ ├── DebtRecoveryEventList.java │ │ │ ├── DebtRecoveryItem.java │ │ │ ├── DebtRecoveryItemList.java │ │ │ ├── DecimalWithUnits.java │ │ │ ├── DeleteDestinationResponse.java │ │ │ ├── DeleteSubscriptionByIdResponse.java │ │ │ ├── Destination.java │ │ │ ├── DestinationList.java │ │ │ ├── DestinationResource.java │ │ │ ├── DestinationResourceSpecification.java │ │ │ ├── DimensionType.java │ │ │ ├── DirectPayment.java │ │ │ ├── DirectPaymentList.java │ │ │ ├── Error.java │ │ │ ├── ErrorList.java │ │ │ ├── EventBridgeResource.java │ │ │ ├── EventBridgeResourceSpecification.java │ │ │ ├── FBALiquidationEvent.java │ │ │ ├── FBALiquidationEventList.java │ │ │ ├── FeeComponent.java │ │ │ ├── FeeComponentList.java │ │ │ ├── FinancialEventGroup.java │ │ │ ├── FinancialEventGroupList.java │ │ │ ├── FinancialEvents.java │ │ │ ├── FulfillmentInstruction.java │ │ │ ├── GetCatalogItemResponse.java │ │ │ ├── GetDestinationResponse.java │ │ │ ├── GetDestinationsResponse.java │ │ │ ├── GetMarketplaceParticipationsResponse.java │ │ │ ├── GetOrderAddressResponse.java │ │ │ ├── GetOrderBuyerInfoResponse.java │ │ │ ├── GetOrderItemsBuyerInfoResponse.java │ │ │ ├── GetOrderItemsResponse.java │ │ │ ├── GetOrderResponse.java │ │ │ ├── GetOrdersResponse.java │ │ │ ├── GetReportDocumentResponse.java │ │ │ ├── GetReportResponse.java │ │ │ ├── GetReportScheduleResponse.java │ │ │ ├── GetReportSchedulesResponse.java │ │ │ ├── GetReportsResponse.java │ │ │ ├── GetSubscriptionByIdResponse.java │ │ │ ├── GetSubscriptionResponse.java │ │ │ ├── IdentifierType.java │ │ │ ├── Image.java │ │ │ ├── ImagingServicesFeeEvent.java │ │ │ ├── ImagingServicesFeeEventList.java │ │ │ ├── Item.java │ │ │ ├── ItemList.java │ │ │ ├── LanguageType.java │ │ │ ├── ListCatalogCategoriesResponse.java │ │ │ ├── ListCatalogItemsResponse.java │ │ │ ├── ListFinancialEventGroupsPayload.java │ │ │ ├── ListFinancialEventGroupsResponse.java │ │ │ ├── ListFinancialEventsPayload.java │ │ │ ├── ListFinancialEventsResponse.java │ │ │ ├── ListMatchingItemsResponse.java │ │ │ ├── ListOfCategories.java │ │ │ ├── LoanServicingEvent.java │ │ │ ├── LoanServicingEventList.java │ │ │ ├── Marketplace.java │ │ │ ├── MarketplaceParticipation.java │ │ │ ├── MarketplaceParticipationList.java │ │ │ ├── Money.java │ │ │ ├── NetworkComminglingTransactionEvent.java │ │ │ ├── NetworkComminglingTransactionEventList.java │ │ │ ├── NumberOfOfferListingsList.java │ │ │ ├── OfferListingCountType.java │ │ │ ├── Order.java │ │ │ ├── OrderAddress.java │ │ │ ├── OrderBuyerInfo.java │ │ │ ├── OrderItem.java │ │ │ ├── OrderItemBuyerInfo.java │ │ │ ├── OrderItemBuyerInfoList.java │ │ │ ├── OrderItemList.java │ │ │ ├── OrderItemsBuyerInfoList.java │ │ │ ├── OrderItemsList.java │ │ │ ├── OrderList.java │ │ │ ├── OrdersList.java │ │ │ ├── Participation.java │ │ │ ├── PayWithAmazonEvent.java │ │ │ ├── PayWithAmazonEventList.java │ │ │ ├── PaymentExecutionDetailItem.java │ │ │ ├── PaymentExecutionDetailItemList.java │ │ │ ├── PaymentMethodDetailItemList.java │ │ │ ├── PointsGrantedDetail.java │ │ │ ├── Price.java │ │ │ ├── ProductAdsPaymentEvent.java │ │ │ ├── ProductAdsPaymentEventList.java │ │ │ ├── ProductInfoDetail.java │ │ │ ├── Promotion.java │ │ │ ├── PromotionIdList.java │ │ │ ├── PromotionList.java │ │ │ ├── QualifiersType.java │ │ │ ├── RelationshipList.java │ │ │ ├── RelationshipType.java │ │ │ ├── RemovalShipmentEvent.java │ │ │ ├── RemovalShipmentEventList.java │ │ │ ├── RemovalShipmentItem.java │ │ │ ├── RemovalShipmentItemList.java │ │ │ ├── RentalTransactionEvent.java │ │ │ ├── RentalTransactionEventList.java │ │ │ ├── Report.java │ │ │ ├── ReportDocument.java │ │ │ ├── ReportDocumentEncryptionDetails.java │ │ │ ├── ReportList.java │ │ │ ├── ReportOptions.java │ │ │ ├── ReportSchedule.java │ │ │ ├── ReportScheduleList.java │ │ │ ├── RetrochargeEvent.java │ │ │ ├── RetrochargeEventList.java │ │ │ ├── SAFETReimbursementEvent.java │ │ │ ├── SAFETReimbursementEventList.java │ │ │ ├── SAFETReimbursementItem.java │ │ │ ├── SAFETReimbursementItemList.java │ │ │ ├── SalesRankList.java │ │ │ ├── SalesRankType.java │ │ │ ├── SellerDealPaymentEvent.java │ │ │ ├── SellerDealPaymentEventList.java │ │ │ ├── SellerReviewEnrollmentPaymentEvent.java │ │ │ ├── SellerReviewEnrollmentPaymentEventList.java │ │ │ ├── SellerSKUIdentifier.java │ │ │ ├── ServiceFeeEvent.java │ │ │ ├── ServiceFeeEventList.java │ │ │ ├── ShipmentEvent.java │ │ │ ├── ShipmentEventList.java │ │ │ ├── ShipmentItem.java │ │ │ ├── ShipmentItemList.java │ │ │ ├── ShippingTimeType.java │ │ │ ├── SolutionProviderCreditEvent.java │ │ │ ├── SolutionProviderCreditEventList.java │ │ │ ├── SqsResource.java │ │ │ ├── Subscription.java │ │ │ ├── TDSReimbursementEvent.java │ │ │ ├── TDSReimbursementEventList.java │ │ │ ├── TaxClassification.java │ │ │ ├── TaxCollection.java │ │ │ ├── TaxWithheldComponent.java │ │ │ ├── TaxWithheldComponentList.java │ │ │ ├── TrialShipmentEvent.java │ │ │ └── TrialShipmentEventList.java │ │ ├── common │ │ └── IdWorker.java │ │ ├── constants │ │ ├── DateConstants.java │ │ ├── SpApiConstants.java │ │ └── TaskConstants.java │ │ ├── dynamodb │ │ ├── IFinancesDao.java │ │ ├── IOrdersDao.java │ │ ├── IReportsDao.java │ │ ├── ISpApiSecretDao.java │ │ ├── ISpApiTaskDao.java │ │ ├── entity │ │ │ ├── LWACredentials.java │ │ │ ├── SellerCredentials.java │ │ │ └── SpApiTask.java │ │ └── impl │ │ │ ├── FinancesDao.java │ │ │ ├── OrdersDao.java │ │ │ ├── ReportsDao.java │ │ │ ├── SpApiSecretDao.java │ │ │ └── SpApiTaskDao.java │ │ ├── enums │ │ ├── AppstoreEndpoint.java │ │ ├── DateType.java │ │ ├── ReportStatusEnum.java │ │ ├── ReportTypeEnum.java │ │ ├── ShipmentType.java │ │ └── StatusEnum.java │ │ ├── eventbridge │ │ └── OrderReceivedEventGenerator.java │ │ ├── invoker │ │ ├── finances │ │ │ └── FinancesEventsApiInvoker.java │ │ ├── notification │ │ │ ├── EventCreateDestination.java │ │ │ └── EventCreateSubscription.java │ │ ├── order │ │ │ └── OrderGetNewCreatedByTimeSpan.java │ │ ├── report │ │ │ ├── FulfilledShipmentsGetReportApiInvoker.java │ │ │ └── FulfilledShipmentsRequestReportApiInvoker.java │ │ └── seller │ │ │ └── SellerGetMarketParticipation.java │ │ ├── lambda │ │ ├── finances │ │ │ ├── ExecuteTaskForOneSeller.java │ │ │ └── GetAllSellerCredentialsAndPullFinances.java │ │ ├── log │ │ │ └── SQSLogOnly.java │ │ ├── notification │ │ │ └── EventSubscription.java │ │ ├── order │ │ │ ├── GetAllSellerCredentialsAndPullOrders.java │ │ │ ├── GetOneNewOrder.java │ │ │ └── GetOrderListForOneSeller.java │ │ ├── report │ │ │ ├── FulfilledShipmentsGetReport.java │ │ │ └── FulfilledShipmentsRequestReport.java │ │ ├── requestlimiter │ │ │ ├── ApiProxy.java │ │ │ ├── Invokable.java │ │ │ ├── RateException.java │ │ │ └── RateLimiterRedis.java │ │ └── vo │ │ │ └── OrdersWithSeller.java │ │ └── utils │ │ ├── AbPair.java │ │ ├── DateUtil.java │ │ ├── Helper.java │ │ └── Utils.java └── resources │ └── log4j2.xml └── test ├── java └── cn │ └── amazon │ └── aws │ └── rp │ └── spapi │ ├── clients │ └── api │ │ ├── CatalogApiIT.java │ │ ├── FinancesApiIT.java │ │ └── SPAPIBuilderTest.java │ ├── dynamodb │ ├── ApiTaskIT.java │ ├── CreateSampleSecretsIT.java │ ├── DocumentAPIGlobalSecondaryIndexExampleIT.java │ ├── OrdersDaoDdbIT.java │ ├── SellerCredentialsTest.java │ └── SpApiSecretDaoDdbIT.java │ ├── eventbridge │ └── OrderReceivedEventGeneratorIT.java │ └── lambda │ ├── finances │ └── ExecuteTaskForOneSellerIT.java │ ├── order │ ├── GetAllSellerCredentialsAndPullOrdersIT.java │ └── GetOrderListForOneSellerIT.java │ └── requestlimiter │ ├── ApiProxyTest.java │ └── RateLimiterRedisIT.java └── resources └── log4j2.xml /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.zip 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## selling-partner-api-bootstrap 2 | 3 | This project is a sample implementation of how to implement `rate limiter` and `authentication` for Amazon Selling Partner API. 4 | 5 | This implementation followed the official document [here](https://github.com/amzn/selling-partner-api-docs). 6 | 7 | ### Overview 8 | This project consist of two parts, one is CDK script which is able to deploy everything by one command. The other part is the Java code that pull `Orders` from SP-API, it is triggered by a timer in `EventBridge` every minute for **all** sellers in the `credentials` table. Also `Fulfillment` API is implemented to demo the SP-API `subscription` mode, which first receive notification from `EventBridge`. 9 | 10 | It is based on serverless architecture, and used services are `DynamoDB, Lambda, EventBridge, ElasticCache, CloudWatch`. CDK scripts will start from create VPC and most of the code is running inside the VPC. After the execution of CDK scripts everything is provisioned on AWS. You should go and check the DynamoDB table, and you should put seller credentials into the table. One helper class called `InitCredentialsTableHelper` is provided to easy this process. 11 | 12 | The value of the credentials can be found from the following picture. 13 | ![credentials.png](doc/credentials.png) 14 | 15 | 16 | `RateLimter` is implemented by utilize `Redis on ElasticCache`, so seprate Lambda instances will share the same limiter during the pulling. The RateLimter will dynamically update the rate according to the HTTP header responded from server side. 17 | 18 | Separate `README.md` are included in each sub-folder. 19 | 20 | ### Chinese version Workshop 21 | A Chinese version SP-API workshop can be found [here](https://www.spapi.org.cn/ ). 22 | 23 | ## Contribute 24 | Pull requests and issue reports are welcome. 25 | 26 | ## Security 27 | 28 | See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. 29 | 30 | ## License 31 | 32 | This library is licensed under the MIT-0 License. See the LICENSE file. 33 | 34 | -------------------------------------------------------------------------------- /cdk/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | 6 | # CDK asset staging directory 7 | .cdk.staging 8 | cdk.out 9 | 10 | # Parcel default cache directory 11 | .parcel-cache 12 | -------------------------------------------------------------------------------- /cdk/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /cdk/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to your CDK TypeScript project! 2 | 3 | This is a blank project for TypeScript development with CDK. 4 | 5 | The `cdk.json` file tells the CDK Toolkit how to execute your app. 6 | 7 | 8 | 9 | ## IAM Role 10 | **条件说明** 11 | 如果已经按照官方文档,创建并使用了IAM Role,请将IAM Role ARN 添加至 12 | ./bin/cdk.ts中,如: 13 | ``` 14 | new CdkStack(app, 'CdkStack',"arn:aws:iam::716414967168:role/spapi_role_oct"); 15 | ``` 16 | 此项目会自动添加应用运行时需要的权限。 17 | 18 | 否则,可不添加IAM Role ARN,如: 19 | ``` 20 | new CdkStack(app, 'CdkStack'); 21 | ``` 22 | 部署后,cdk会输出IAM Role ARN,及对于的IAM User的AKSK,用于本地调试。 23 | 24 | ## Amazon App Credential 25 | 安全性要求,clientSecret 需要独立发布到AWS SSM Parameter中 26 | 27 | ## Amazon App Credential 28 | 安全性要求,请手工配置 System Manager Parameter Store 新增这个参数 29 | 名称:seller_central_app_credentials 30 | 类型:SecureString 31 | 级别:Standard 32 | KMS key source:My current account/alias/aws/ssm 或选择其他你已有的加密 KMS Key 33 | seller_central_app_credentials 是用于应用程序用LWA交互凭证使用,来自Seller Centrall Developer Central的LWA credentials 34 | 35 | ``` 36 | { 37 | "clientId": "seller central app clientId", 38 | "clientSecret": "seller central app clientSecret", 39 | } 40 | ``` 41 | 42 | 43 | ## Useful commands 44 | **Setup CDK** 45 | * `npm install -g aws-cdk` 46 | * `npm install -g typescript` 47 | * `npm link typescript` 48 | * `npm install @aws-cdk/aws-s3 @aws-cdk/aws-lambda @aws-cdk/aws-events-targets @aws-cdk/aws-dynamodb @aws-cdk/aws-sqs` 49 | * `npm install @aws-cdk/core` 50 | 51 | The solution for most of CDK issues can be found [here](https://docs.aws.amazon.com/cdk/latest/guide/troubleshooting.html) . 52 | 53 | **Use CDK** 54 | * `npm run build` compile typescript to js 55 | * `npm run watch` watch for changes and compile 56 | * `npm run test` perform the jest unit tests 57 | * `cdk bootstrap` specify the default account and region for cdk 58 | * `cdk deploy` deploy this stack to your default AWS account/region 59 | * `cdk diff` compare deployed stack with current state 60 | * `cdk synth` emits the synthesized CloudFormation template 61 | 62 | **Deply project** 63 | 64 | To deploy project you need to package lambda in another folder. 65 | And you need to install a jar first 66 | 67 | `mvn install:install-file -Dfile=sellingpartnerapi-aa-java-1.0.1-jar-with-dependencies.jar -DgroupId=com.amazon.sellingpartnerapi -DartifactId=sellingpartnerapi-aa-java -Dversion=1.0.1 -Dpackaging=jar` 68 | 69 | Then package it with `gradle buildZip` 70 | 71 | -------------------------------------------------------------------------------- /cdk/bin/cdk.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import 'source-map-support/register'; 3 | import * as cdk from '@aws-cdk/core'; 4 | import { CdkStack } from '../lib/cdk-stack'; 5 | 6 | const app = new cdk.App(); 7 | new CdkStack(app, 'CdkStack',"arn:aws:iam::XXXXXXX:role/spapi_role_oct"); 8 | -------------------------------------------------------------------------------- /cdk/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node bin/cdk.ts", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true", 6 | "@aws-cdk/core:stackRelativeExports": "true" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /cdk/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | roots: ['/test'], 3 | testMatch: ['**/*.test.ts'], 4 | transform: { 5 | '^.+\\.tsx?$': 'ts-jest' 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /cdk/lib/commonParameter.ts: -------------------------------------------------------------------------------- 1 | import { Table } from '@aws-cdk/aws-dynamodb'; 2 | import * as ec2 from '@aws-cdk/aws-ec2'; 3 | import * as elasticache from '@aws-cdk/aws-elasticache'; 4 | import * as events from '@aws-cdk/aws-events'; 5 | import * as ssm from '@aws-cdk/aws-ssm'; 6 | 7 | 8 | export interface commonParameter { 9 | readonly codeZip: string; 10 | readonly lambdaSG: ec2.SecurityGroup; 11 | readonly vpc: ec2.Vpc; 12 | readonly redisCluster: elasticache.CfnCacheCluster; 13 | readonly secrtesTableName: string; 14 | readonly eventBus: events.EventBus; 15 | readonly seller_central_app_credentials: string; 16 | readonly spapiRole: string; 17 | readonly ssm_seller_central_app_credentials: ssm.IStringParameter 18 | readonly secretsTalbe: Table 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /cdk/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cdk", 3 | "version": "0.1.0", 4 | "bin": { 5 | "cdk": "bin/cdk.js" 6 | }, 7 | "scripts": { 8 | "build": "tsc", 9 | "watch": "tsc -w", 10 | "test": "jest", 11 | "cdk": "cdk" 12 | }, 13 | "devDependencies": { 14 | "@aws-cdk/assert": "1.70.0", 15 | "@types/jest": "26.0.10", 16 | "@types/node": "10.17.27", 17 | "aws-cdk": "1.174.0", 18 | "jest": "29.7.0", 19 | "ts-jest": "26.4.3", 20 | "ts-node": "8.1.0", 21 | "typescript": "~3.9.7" 22 | }, 23 | "dependencies": { 24 | "@aws-cdk/aws-apigateway": "1.70.0", 25 | "@aws-cdk/aws-dynamodb": "1.70.0", 26 | "@aws-cdk/aws-ec2": "1.70.0", 27 | "@aws-cdk/aws-elasticache": "1.70.0", 28 | "@aws-cdk/aws-events-targets": "1.70.0", 29 | "@aws-cdk/aws-lambda": "1.70.0", 30 | "@aws-cdk/aws-lambda-event-sources": "1.70.0", 31 | "@aws-cdk/aws-s3": "1.70.0", 32 | "@aws-cdk/aws-sqs": "1.70.0", 33 | "@aws-cdk/core": "1.70.0", 34 | "source-map-support": "0.5.16" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cdk/test/cdk.test.ts: -------------------------------------------------------------------------------- 1 | import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert'; 2 | import * as cdk from '@aws-cdk/core'; 3 | import * as Cdk from '../lib/cdk-stack'; 4 | 5 | test('Empty Stack', () => { 6 | const app = new cdk.App(); 7 | // WHEN 8 | const stack = new Cdk.CdkStack(app, 'MyTestStack', 'arn'); 9 | // THEN 10 | expectCDK(stack).to(matchTemplate({ 11 | "Resources": {} 12 | }, MatchStyle.EXACT)) 13 | }); 14 | -------------------------------------------------------------------------------- /cdk/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "declaration": true, 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "strictNullChecks": true, 10 | "noImplicitThis": true, 11 | "alwaysStrict": true, 12 | "noUnusedLocals": false, 13 | "noUnusedParameters": false, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": false, 16 | "inlineSourceMap": true, 17 | "inlineSources": true, 18 | "experimentalDecorators": true, 19 | "strictPropertyInitialization": false, 20 | "typeRoots": ["./node_modules/@types"] 21 | }, 22 | "exclude": ["cdk.out"] 23 | } 24 | -------------------------------------------------------------------------------- /doc/credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/selling-partner-api-bootstrap/7530a21ab77e287095855e64a1c37660bb63fbc9/doc/credentials.png -------------------------------------------------------------------------------- /lambda/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .gradle/ 3 | build/ 4 | gradle/ 5 | 6 | *.iml 7 | gradlew 8 | gradlew.bat 9 | src/main/java/cn/amazon/aws/rp/spapi/dynamodb/NeverCommitNeverCommit.java 10 | -------------------------------------------------------------------------------- /lambda/README.cn.md: -------------------------------------------------------------------------------- 1 | ## 代码部署 2 | 3 | * 代码分成两个部分,一个是CDK,一个是Lambda,分别在各自目录下,分别有README。 4 | * 先搭建CDK的开发环境,这个参考官方文档即可,注意开发机需要配置有足够的AWS权限。 5 | * 接着按CDK目录中README的要求安装CDK的依赖。 6 | * Build Java工程安装了gradlew的话“./gradlew buildZip”,或者用系统的”gradle buildZip” – README里这个地方不一致,以邮件为准。 7 | * 部署前:请检查CDK中需要的资源,区域(默认us-east-1),然后执行下一步部署。 8 | * 部署:在CDK的目录下执行cdk deploy。如果第一次执行可能会报错,错误信息中会说要执行初始化指令,按照提示执行即可。CDK会将数据库,网络,安全,lambda,ElasticCache,权限等配置好。 9 | * 第一次部署需要30分钟以上。结束后直接就可以在CloudWatch中看Lambda输出的日志了。 10 | 11 | ## 代码配置 12 | 13 | * 部署后需要在DynamoDB中的Seller secrets表中加入Seller授权的refreshToken, Region 14 | 15 | ## 测试 16 | 17 | * 在API中调用测试Get方法去订阅ORDER更新事件。 18 | 19 | ## TODO 20 | 21 | * Notification API需要避免重复订阅 - 处理HTTP 409异常,或者提前检查订阅情况。 22 | * 支持基于Sandbox的UT。 23 | 24 | * SellersApi.getMarketplaceParticipations 存储结果 -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/AWSAuthenticationCredentials.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import lombok.NonNull; 6 | 7 | /** 8 | * AWSAuthenticationCredentials 9 | */ 10 | @Data 11 | @Builder 12 | public class AWSAuthenticationCredentials { 13 | /** 14 | * AWS IAM User Access Key Id 15 | */ 16 | @NonNull 17 | private String accessKeyId; 18 | 19 | /** 20 | * AWS IAM User Secret Key 21 | */ 22 | @NonNull 23 | private String secretKey; 24 | 25 | /** 26 | * AWS Region 27 | */ 28 | @NonNull 29 | private String region; 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/AWSAuthenticationCredentialsProvider.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | /** 7 | * AWSAuthenticationCredentialsProvider 8 | */ 9 | @Data 10 | @Builder 11 | public class AWSAuthenticationCredentialsProvider { 12 | /** 13 | * AWS IAM Role ARN 14 | */ 15 | private String roleArn; 16 | 17 | /** 18 | * AWS IAM Role Session Name 19 | */ 20 | private String roleSessionName; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAAccessTokenCache.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | public interface LWAAccessTokenCache { 4 | String get(Object key); 5 | void put(Object key, String accessToken, long tokenTTLInSeconds); 6 | } 7 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAAccessTokenCacheImpl.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | 4 | import java.util.concurrent.ConcurrentHashMap; 5 | 6 | public class LWAAccessTokenCacheImpl implements LWAAccessTokenCache { 7 | //in milliseconds; to avoid returning a token that would expire before or while a request is made 8 | private long expiryAdjustment = 60 * 1000; 9 | private static final long SECOND_TO_MILLIS = 1000; 10 | private ConcurrentHashMap accessTokenHashMap = 11 | new ConcurrentHashMap(); 12 | @Override 13 | public void put(Object oLWAAccessTokenRequestMeta, String accessToken, long tokenTTLInSeconds) { 14 | LWAAccessTokenCacheItem accessTokenCacheItem = new LWAAccessTokenCacheItem(); 15 | long insertTime = System.currentTimeMillis(); 16 | long accessTokenExpiresValueMillis = (tokenTTLInSeconds * SECOND_TO_MILLIS) + insertTime; 17 | accessTokenCacheItem.setAccessToken(accessToken); 18 | accessTokenCacheItem.setAccessTokenExpiredTime(accessTokenExpiresValueMillis); 19 | accessTokenHashMap.put(oLWAAccessTokenRequestMeta, accessTokenCacheItem); 20 | } 21 | 22 | @Override 23 | public String get(Object oLWAAccessTokenRequestMeta) { 24 | Object accessTokenValue = accessTokenHashMap.get(oLWAAccessTokenRequestMeta); 25 | if (accessTokenValue != null) { 26 | LWAAccessTokenCacheItem accessTokenData = 27 | (LWAAccessTokenCacheItem) accessTokenValue; 28 | long currentTime = System.currentTimeMillis(); 29 | long accessTokenExpiredTime = accessTokenData.getAccessTokenExpiredTime() - expiryAdjustment; 30 | if (currentTime < accessTokenExpiredTime) { 31 | return accessTokenData.getAccessToken(); 32 | } 33 | } 34 | return null; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAAccessTokenCacheItem.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | class LWAAccessTokenCacheItem { 7 | 8 | private String accessToken; 9 | private long accessTokenExpiredTime; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAAccessTokenRequestMeta.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | 7 | @Data 8 | @Builder 9 | class LWAAccessTokenRequestMeta { 10 | @SerializedName("grant_type") 11 | private String grantType; 12 | 13 | @SerializedName("refresh_token") 14 | private String refreshToken; 15 | 16 | @SerializedName("client_id") 17 | private String clientId; 18 | 19 | @SerializedName("client_secret") 20 | private String clientSecret; 21 | 22 | @SerializedName("scope") 23 | private LWAClientScopes scopes; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAAuthorizationCredentials.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NonNull; 7 | 8 | import java.util.Arrays; 9 | import java.util.HashSet; 10 | 11 | /** 12 | * LWAAuthorizationCredentials 13 | */ 14 | @Data 15 | @Builder 16 | public class LWAAuthorizationCredentials { 17 | /** 18 | * LWA Client Id 19 | */ 20 | @NonNull 21 | private String clientId; 22 | 23 | /** 24 | * LWA Client Secret 25 | */ 26 | @NonNull 27 | private String clientSecret; 28 | 29 | /** 30 | * LWA Refresh Token 31 | */ 32 | private String refreshToken; 33 | 34 | /** 35 | * LWA Authorization Server Endpoint 36 | */ 37 | @NonNull 38 | private String endpoint; 39 | 40 | /** 41 | * LWA Client Scopes 42 | */ 43 | private LWAClientScopes scopes; 44 | 45 | public static class LWAAuthorizationCredentialsBuilder { 46 | 47 | { 48 | scopes = new LWAClientScopes(new HashSet<>()); 49 | } 50 | 51 | public LWAAuthorizationCredentialsBuilder withScope(String scope) { 52 | return withScopes(scope); 53 | } 54 | 55 | public LWAAuthorizationCredentialsBuilder withScopes(String... scopes) { 56 | if (scopes != null) { 57 | Arrays.stream(scopes) 58 | .forEach(this.scopes::addScope); 59 | } 60 | return this; 61 | } 62 | 63 | 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAClientScopes.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import com.google.gson.annotations.JsonAdapter; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | 7 | import java.util.Set; 8 | 9 | @AllArgsConstructor 10 | @Getter 11 | @JsonAdapter(LWAClientScopesSerializerDeserializer.class) 12 | public class LWAClientScopes { 13 | 14 | private final Set scopes; 15 | 16 | protected void addScope(String scope) { 17 | scopes.add(scope); 18 | 19 | } 20 | 21 | protected boolean isEmpty() { 22 | return scopes.isEmpty(); 23 | } 24 | 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/LWAClientScopesSerializerDeserializer.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | import com.google.gson.*; 4 | 5 | import java.lang.reflect.Type; 6 | import java.util.Arrays; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | public class LWAClientScopesSerializerDeserializer implements JsonDeserializer, 11 | JsonSerializer { 12 | 13 | @Override 14 | public JsonElement serialize(LWAClientScopes src, Type typeOfSrc, JsonSerializationContext context) { 15 | return new JsonPrimitive(String.join(" ", src.getScopes())); 16 | } 17 | 18 | @Override 19 | public LWAClientScopes deserialize(JsonElement jsonElement, Type type, 20 | JsonDeserializationContext jsonDeserializationContext) 21 | throws JsonParseException { 22 | JsonObject jsonObj = jsonElement.getAsJsonObject(); 23 | Set scopeSet = new HashSet<>(Arrays.asList(jsonObj.get("scope").getAsString().split(" "))); 24 | return new LWAClientScopes(scopeSet); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/aa/ScopeConstants.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.aa; 2 | 3 | public final class ScopeConstants { 4 | 5 | private ScopeConstants(){ 6 | } 7 | 8 | public static final String SCOPE_NOTIFICATIONS_API = "sellingpartnerapi::notifications"; 9 | public static final String SCOPE_MIGRATION_API = "sellingpartnerapi::migration"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/ApiCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * Callback for asynchronous API call. 21 | * 22 | * @param The return type 23 | */ 24 | public interface ApiCallback { 25 | /** 26 | * This is called when the API call fails. 27 | * 28 | * @param e The exception causing the failure 29 | * @param statusCode Status code of the response if available, otherwise it would be 0 30 | * @param responseHeaders Headers of the response if available, otherwise it would be null 31 | */ 32 | void onFailure(ApiException e, int statusCode, Map> responseHeaders); 33 | 34 | /** 35 | * This is called when the API call succeeded. 36 | * 37 | * @param result The result deserialized from response 38 | * @param statusCode Status code of the response 39 | * @param responseHeaders Headers of the response 40 | */ 41 | void onSuccess(T result, int statusCode, Map> responseHeaders); 42 | 43 | /** 44 | * This is called when the API upload processing. 45 | * 46 | * @param bytesWritten bytes Written 47 | * @param contentLength content length of request body 48 | * @param done write end 49 | */ 50 | void onUploadProgress(long bytesWritten, long contentLength, boolean done); 51 | 52 | /** 53 | * This is called when the API downlond processing. 54 | * 55 | * @param bytesRead bytes Read 56 | * @param contentLength content lenngth of the response 57 | * @param done Read end 58 | */ 59 | void onDownloadProgress(long bytesRead, long contentLength, boolean done); 60 | } 61 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/ApiResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * API response returned by API call. 21 | * 22 | * @param The type of data that is deserialized from response body 23 | */ 24 | public class ApiResponse { 25 | final private int statusCode; 26 | final private Map> headers; 27 | final private T data; 28 | 29 | /** 30 | * @param statusCode The status code of HTTP response 31 | * @param headers The headers of HTTP response 32 | */ 33 | public ApiResponse(int statusCode, Map> headers) { 34 | this(statusCode, headers, null); 35 | } 36 | 37 | /** 38 | * @param statusCode The status code of HTTP response 39 | * @param headers The headers of HTTP response 40 | * @param data The object deserialized from response bod 41 | */ 42 | public ApiResponse(int statusCode, Map> headers, T data) { 43 | this.statusCode = statusCode; 44 | this.headers = headers; 45 | this.data = data; 46 | } 47 | 48 | public int getStatusCode() { 49 | return statusCode; 50 | } 51 | 52 | public Map> getHeaders() { 53 | return headers; 54 | } 55 | 56 | public T getData() { 57 | return data; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-12T16:51:35.500+08:00") 17 | public class Configuration { 18 | private static ApiClient defaultApiClient = new ApiClient(); 19 | 20 | /** 21 | * Get the default API client, which would be used when creating API 22 | * instances without providing an API client. 23 | * 24 | * @return Default API client 25 | */ 26 | public static ApiClient getDefaultApiClient() { 27 | return defaultApiClient; 28 | } 29 | 30 | /** 31 | * Set the default API client, which would be used when creating API 32 | * instances without providing an API client. 33 | * 34 | * @param apiClient API client 35 | */ 36 | public static void setDefaultApiClient(ApiClient apiClient) { 37 | defaultApiClient = apiClient; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-12T16:51:35.500+08:00") 17 | public class Pair { 18 | private String name = ""; 19 | private String value = ""; 20 | 21 | public Pair (String name, String value) { 22 | setName(name); 23 | setValue(value); 24 | } 25 | 26 | private void setName(String name) { 27 | if (!isValidString(name)) return; 28 | 29 | this.name = name; 30 | } 31 | 32 | private void setValue(String value) { 33 | if (!isValidString(value)) return; 34 | 35 | this.value = value; 36 | } 37 | 38 | public String getName() { 39 | return this.name; 40 | } 41 | 42 | public String getValue() { 43 | return this.value; 44 | } 45 | 46 | private boolean isValidString(String arg) { 47 | if (arg == null) return false; 48 | if (arg.trim().isEmpty()) return false; 49 | 50 | return true; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/ProgressRequestBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | import com.squareup.okhttp.MediaType; 17 | import com.squareup.okhttp.RequestBody; 18 | import okio.*; 19 | 20 | import java.io.IOException; 21 | 22 | public class ProgressRequestBody extends RequestBody { 23 | 24 | public interface ProgressRequestListener { 25 | void onRequestProgress(long bytesWritten, long contentLength, boolean done); 26 | } 27 | 28 | private final RequestBody requestBody; 29 | 30 | private final ProgressRequestListener progressListener; 31 | 32 | public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { 33 | this.requestBody = requestBody; 34 | this.progressListener = progressListener; 35 | } 36 | 37 | @Override 38 | public MediaType contentType() { 39 | return requestBody.contentType(); 40 | } 41 | 42 | @Override 43 | public long contentLength() throws IOException { 44 | return requestBody.contentLength(); 45 | } 46 | 47 | @Override 48 | public void writeTo(BufferedSink sink) throws IOException { 49 | BufferedSink bufferedSink = Okio.buffer(sink(sink)); 50 | requestBody.writeTo(bufferedSink); 51 | bufferedSink.flush(); 52 | } 53 | 54 | private Sink sink(Sink sink) { 55 | return new ForwardingSink(sink) { 56 | 57 | long bytesWritten = 0L; 58 | long contentLength = 0L; 59 | 60 | @Override 61 | public void write(Buffer source, long byteCount) throws IOException { 62 | super.write(source, byteCount); 63 | if (contentLength == 0) { 64 | contentLength = contentLength(); 65 | } 66 | 67 | bytesWritten += byteCount; 68 | progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); 69 | } 70 | }; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/ProgressResponseBody.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | import com.squareup.okhttp.MediaType; 17 | import com.squareup.okhttp.ResponseBody; 18 | import okio.*; 19 | 20 | import java.io.IOException; 21 | 22 | public class ProgressResponseBody extends ResponseBody { 23 | 24 | public interface ProgressListener { 25 | void update(long bytesRead, long contentLength, boolean done); 26 | } 27 | 28 | private final ResponseBody responseBody; 29 | private final ProgressListener progressListener; 30 | private BufferedSource bufferedSource; 31 | 32 | public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { 33 | this.responseBody = responseBody; 34 | this.progressListener = progressListener; 35 | } 36 | 37 | @Override 38 | public MediaType contentType() { 39 | return responseBody.contentType(); 40 | } 41 | 42 | @Override 43 | public long contentLength() throws IOException { 44 | return responseBody.contentLength(); 45 | } 46 | 47 | @Override 48 | public BufferedSource source() throws IOException { 49 | if (bufferedSource == null) { 50 | bufferedSource = Okio.buffer(source(responseBody.source())); 51 | } 52 | return bufferedSource; 53 | } 54 | 55 | private Source source(Source source) { 56 | return new ForwardingSource(source) { 57 | long totalBytesRead = 0L; 58 | 59 | @Override 60 | public long read(Buffer sink, long byteCount) throws IOException { 61 | long bytesRead = super.read(sink, byteCount); 62 | // read() returns the number of bytes read, or -1 if this source is exhausted. 63 | totalBytesRead += bytesRead != -1 ? bytesRead : 0; 64 | progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); 65 | return bytesRead; 66 | } 67 | }; 68 | } 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/StringUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients; 15 | 16 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-12T16:51:35.500+08:00") 17 | public class StringUtil { 18 | /** 19 | * Check if the given array contains the given value (with case-insensitive comparison). 20 | * 21 | * @param array The array 22 | * @param value The value to search 23 | * @return true if the array contains the value 24 | */ 25 | public static boolean containsIgnoreCase(String[] array, String value) { 26 | for (String str : array) { 27 | if (value == null && str == null) return true; 28 | if (value != null && value.equalsIgnoreCase(str)) return true; 29 | } 30 | return false; 31 | } 32 | 33 | /** 34 | * Join an array of strings with the given separator. 35 | *

36 | * Note: This might be replaced by utility method from commons-lang or guava someday 37 | * if one of those libraries is added as dependency. 38 | *

39 | * 40 | * @param array The array of strings 41 | * @param separator The separator 42 | * @return the resulting string 43 | */ 44 | public static String join(String[] array, String separator) { 45 | int len = array.length; 46 | if (len == 0) return ""; 47 | 48 | StringBuilder out = new StringBuilder(); 49 | out.append(array[0]); 50 | for (int i = 1; i < len; i++) { 51 | out.append(separator).append(array[i]); 52 | } 53 | return out.toString(); 54 | } 55 | 56 | /** 57 | * Check if the given value is null or an empty string 58 | * 59 | * @param value The value to check 60 | * @return true if the value is null or empty 61 | */ 62 | public static boolean isEmpty(String value) { 63 | return value == null || value.isEmpty(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/auth/ApiKeyAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.auth; 15 | 16 | import cn.amazon.aws.rp.spapi.clients.Pair; 17 | 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 22 | public class ApiKeyAuth implements Authentication { 23 | private final String location; 24 | private final String paramName; 25 | 26 | private String apiKey; 27 | private String apiKeyPrefix; 28 | 29 | public ApiKeyAuth(String location, String paramName) { 30 | this.location = location; 31 | this.paramName = paramName; 32 | } 33 | 34 | public String getLocation() { 35 | return location; 36 | } 37 | 38 | public String getParamName() { 39 | return paramName; 40 | } 41 | 42 | public String getApiKey() { 43 | return apiKey; 44 | } 45 | 46 | public void setApiKey(String apiKey) { 47 | this.apiKey = apiKey; 48 | } 49 | 50 | public String getApiKeyPrefix() { 51 | return apiKeyPrefix; 52 | } 53 | 54 | public void setApiKeyPrefix(String apiKeyPrefix) { 55 | this.apiKeyPrefix = apiKeyPrefix; 56 | } 57 | 58 | @Override 59 | public void applyToParams(List queryParams, Map headerParams) { 60 | if (apiKey == null) { 61 | return; 62 | } 63 | String value; 64 | if (apiKeyPrefix != null) { 65 | value = apiKeyPrefix + " " + apiKey; 66 | } else { 67 | value = apiKey; 68 | } 69 | if ("query".equals(location)) { 70 | queryParams.add(new Pair(paramName, value)); 71 | } else if ("header".equals(location)) { 72 | headerParams.put(paramName, value); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/auth/Authentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.auth; 15 | 16 | import cn.amazon.aws.rp.spapi.clients.Pair; 17 | 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | public interface Authentication { 22 | /** 23 | * Apply authentication settings to header and query params. 24 | * 25 | * @param queryParams List of query parameters 26 | * @param headerParams Map of header parameters 27 | */ 28 | void applyToParams(List queryParams, Map headerParams); 29 | } 30 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.auth; 15 | 16 | import cn.amazon.aws.rp.spapi.clients.Pair; 17 | import com.squareup.okhttp.Credentials; 18 | 19 | import java.util.List; 20 | import java.util.Map; 21 | 22 | public class HttpBasicAuth implements Authentication { 23 | private String username; 24 | private String password; 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username; 32 | } 33 | 34 | public String getPassword() { 35 | return password; 36 | } 37 | 38 | public void setPassword(String password) { 39 | this.password = password; 40 | } 41 | 42 | @Override 43 | public void applyToParams(List queryParams, Map headerParams) { 44 | if (username == null && password == null) { 45 | return; 46 | } 47 | headerParams.put("Authorization", Credentials.basic( 48 | username == null ? "" : username, 49 | password == null ? "" : password)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/auth/OAuth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.auth; 15 | 16 | import cn.amazon.aws.rp.spapi.clients.Pair; 17 | 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 22 | public class OAuth implements Authentication { 23 | private String accessToken; 24 | 25 | public String getAccessToken() { 26 | return accessToken; 27 | } 28 | 29 | public void setAccessToken(String accessToken) { 30 | this.accessToken = accessToken; 31 | } 32 | 33 | @Override 34 | public void applyToParams(List queryParams, Map headerParams) { 35 | if (accessToken != null) { 36 | headerParams.put("Authorization", "Bearer " + accessToken); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/auth/OAuthFlow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.auth; 15 | 16 | public enum OAuthFlow { 17 | accessCode, implicit, password, application 18 | } 19 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/AdjustmentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of adjustment event information for the seller's account. 23 | */ 24 | @ApiModel(description = "A list of adjustment event information for the seller's account.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class AdjustmentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class AdjustmentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/AdjustmentItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about items in an adjustment to the seller's account. 23 | */ 24 | @ApiModel(description = "A list of information about items in an adjustment to the seller's account.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class AdjustmentItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class AdjustmentItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/AffordabilityExpenseEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of expense information related to an affordability promotion. 23 | */ 24 | @ApiModel(description = "A list of expense information related to an affordability promotion.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class AffordabilityExpenseEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class AffordabilityExpenseEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/AttributeSetList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.AttributeSetListType; 19 | import io.swagger.annotations.ApiModel; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * A list of attributes for the item. 25 | */ 26 | @ApiModel(description = "A list of attributes for the item.") 27 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 28 | public class AttributeSetList extends ArrayList { 29 | 30 | @Override 31 | public boolean equals(java.lang.Object o) { 32 | if (this == o) { 33 | return true; 34 | } 35 | if (o == null || getClass() != o.getClass()) { 36 | return false; 37 | } 38 | return super.equals(o); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(super.hashCode()); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class AttributeSetList {\n"); 51 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 52 | sb.append("}"); 53 | return sb.toString(); 54 | } 55 | 56 | /** 57 | * Convert the given object to string with each line indented by 4 spaces 58 | * (except the first line). 59 | */ 60 | private String toIndentedString(java.lang.Object o) { 61 | if (o == null) { 62 | return "null"; 63 | } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/CancelReportResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import com.google.gson.annotations.SerializedName; 19 | import io.swagger.annotations.ApiModel; 20 | import io.swagger.annotations.ApiModelProperty; 21 | 22 | /** 23 | * The response for the cancelReport operation. 24 | */ 25 | @ApiModel(description = "The response for the cancelReport operation.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 27 | public class CancelReportResponse { 28 | @SerializedName("errors") 29 | private ErrorList errors = null; 30 | 31 | public CancelReportResponse errors(ErrorList errors) { 32 | this.errors = errors; 33 | return this; 34 | } 35 | 36 | /** 37 | * Get errors 38 | * @return errors 39 | **/ 40 | @ApiModelProperty(value = "") 41 | public ErrorList getErrors() { 42 | return errors; 43 | } 44 | 45 | public void setErrors(ErrorList errors) { 46 | this.errors = errors; 47 | } 48 | 49 | 50 | @Override 51 | public boolean equals(Object o) { 52 | if (this == o) { 53 | return true; 54 | } 55 | if (o == null || getClass() != o.getClass()) { 56 | return false; 57 | } 58 | CancelReportResponse cancelReportResponse = (CancelReportResponse) o; 59 | return Objects.equals(this.errors, cancelReportResponse.errors); 60 | } 61 | 62 | @Override 63 | public int hashCode() { 64 | return Objects.hash(errors); 65 | } 66 | 67 | 68 | @Override 69 | public String toString() { 70 | StringBuilder sb = new StringBuilder(); 71 | sb.append("class CancelReportResponse {\n"); 72 | 73 | sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); 74 | sb.append("}"); 75 | return sb.toString(); 76 | } 77 | 78 | /** 79 | * Convert the given object to string with each line indented by 4 spaces 80 | * (except the first line). 81 | */ 82 | private String toIndentedString(Object o) { 83 | if (o == null) { 84 | return "null"; 85 | } 86 | return o.toString().replace("\n", "\n "); 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/CancelReportScheduleResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import com.google.gson.annotations.SerializedName; 19 | import io.swagger.annotations.ApiModel; 20 | import io.swagger.annotations.ApiModelProperty; 21 | 22 | /** 23 | * The response for the cancelReportSchedule operation. 24 | */ 25 | @ApiModel(description = "The response for the cancelReportSchedule operation.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 27 | public class CancelReportScheduleResponse { 28 | @SerializedName("errors") 29 | private ErrorList errors = null; 30 | 31 | public CancelReportScheduleResponse errors(ErrorList errors) { 32 | this.errors = errors; 33 | return this; 34 | } 35 | 36 | /** 37 | * Get errors 38 | * @return errors 39 | **/ 40 | @ApiModelProperty(value = "") 41 | public ErrorList getErrors() { 42 | return errors; 43 | } 44 | 45 | public void setErrors(ErrorList errors) { 46 | this.errors = errors; 47 | } 48 | 49 | 50 | @Override 51 | public boolean equals(Object o) { 52 | if (this == o) { 53 | return true; 54 | } 55 | if (o == null || getClass() != o.getClass()) { 56 | return false; 57 | } 58 | CancelReportScheduleResponse cancelReportScheduleResponse = (CancelReportScheduleResponse) o; 59 | return Objects.equals(this.errors, cancelReportScheduleResponse.errors); 60 | } 61 | 62 | @Override 63 | public int hashCode() { 64 | return Objects.hash(errors); 65 | } 66 | 67 | 68 | @Override 69 | public String toString() { 70 | StringBuilder sb = new StringBuilder(); 71 | sb.append("class CancelReportScheduleResponse {\n"); 72 | 73 | sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); 74 | sb.append("}"); 75 | return sb.toString(); 76 | } 77 | 78 | /** 79 | * Convert the given object to string with each line indented by 4 spaces 80 | * (except the first line). 81 | */ 82 | private String toIndentedString(Object o) { 83 | if (o == null) { 84 | return "null"; 85 | } 86 | return o.toString().replace("\n", "\n "); 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ChargeComponentList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of charge information on the seller's account. 23 | */ 24 | @ApiModel(description = "A list of charge information on the seller's account.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ChargeComponentList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ChargeComponentList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ChargeInstrumentList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of payment instruments. 23 | */ 24 | @ApiModel(description = "A list of payment instruments.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ChargeInstrumentList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ChargeInstrumentList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/CouponPaymentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of coupon payment event information. 23 | */ 24 | @ApiModel(description = "A list of coupon payment event information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class CouponPaymentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class CouponPaymentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/CreateReportResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import com.google.gson.annotations.SerializedName; 19 | import io.swagger.annotations.ApiModelProperty; 20 | 21 | /** 22 | * CreateReportResult 23 | */ 24 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 25 | public class CreateReportResult { 26 | @SerializedName("reportId") 27 | private String reportId = null; 28 | 29 | public CreateReportResult reportId(String reportId) { 30 | this.reportId = reportId; 31 | return this; 32 | } 33 | 34 | /** 35 | * The identifier for the report. This identifier is unique only in combination with a seller ID. 36 | * @return reportId 37 | **/ 38 | @ApiModelProperty(required = true, value = "The identifier for the report. This identifier is unique only in combination with a seller ID.") 39 | public String getReportId() { 40 | return reportId; 41 | } 42 | 43 | public void setReportId(String reportId) { 44 | this.reportId = reportId; 45 | } 46 | 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | if (this == o) { 51 | return true; 52 | } 53 | if (o == null || getClass() != o.getClass()) { 54 | return false; 55 | } 56 | CreateReportResult createReportResult = (CreateReportResult) o; 57 | return Objects.equals(this.reportId, createReportResult.reportId); 58 | } 59 | 60 | @Override 61 | public int hashCode() { 62 | return Objects.hash(reportId); 63 | } 64 | 65 | 66 | @Override 67 | public String toString() { 68 | StringBuilder sb = new StringBuilder(); 69 | sb.append("class CreateReportResult {\n"); 70 | 71 | sb.append(" reportId: ").append(toIndentedString(reportId)).append("\n"); 72 | sb.append("}"); 73 | return sb.toString(); 74 | } 75 | 76 | /** 77 | * Convert the given object to string with each line indented by 4 spaces 78 | * (except the first line). 79 | */ 80 | private String toIndentedString(Object o) { 81 | if (o == null) { 82 | return "null"; 83 | } 84 | return o.toString().replace("\n", "\n "); 85 | } 86 | 87 | } 88 | 89 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/DebtRecoveryEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of debt recovery event information. 23 | */ 24 | @ApiModel(description = "A list of debt recovery event information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class DebtRecoveryEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class DebtRecoveryEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/DebtRecoveryItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of debt recovery item information. 23 | */ 24 | @ApiModel(description = "A list of debt recovery item information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class DebtRecoveryItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class DebtRecoveryItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/DestinationList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Notifications 3 | * The Selling Partner API for Notifications lets you subscribe to notifications that are relevant to a selling partner's business. Using this API you can create a destination to receive notifications, subscribe to notifications, delete notification subscriptions, and more. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * A list of destinations. 24 | */ 25 | @ApiModel(description = "A list of destinations.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:56.921+08:00") 27 | public class DestinationList extends ArrayList { 28 | 29 | @Override 30 | public boolean equals(Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | return super.equals(o); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode()); 43 | } 44 | 45 | 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class DestinationList {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/DirectPaymentList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of direct payment information. 23 | */ 24 | @ApiModel(description = "A list of direct payment information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class DirectPaymentList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class DirectPaymentList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ErrorList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of error responses returned when a request is unsuccessful. 23 | */ 24 | @ApiModel(description = "A list of error responses returned when a request is unsuccessful.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ErrorList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ErrorList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/FBALiquidationEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of FBA inventory liquidation payment events. 23 | */ 24 | @ApiModel(description = "A list of FBA inventory liquidation payment events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class FBALiquidationEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class FBALiquidationEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/FeeComponentList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of fee component information. 23 | */ 24 | @ApiModel(description = "A list of fee component information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class FeeComponentList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class FeeComponentList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/FinancialEventGroupList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of financial event group information. 23 | */ 24 | @ApiModel(description = "A list of financial event group information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class FinancialEventGroupList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class FinancialEventGroupList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ImagingServicesFeeEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of fee events related to Amazon Imaging services. 23 | */ 24 | @ApiModel(description = "A list of fee events related to Amazon Imaging services.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ImagingServicesFeeEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ImagingServicesFeeEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.Item; 19 | import io.swagger.annotations.ApiModel; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * A list of items. 25 | */ 26 | @ApiModel(description = "A list of items.") 27 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 28 | public class ItemList extends ArrayList { 29 | 30 | @Override 31 | public boolean equals(java.lang.Object o) { 32 | if (this == o) { 33 | return true; 34 | } 35 | if (o == null || getClass() != o.getClass()) { 36 | return false; 37 | } 38 | return super.equals(o); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(super.hashCode()); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class ItemList {\n"); 51 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 52 | sb.append("}"); 53 | return sb.toString(); 54 | } 55 | 56 | /** 57 | * Convert the given object to string with each line indented by 4 spaces 58 | * (except the first line). 59 | */ 60 | private String toIndentedString(java.lang.Object o) { 61 | if (o == null) { 62 | return "null"; 63 | } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ListMatchingItemsResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.ItemList; 19 | import com.google.gson.TypeAdapter; 20 | import com.google.gson.annotations.JsonAdapter; 21 | import com.google.gson.annotations.SerializedName; 22 | import com.google.gson.stream.JsonReader; 23 | import com.google.gson.stream.JsonWriter; 24 | import io.swagger.annotations.ApiModel; 25 | import io.swagger.annotations.ApiModelProperty; 26 | import java.io.IOException; 27 | 28 | /** 29 | * ListMatchingItemsResponse 30 | */ 31 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 32 | public class ListMatchingItemsResponse { 33 | @SerializedName("Items") 34 | private ItemList items = null; 35 | 36 | public ListMatchingItemsResponse items(ItemList items) { 37 | this.items = items; 38 | return this; 39 | } 40 | 41 | /** 42 | * Get items 43 | * @return items 44 | **/ 45 | @ApiModelProperty(value = "") 46 | public ItemList getItems() { 47 | return items; 48 | } 49 | 50 | public void setItems(ItemList items) { 51 | this.items = items; 52 | } 53 | 54 | 55 | @Override 56 | public boolean equals(java.lang.Object o) { 57 | if (this == o) { 58 | return true; 59 | } 60 | if (o == null || getClass() != o.getClass()) { 61 | return false; 62 | } 63 | ListMatchingItemsResponse listMatchingItemsResponse = (ListMatchingItemsResponse) o; 64 | return Objects.equals(this.items, listMatchingItemsResponse.items); 65 | } 66 | 67 | @Override 68 | public int hashCode() { 69 | return Objects.hash(items); 70 | } 71 | 72 | 73 | @Override 74 | public String toString() { 75 | StringBuilder sb = new StringBuilder(); 76 | sb.append("class ListMatchingItemsResponse {\n"); 77 | 78 | sb.append(" items: ").append(toIndentedString(items)).append("\n"); 79 | sb.append("}"); 80 | return sb.toString(); 81 | } 82 | 83 | /** 84 | * Convert the given object to string with each line indented by 4 spaces 85 | * (except the first line). 86 | */ 87 | private String toIndentedString(java.lang.Object o) { 88 | if (o == null) { 89 | return "null"; 90 | } 91 | return o.toString().replace("\n", "\n "); 92 | } 93 | 94 | } 95 | 96 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ListOfCategories.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.Categories; 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | /** 23 | * ListOfCategories 24 | */ 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 26 | public class ListOfCategories extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(java.lang.Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ListOfCategories {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(java.lang.Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/LoanServicingEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of loan servicing events. 23 | */ 24 | @ApiModel(description = "A list of loan servicing events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class LoanServicingEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class LoanServicingEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/MarketplaceParticipationList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Sellers 3 | * The Selling Partner API for Sellers lets you retrieve information on behalf of sellers about their seller account, such as the marketplaces they participate in. Along with listing the marketplaces that a seller can sell in, the API also provides additional information about the marketplace such as the default language and the default currency. The API also provides seller-specific information such as whether the seller has suspended listings in that marketplace. 4 | * 5 | * OpenAPI spec version: v1 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * List of marketplace participations. 23 | */ 24 | @ApiModel(description = "List of marketplace participations.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-12T16:51:35.500+08:00") 26 | public class MarketplaceParticipationList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class MarketplaceParticipationList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/NetworkComminglingTransactionEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of network commingling transaction events. 23 | */ 24 | @ApiModel(description = "A list of network commingling transaction events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class NetworkComminglingTransactionEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class NetworkComminglingTransactionEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/NumberOfOfferListingsList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.OfferListingCountType; 19 | import io.swagger.annotations.ApiModel; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * The number of active offer listings for the item that was submitted. The listing count is returned by condition, one for each listing condition value that is returned. Possible listing condition values are: Any, New, Used, Collectible, Refurbished, or Club. 25 | */ 26 | @ApiModel(description = "The number of active offer listings for the item that was submitted. The listing count is returned by condition, one for each listing condition value that is returned. Possible listing condition values are: Any, New, Used, Collectible, Refurbished, or Club.") 27 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 28 | public class NumberOfOfferListingsList extends ArrayList { 29 | 30 | @Override 31 | public boolean equals(java.lang.Object o) { 32 | if (this == o) { 33 | return true; 34 | } 35 | if (o == null || getClass() != o.getClass()) { 36 | return false; 37 | } 38 | return super.equals(o); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(super.hashCode()); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class NumberOfOfferListingsList {\n"); 51 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 52 | sb.append("}"); 53 | return sb.toString(); 54 | } 55 | 56 | /** 57 | * Convert the given object to string with each line indented by 4 spaces 58 | * (except the first line). 59 | */ 60 | private String toIndentedString(java.lang.Object o) { 61 | if (o == null) { 62 | return "null"; 63 | } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/OrderItemBuyerInfoList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * A single order item's buyer information list. 24 | */ 25 | @ApiModel(description = "A single order item's buyer information list.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 27 | public class OrderItemBuyerInfoList extends ArrayList { 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | return super.equals(o); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode()); 43 | } 44 | 45 | 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class OrderItemBuyerInfoList {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(java.lang.Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/OrderItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * A list of order items. 24 | */ 25 | @ApiModel(description = "A list of order items.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 27 | public class OrderItemList extends ArrayList { 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | return super.equals(o); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode()); 43 | } 44 | 45 | 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class OrderItemList {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(java.lang.Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/OrderList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * A list of orders. 24 | */ 25 | @ApiModel(description = "A list of orders.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 27 | public class OrderList extends ArrayList { 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | return super.equals(o); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode()); 43 | } 44 | 45 | 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class OrderList {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(java.lang.Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/PayWithAmazonEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of events related to the seller's Pay with Amazon account. 23 | */ 24 | @ApiModel(description = "A list of events related to the seller's Pay with Amazon account.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class PayWithAmazonEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class PayWithAmazonEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/PaymentExecutionDetailItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | 20 | import java.util.ArrayList; 21 | 22 | /** 23 | * A list of payment execution detail items. 24 | */ 25 | @ApiModel(description = "A list of payment execution detail items.") 26 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 27 | public class PaymentExecutionDetailItemList extends ArrayList { 28 | 29 | @Override 30 | public boolean equals(java.lang.Object o) { 31 | if (this == o) { 32 | return true; 33 | } 34 | if (o == null || getClass() != o.getClass()) { 35 | return false; 36 | } 37 | return super.equals(o); 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(super.hashCode()); 43 | } 44 | 45 | 46 | @Override 47 | public String toString() { 48 | StringBuilder sb = new StringBuilder(); 49 | sb.append("class PaymentExecutionDetailItemList {\n"); 50 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 51 | sb.append("}"); 52 | return sb.toString(); 53 | } 54 | 55 | /** 56 | * Convert the given object to string with each line indented by 4 spaces 57 | * (except the first line). 58 | */ 59 | private String toIndentedString(java.lang.Object o) { 60 | if (o == null) { 61 | return "null"; 62 | } 63 | return o.toString().replace("\n", "\n "); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/PaymentMethodDetailItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | import java.util.ArrayList; 20 | 21 | /** 22 | * A list of payment method detail items. 23 | */ 24 | @ApiModel(description = "A list of payment method detail items.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 26 | public class PaymentMethodDetailItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(java.lang.Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class PaymentMethodDetailItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(java.lang.Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ProductAdsPaymentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of sponsored products payment events. 23 | */ 24 | @ApiModel(description = "A list of sponsored products payment events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ProductAdsPaymentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ProductAdsPaymentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/PromotionIdList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Orders 3 | * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | import java.util.ArrayList; 20 | 21 | /** 22 | * A list of promotion identifiers provided by the seller when the promotions were created. 23 | */ 24 | @ApiModel(description = "A list of promotion identifiers provided by the seller when the promotions were created.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:23:41.622+08:00") 26 | public class PromotionIdList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(java.lang.Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class PromotionIdList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(java.lang.Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/PromotionList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of promotions. 23 | */ 24 | @ApiModel(description = "A list of promotions.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class PromotionList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class PromotionList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/RelationshipList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.RelationshipType; 19 | import io.swagger.annotations.ApiModel; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * A list of variation relationship information, if applicable for the item. 25 | */ 26 | @ApiModel(description = "A list of variation relationship information, if applicable for the item.") 27 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 28 | public class RelationshipList extends ArrayList { 29 | 30 | @Override 31 | public boolean equals(java.lang.Object o) { 32 | if (this == o) { 33 | return true; 34 | } 35 | if (o == null || getClass() != o.getClass()) { 36 | return false; 37 | } 38 | return super.equals(o); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(super.hashCode()); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class RelationshipList {\n"); 51 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 52 | sb.append("}"); 53 | return sb.toString(); 54 | } 55 | 56 | /** 57 | * Convert the given object to string with each line indented by 4 spaces 58 | * (except the first line). 59 | */ 60 | private String toIndentedString(java.lang.Object o) { 61 | if (o == null) { 62 | return "null"; 63 | } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/RemovalShipmentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of removal shipment event information. 23 | */ 24 | @ApiModel(description = "A list of removal shipment event information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class RemovalShipmentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class RemovalShipmentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/RemovalShipmentItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about removal shipment items. 23 | */ 24 | @ApiModel(description = "A list of information about removal shipment items.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class RemovalShipmentItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class RemovalShipmentItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/RentalTransactionEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of rental transaction event information. 23 | */ 24 | @ApiModel(description = "A list of rental transaction event information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class RentalTransactionEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class RentalTransactionEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ReportList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.ArrayList; 18 | 19 | /** 20 | * ReportList 21 | */ 22 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 23 | public class ReportList extends ArrayList { 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (this == o) { 28 | return true; 29 | } 30 | if (o == null || getClass() != o.getClass()) { 31 | return false; 32 | } 33 | return super.equals(o); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode()); 39 | } 40 | 41 | 42 | @Override 43 | public String toString() { 44 | StringBuilder sb = new StringBuilder(); 45 | sb.append("class ReportList {\n"); 46 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 47 | sb.append("}"); 48 | return sb.toString(); 49 | } 50 | 51 | /** 52 | * Convert the given object to string with each line indented by 4 spaces 53 | * (except the first line). 54 | */ 55 | private String toIndentedString(Object o) { 56 | if (o == null) { 57 | return "null"; 58 | } 59 | return o.toString().replace("\n", "\n "); 60 | } 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ReportOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | 18 | import io.swagger.annotations.ApiModel; 19 | import java.util.HashMap; 20 | 21 | /** 22 | * Additional information passed to reports. This varies by report type. 23 | */ 24 | @ApiModel(description = "Additional information passed to reports. This varies by report type.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 26 | public class ReportOptions extends HashMap { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ReportOptions {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ReportScheduleList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Reports 3 | * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses. 4 | * 5 | * OpenAPI spec version: 2020-09-04 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.ArrayList; 18 | 19 | /** 20 | * ReportScheduleList 21 | */ 22 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-10-27T15:24:14.274+08:00") 23 | public class ReportScheduleList extends ArrayList { 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (this == o) { 28 | return true; 29 | } 30 | if (o == null || getClass() != o.getClass()) { 31 | return false; 32 | } 33 | return super.equals(o); 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return Objects.hash(super.hashCode()); 39 | } 40 | 41 | 42 | @Override 43 | public String toString() { 44 | StringBuilder sb = new StringBuilder(); 45 | sb.append("class ReportScheduleList {\n"); 46 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 47 | sb.append("}"); 48 | return sb.toString(); 49 | } 50 | 51 | /** 52 | * Convert the given object to string with each line indented by 4 spaces 53 | * (except the first line). 54 | */ 55 | private String toIndentedString(Object o) { 56 | if (o == null) { 57 | return "null"; 58 | } 59 | return o.toString().replace("\n", "\n "); 60 | } 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/RetrochargeEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about Retrocharge or RetrochargeReversal events. 23 | */ 24 | @ApiModel(description = "A list of information about Retrocharge or RetrochargeReversal events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class RetrochargeEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class RetrochargeEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SAFETReimbursementEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of SAFETReimbursementEvents. 23 | */ 24 | @ApiModel(description = "A list of SAFETReimbursementEvents.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class SAFETReimbursementEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class SAFETReimbursementEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SAFETReimbursementItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of SAFETReimbursementItems. 23 | */ 24 | @ApiModel(description = "A list of SAFETReimbursementItems.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class SAFETReimbursementItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class SAFETReimbursementItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SalesRankList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Catalog Items 3 | * The Selling Partner API for Catalog Items helps you programmatically retrieve item details for items in the catalog. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import java.util.Objects; 17 | import java.util.Arrays; 18 | import cn.amazon.aws.rp.spapi.clients.model.SalesRankType; 19 | import io.swagger.annotations.ApiModel; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * A list of sales rank information for the item by category. 25 | */ 26 | @ApiModel(description = "A list of sales rank information for the item by category.") 27 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-12-16T17:41:56.163+08:00") 28 | public class SalesRankList extends ArrayList { 29 | 30 | @Override 31 | public boolean equals(java.lang.Object o) { 32 | if (this == o) { 33 | return true; 34 | } 35 | if (o == null || getClass() != o.getClass()) { 36 | return false; 37 | } 38 | return super.equals(o); 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return Objects.hash(super.hashCode()); 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("class SalesRankList {\n"); 51 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 52 | sb.append("}"); 53 | return sb.toString(); 54 | } 55 | 56 | /** 57 | * Convert the given object to string with each line indented by 4 spaces 58 | * (except the first line). 59 | */ 60 | private String toIndentedString(java.lang.Object o) { 61 | if (o == null) { 62 | return "null"; 63 | } 64 | return o.toString().replace("\n", "\n "); 65 | } 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SellerDealPaymentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of payment events for deal-related fees. 23 | */ 24 | @ApiModel(description = "A list of payment events for deal-related fees.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class SellerDealPaymentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class SellerDealPaymentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SellerReviewEnrollmentPaymentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about fee events for the Early Reviewer Program. 23 | */ 24 | @ApiModel(description = "A list of information about fee events for the Early Reviewer Program.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class SellerReviewEnrollmentPaymentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class SellerReviewEnrollmentPaymentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ServiceFeeEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about service fee events. 23 | */ 24 | @ApiModel(description = "A list of information about service fee events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ServiceFeeEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ServiceFeeEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ShipmentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of shipment event information. 23 | */ 24 | @ApiModel(description = "A list of shipment event information.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ShipmentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ShipmentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/ShipmentItemList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of shipment items. 23 | */ 24 | @ApiModel(description = "A list of shipment items.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class ShipmentItemList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class ShipmentItemList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/SolutionProviderCreditEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about solution provider credits. 23 | */ 24 | @ApiModel(description = "A list of information about solution provider credits.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class SolutionProviderCreditEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class SolutionProviderCreditEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/TDSReimbursementEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about tax deduction at source (TDS) claim reimbursement events. 23 | */ 24 | @ApiModel(description = "A list of information about tax deduction at source (TDS) claim reimbursement events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class TDSReimbursementEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class TDSReimbursementEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/TaxWithheldComponentList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about taxes withheld. 23 | */ 24 | @ApiModel(description = "A list of information about taxes withheld.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class TaxWithheldComponentList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class TaxWithheldComponentList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/clients/model/TrialShipmentEventList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Selling Partner API for Finances 3 | * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. 4 | * 5 | * OpenAPI spec version: v0 6 | * 7 | * 8 | * NOTE: This class is auto generated by the swagger code generator program. 9 | * https://github.com/swagger-api/swagger-codegen.git 10 | * Do not edit the class manually. 11 | */ 12 | 13 | 14 | package cn.amazon.aws.rp.spapi.clients.model; 15 | 16 | import io.swagger.annotations.ApiModel; 17 | 18 | import java.util.ArrayList; 19 | import java.util.Objects; 20 | 21 | /** 22 | * A list of information about trial shipment financial events. 23 | */ 24 | @ApiModel(description = "A list of information about trial shipment financial events.") 25 | @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-11-10T09:30:40.719+08:00") 26 | public class TrialShipmentEventList extends ArrayList { 27 | 28 | @Override 29 | public boolean equals(Object o) { 30 | if (this == o) { 31 | return true; 32 | } 33 | if (o == null || getClass() != o.getClass()) { 34 | return false; 35 | } 36 | return super.equals(o); 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return Objects.hash(super.hashCode()); 42 | } 43 | 44 | 45 | @Override 46 | public String toString() { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("class TrialShipmentEventList {\n"); 49 | sb.append(" ").append(toIndentedString(super.toString())).append("\n"); 50 | sb.append("}"); 51 | return sb.toString(); 52 | } 53 | 54 | /** 55 | * Convert the given object to string with each line indented by 4 spaces 56 | * (except the first line). 57 | */ 58 | private String toIndentedString(Object o) { 59 | if (o == null) { 60 | return "null"; 61 | } 62 | return o.toString().replace("\n", "\n "); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/constants/DateConstants.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.constants; 2 | 3 | /** 4 | * @description: 5 | * @className: DateConstants 6 | * @type: JAVA 7 | * @date: 2020/11/10 17:52 8 | * @author: zhangkui 9 | */ 10 | public class DateConstants { 11 | 12 | public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; 13 | 14 | 15 | public static final String DATE_FORMAT = "yyyy-MM-dd"; 16 | } 17 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/constants/SpApiConstants.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.constants; 2 | 3 | /** 4 | * @description: 5 | * @className: SpApiConstants 6 | * @type: JAVA 7 | * @date: 2020/11/10 17:47 8 | * @author: zhangkui 9 | */ 10 | public class SpApiConstants { 11 | 12 | public static final int PAGE_SIZE = 100; 13 | public static final String FAIL = "FAIL"; 14 | public static final String SUCCESS = "SUCCESS"; 15 | 16 | public static final int CODE_200 = 200; 17 | public static final int CODE_500 = 500; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/constants/TaskConstants.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.constants; 2 | 3 | 4 | /** 5 | * @description: 6 | * @className: TaskConstants 7 | * @type: JAVA 8 | * @date: 2020/11/11 19:17 9 | * @author: zhangkui 10 | */ 11 | public class TaskConstants { 12 | public static final String FULFILLED_SHIPMENT_REQUEST_REPORT = "fulfilled_shipment_request_report"; 13 | public static final String LIST_FINANCIAL_EVENTS = "list_financial_events"; 14 | } 15 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/IFinancesDao.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.model.FinancialEvents; 4 | import cn.amazon.aws.rp.spapi.clients.model.Marketplace; 5 | import cn.amazon.aws.rp.spapi.clients.model.MarketplaceParticipation; 6 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 7 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SpApiTask; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @description: 13 | * @className: IFinancesDao 14 | * @type: JAVA 15 | * @date: 2020/11/10 11:19 16 | * @author: zhangkui 17 | */ 18 | public interface IFinancesDao { 19 | void put(List financialEventsList, Marketplace marketplace, SellerCredentials sellerCredentials, SpApiTask apiTask); 20 | } 21 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/IOrdersDao.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.model.OrderList; 4 | 5 | public interface IOrdersDao { 6 | void put(OrderList orders, String sellerId); 7 | } 8 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/IReportsDao.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.model.MarketplaceParticipation; 4 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 5 | 6 | public interface IReportsDao { 7 | void put(String reportId, MarketplaceParticipation marketplace, SellerCredentials sellerCredentials); 8 | } 9 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/ISpApiSecretDao.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * This interface is try to easy the future effort of switching db. 9 | */ 10 | public interface ISpApiSecretDao { 11 | SellerCredentials getSecretsVOForSeller(String sellerId); 12 | 13 | List getSecretsVOForAllSeller(); 14 | 15 | void updateSellerCredentials(SellerCredentials sellerCredentials); 16 | } 17 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/ISpApiTaskDao.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SpApiTask; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @description: 9 | * @className: SpApiTaskDao 10 | * @type: JAVA 11 | * @date: 2020/11/11 14:22 12 | * @author: zhangkui 13 | */ 14 | public interface ISpApiTaskDao { 15 | List getTask(String sellerKey); 16 | 17 | void delTask(String sellerKey, String sellerId); 18 | 19 | void upTaskStatus(String sellerKey, String sellerId,int status); 20 | 21 | void addTask(SpApiTask spApiTaskVO); 22 | 23 | void addNewTask(SpApiTask spApiTask,String dateType,long space); 24 | } 25 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/entity/LWACredentials.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb.entity; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import lombok.NonNull; 6 | 7 | @Data 8 | @Builder 9 | public class LWACredentials { 10 | @NonNull 11 | private String clientId; 12 | @NonNull 13 | private String clientSecret; 14 | } 15 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/dynamodb/entity/SpApiTask.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb.entity; 2 | 3 | import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute; 4 | import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; 5 | import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey; 6 | import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @description: 12 | * @className: SpApiTaskVO 13 | * @type: JAVA 14 | * @date: 2020/11/11 14:23 15 | * @author: zhangkui 16 | */ 17 | @DynamoDBTable(tableName = "sp_api_task") 18 | public class SpApiTask implements Serializable { 19 | 20 | private static final long serialVersionUID = -1733076134344051030L; 21 | @DynamoDBHashKey 22 | private String sellerKey; 23 | @DynamoDBRangeKey 24 | private String sellerId; 25 | @DynamoDBAttribute 26 | private Long taskId; 27 | @DynamoDBAttribute 28 | private String taskName; 29 | @DynamoDBAttribute 30 | private Integer executeStatus; 31 | @DynamoDBAttribute 32 | private String startTime; 33 | @DynamoDBAttribute 34 | private String endTime; 35 | 36 | public String getSellerId() { 37 | return sellerId; 38 | } 39 | 40 | public void setSellerId(String sellerId) { 41 | this.sellerId = sellerId; 42 | } 43 | 44 | public Long getTaskId() { 45 | return taskId; 46 | } 47 | 48 | public void setTaskId(Long taskId) { 49 | this.taskId = taskId; 50 | } 51 | 52 | public String getTaskName() { 53 | return taskName; 54 | } 55 | 56 | public void setTaskName(String taskName) { 57 | this.taskName = taskName; 58 | } 59 | 60 | public Integer getExecuteStatus() { 61 | return executeStatus; 62 | } 63 | 64 | public void setExecuteStatus(Integer executeStatus) { 65 | this.executeStatus = executeStatus; 66 | } 67 | 68 | public String getStartTime() { 69 | return startTime; 70 | } 71 | 72 | public void setStartTime(String startTime) { 73 | this.startTime = startTime; 74 | } 75 | 76 | public String getEndTime() { 77 | return endTime; 78 | } 79 | 80 | public void setEndTime(String endTime) { 81 | this.endTime = endTime; 82 | } 83 | 84 | public String getSellerKey() { 85 | return sellerKey; 86 | } 87 | 88 | public void setSellerKey(String sellerKey) { 89 | this.sellerKey = sellerKey; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/AppstoreEndpoint.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | public enum AppstoreEndpoint { 4 | NA("us-east-1","https://sellingpartnerapi-na.amazon.com"), 5 | EU("eu-west-1","https://sellingpartnerapi-eu.amazon.com"), 6 | FE("us-west-2","https://sellingpartnerapi-fe.amazon.com"); 7 | 8 | String endpoint; 9 | String region; 10 | AppstoreEndpoint(String region, String endpoint){ 11 | this.endpoint = endpoint; 12 | this.region = region; 13 | } 14 | 15 | public String getEndpoint() { 16 | return endpoint; 17 | } 18 | 19 | public String getRegion() { 20 | return region; 21 | } 22 | 23 | public static AppstoreEndpoint fromRegion(String region) { 24 | for (AppstoreEndpoint b : AppstoreEndpoint.values()) { 25 | if (b.region.equalsIgnoreCase(region)) { 26 | return b; 27 | } 28 | } 29 | throw new RuntimeException("The Region of appstore is not support"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/DateType.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | /** 4 | * @description: 5 | * @className: DateType 6 | * @type: JAVA 7 | * @date: 2020/11/12 19:41 8 | * @author: zhangkui 9 | */ 10 | public enum DateType { 11 | DAYS, 12 | HOURS, 13 | MINUTES, 14 | MONTHS, 15 | NANOS, 16 | SECONDS, 17 | WEEKS, 18 | YEARS, 19 | ; 20 | } 21 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/ReportStatusEnum.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | /** 4 | * @description: 5 | * @className: ReportTypeEnum 6 | * @type: JAVA 7 | * @date: 2020/11/10 20:02 8 | * @author: zhangkui 9 | */ 10 | public enum ReportStatusEnum { 11 | CANCELLED, 12 | DONE, 13 | FATAL, 14 | IN_PROGRESS, 15 | IN_QUEUE 16 | } 17 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/ReportTypeEnum.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | /** 4 | * @description: 5 | * @className: ReportTypeEnum 6 | * @type: JAVA 7 | * @date: 2020/11/10 20:02 8 | * @author: zhangkui 9 | */ 10 | public enum ReportTypeEnum { 11 | /*** FBA Amazon Fulfilled Shipments Report */ 12 | _GET_AMAZON_FULFILLED_SHIPMENTS_DATA_, 13 | } 14 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/ShipmentType.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | /** 4 | * @description: 5 | * @className: ShipmentType 6 | * @type: JAVA 7 | * @date: 2020/11/10 16:23 8 | * @author: zhangkui 9 | */ 10 | public enum ShipmentType { 11 | shipment, 12 | refund, 13 | guaranteeClaim, 14 | chargeback, 15 | ; 16 | } 17 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/enums/StatusEnum.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.enums; 2 | 3 | /** 4 | * @description: 5 | * @className: StatusEnums 6 | * @type: JAVA 7 | * @date: 2020/11/11 11:57 8 | * @author: zhangkui 9 | */ 10 | public enum StatusEnum { 11 | 12 | INIT(0, "INIT"), 13 | WORKING(1, "WORKING"), 14 | COMPLETE(2, "COMPLETE"); 15 | 16 | private Integer status; 17 | 18 | private String desc; 19 | 20 | StatusEnum(Integer status, String desc) { 21 | this.status = status; 22 | this.desc = desc; 23 | } 24 | 25 | public Integer getStatus() { 26 | return status; 27 | } 28 | 29 | public String getDesc() { 30 | return desc; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/finances/FinancesEventsApiInvoker.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.finances; 2 | 3 | import cn.amazon.aws.rp.spapi.constants.DateConstants; 4 | import cn.amazon.aws.rp.spapi.constants.SpApiConstants; 5 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 6 | import cn.amazon.aws.rp.spapi.clients.ApiException; 7 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 8 | import cn.amazon.aws.rp.spapi.clients.api.FinancesApi; 9 | import cn.amazon.aws.rp.spapi.clients.model.ListFinancialEventsResponse; 10 | import org.threeten.bp.LocalDateTime; 11 | import org.threeten.bp.OffsetDateTime; 12 | import org.threeten.bp.ZoneOffset; 13 | import org.threeten.bp.format.DateTimeFormatter; 14 | 15 | import java.util.Map; 16 | 17 | /** 18 | * @description: 19 | * @className: FinancesEventsApiInvoker 20 | * @type: JAVA 21 | * @date: 2020/11/10 10:48 22 | * @author: zhangkui 23 | */ 24 | public class FinancesEventsApiInvoker implements Invokable{ 25 | 26 | private final FinancesApi api; 27 | 28 | public FinancesEventsApiInvoker(FinancesApi api){ 29 | this.api = api; 30 | } 31 | 32 | @Override 33 | public ApiResponse invoke(Map input) throws ApiException { 34 | final String postedAfter = (String) input.get("postedAfter"); 35 | final String postedBefore = (String) input.get("postedBefore"); 36 | final String nextToken = (String) input.get("nextToken"); 37 | return api.listFinancialEventsWithHttpInfo( 38 | SpApiConstants.PAGE_SIZE 39 | , OffsetDateTime.of(LocalDateTime.parse(postedAfter, DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC) 40 | , OffsetDateTime.of(LocalDateTime.parse(postedBefore, DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC) 41 | , nextToken); 42 | } 43 | 44 | @Override 45 | public String getRateLimiterNameSuffix() { 46 | return FinancesEventsApiInvoker.class.getName(); 47 | } 48 | 49 | public static void main(String[] args) { 50 | System.out.println(OffsetDateTime.of(LocalDateTime.parse("2020-11-01 00:00:00", DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/notification/EventCreateDestination.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.notification; 2 | 3 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 4 | import cn.amazon.aws.rp.spapi.clients.ApiException; 5 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 6 | import cn.amazon.aws.rp.spapi.clients.api.NotificationsApi; 7 | import cn.amazon.aws.rp.spapi.clients.model.CreateDestinationRequest; 8 | import cn.amazon.aws.rp.spapi.clients.model.CreateDestinationResponse; 9 | 10 | import java.util.Map; 11 | 12 | public class EventCreateDestination implements Invokable { 13 | private final NotificationsApi api; 14 | 15 | public EventCreateDestination(NotificationsApi api) { 16 | this.api = api; 17 | } 18 | 19 | @Override 20 | public ApiResponse invoke(Map input) throws ApiException { 21 | return api.createDestinationWithHttpInfo( 22 | (CreateDestinationRequest) input.get("createDestinationRequest")); 23 | } 24 | 25 | @Override 26 | public String getRateLimiterNameSuffix() { 27 | return EventCreateDestination.class.getCanonicalName(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/notification/EventCreateSubscription.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.notification; 2 | 3 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 4 | import cn.amazon.aws.rp.spapi.clients.ApiException; 5 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 6 | import cn.amazon.aws.rp.spapi.clients.api.NotificationsApi; 7 | import cn.amazon.aws.rp.spapi.clients.model.CreateSubscriptionRequest; 8 | import cn.amazon.aws.rp.spapi.clients.model.CreateSubscriptionResponse; 9 | 10 | import java.util.Map; 11 | 12 | public class EventCreateSubscription implements Invokable { 13 | private final NotificationsApi api; 14 | 15 | public EventCreateSubscription(NotificationsApi api) { 16 | this.api = api; 17 | } 18 | 19 | @Override 20 | public ApiResponse invoke(Map input) throws ApiException { 21 | final CreateSubscriptionRequest createSubscriptionRequest = 22 | (CreateSubscriptionRequest) input.get("createSubscriptionRequest"); 23 | final String notificationType = (String) input.get("notificationType"); 24 | return api.createSubscriptionWithHttpInfo(createSubscriptionRequest, notificationType); 25 | } 26 | 27 | @Override 28 | public String getRateLimiterNameSuffix() { 29 | return EventCreateDestination.class.getCanonicalName(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/report/FulfilledShipmentsGetReportApiInvoker.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.report; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.ApiException; 4 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 5 | import cn.amazon.aws.rp.spapi.clients.api.ReportsApi; 6 | import cn.amazon.aws.rp.spapi.clients.model.GetReportResponse; 7 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @description: 生成报告计划 13 | * @className: FulfilledShipmentsRequestReport 14 | * @type: JAVA 15 | * @date: 2020/11/10 19:55 16 | * @author: zhangkui 17 | */ 18 | public class FulfilledShipmentsGetReportApiInvoker implements Invokable { 19 | 20 | private final ReportsApi api; 21 | 22 | public FulfilledShipmentsGetReportApiInvoker(ReportsApi api){ 23 | this.api = api; 24 | } 25 | 26 | @Override 27 | public ApiResponse invoke(Map input) throws ApiException { 28 | return null; 29 | } 30 | 31 | @Override 32 | public String getRateLimiterNameSuffix() { 33 | return FulfilledShipmentsGetReportApiInvoker.class.getName(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/report/FulfilledShipmentsRequestReportApiInvoker.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.report; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.ApiException; 4 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 5 | import cn.amazon.aws.rp.spapi.clients.api.ReportsApi; 6 | import cn.amazon.aws.rp.spapi.clients.model.CreateReportResponse; 7 | import cn.amazon.aws.rp.spapi.clients.model.CreateReportSpecification; 8 | import cn.amazon.aws.rp.spapi.constants.DateConstants; 9 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 10 | import org.threeten.bp.LocalDateTime; 11 | import org.threeten.bp.OffsetDateTime; 12 | import org.threeten.bp.ZoneOffset; 13 | import org.threeten.bp.format.DateTimeFormatter; 14 | 15 | import java.util.Map; 16 | 17 | /** 18 | * @description: 生成报告计划 19 | * @className: FulfilledShipmentsRequestReport 20 | * @type: JAVA 21 | * @date: 2020/11/10 19:55 22 | * @author: zhangkui 23 | */ 24 | public class FulfilledShipmentsRequestReportApiInvoker implements Invokable { 25 | 26 | private final ReportsApi api; 27 | 28 | public FulfilledShipmentsRequestReportApiInvoker(ReportsApi api){ 29 | this.api = api; 30 | } 31 | 32 | @Override 33 | public ApiResponse invoke(Map input) throws ApiException { 34 | CreateReportSpecification specification = new CreateReportSpecification(); 35 | final String startTime = (String) input.get("startTime"); 36 | final String endTime = (String) input.get("endTime"); 37 | final String reportType = (String) input.get("reportType"); 38 | specification.setReportType(reportType); 39 | specification.setDataStartTime(OffsetDateTime.of(LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC)); 40 | specification.setDataEndTime(OffsetDateTime.of(LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC)); 41 | return api.createReportWithHttpInfo(specification); 42 | } 43 | 44 | @Override 45 | public String getRateLimiterNameSuffix() { 46 | return FulfilledShipmentsRequestReportApiInvoker.class.getName(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/invoker/seller/SellerGetMarketParticipation.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.invoker.seller; 2 | 3 | import cn.amazon.aws.rp.spapi.lambda.requestlimiter.Invokable; 4 | import cn.amazon.aws.rp.spapi.clients.ApiException; 5 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 6 | import cn.amazon.aws.rp.spapi.clients.api.SellersApi; 7 | import cn.amazon.aws.rp.spapi.clients.model.GetMarketplaceParticipationsResponse; 8 | 9 | import java.util.Map; 10 | 11 | public class SellerGetMarketParticipation 12 | implements Invokable { 13 | 14 | private final SellersApi api; 15 | 16 | public SellerGetMarketParticipation(SellersApi api) { 17 | 18 | this.api = api; 19 | } 20 | 21 | @Override 22 | public ApiResponse invoke(Map input) throws ApiException { 23 | 24 | return api.getMarketplaceParticipationsWithHttpInfo(); 25 | } 26 | 27 | @Override 28 | public String getRateLimiterNameSuffix() { 29 | return SellerGetMarketParticipation.class.getCanonicalName(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/finances/GetAllSellerCredentialsAndPullFinances.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.finances; 2 | 3 | import cn.amazon.aws.rp.spapi.constants.SpApiConstants; 4 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 5 | import cn.amazon.aws.rp.spapi.dynamodb.impl.SpApiSecretDao; 6 | import cn.amazon.aws.rp.spapi.utils.Helper; 7 | import cn.amazon.aws.rp.spapi.utils.Utils; 8 | import com.amazonaws.services.lambda.runtime.Context; 9 | import com.amazonaws.services.lambda.runtime.RequestHandler; 10 | import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; 11 | import com.google.gson.Gson; 12 | import com.google.gson.GsonBuilder; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | import java.util.*; 16 | 17 | /** 18 | * @description: Retrieve jobs/tasks (time span to query) from DDB. And start new Lambda to work on the jobs. 19 | * Job status is synchronized on DB as well. 20 | * @className: FinancesEventsList 21 | * @type: JAVA 22 | * @date: 2020/11/10 11:07 23 | * @author: zhangkui 24 | */ 25 | public class GetAllSellerCredentialsAndPullFinances implements RequestHandler { 26 | 27 | private static final Logger logger = LoggerFactory.getLogger(GetAllSellerCredentialsAndPullFinances.class); 28 | private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); 29 | 30 | @Override 31 | public String handleRequest(ScheduledEvent input, Context context) { 32 | String jsonSellerSecrets = input != null ? gson.toJson(input) : "{}"; 33 | //get seller 34 | List sellerCredentials = SpApiSecretDao.getSellerCredentials(); 35 | if (sellerCredentials.isEmpty()) { 36 | return SpApiConstants.SUCCESS; 37 | } 38 | Helper.logInput(logger, jsonSellerSecrets, context, gson); 39 | sellerCredentials.forEach(credentials -> { 40 | 41 | // Start the job in another lambda. 42 | logger.info("start pull payment info for a seller: " +credentials.getSeller_id()); 43 | // Get the function name from environment which is set by CDK. 44 | final String funcName = Utils.getEnv("getFinancesListForOneSellerFuncName"); 45 | Helper.invokeLambda(funcName, gson.toJson(credentials), true); 46 | logger.info("Lambda Started."); 47 | }); 48 | return SpApiConstants.SUCCESS; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/log/SQSLogOnly.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.log; 2 | 3 | import cn.amazon.aws.rp.spapi.constants.SpApiConstants; 4 | import cn.amazon.aws.rp.spapi.utils.Helper; 5 | import com.amazonaws.services.lambda.runtime.Context; 6 | import com.amazonaws.services.lambda.runtime.RequestHandler; 7 | import com.amazonaws.services.lambda.runtime.events.SQSEvent; 8 | import com.google.gson.Gson; 9 | import com.google.gson.GsonBuilder; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | 13 | public class SQSLogOnly implements RequestHandler { 14 | 15 | private static final Logger logger = LoggerFactory.getLogger(SQSLogOnly.class); 16 | private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); 17 | 18 | @Override 19 | public Integer handleRequest(SQSEvent input, Context context) { 20 | Helper.logInput(logger, input, context, gson); 21 | return SpApiConstants.CODE_200; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/order/GetOneNewOrder.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.order; 2 | 3 | import com.amazonaws.services.lambda.runtime.Context; 4 | import com.amazonaws.services.lambda.runtime.RequestHandler; 5 | import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; 6 | import com.google.gson.Gson; 7 | import com.google.gson.GsonBuilder; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import static cn.amazon.aws.rp.spapi.utils.Helper.logInput; 12 | 13 | /** 14 | * Deprecated - this function is supposed to use with notification API. We don't implement it for now. 15 | * 16 | * Invocation chain: 17 | * EventBridge Timer -> GetAllSellerCredentialsAndPull -> GetOrderListForOneSeller -> event bus -> here 18 | * 19 | * Responsibility: 20 | * Get one order and save it to db. 21 | */ 22 | @Deprecated public class GetOneNewOrder implements RequestHandler { 23 | 24 | private static final Logger logger = LoggerFactory.getLogger(GetOneNewOrder.class); 25 | private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); 26 | 27 | public GetOneNewOrder() { 28 | } 29 | 30 | @Override 31 | public String handleRequest(ScheduledEvent input, Context context) { 32 | 33 | logger.debug("start"); 34 | logInput(logger, input, context, gson); 35 | 36 | // final Order order = gson.fromJson(input.getDetail(), Order.class); 37 | // 38 | // // Remove prefix, only keep the sellerID. see OrderReceivedEventGenerator. 39 | // String sellerId = input.getDetailType().replace(OrderReceivedEventGenerator.DETAIL_TYPE_NEW_ORDER, ""); 40 | // final OrdersApi ordersApi = Helper.buildOrdersApi(sellerId); 41 | // ordersApi.getOrder(order.getAmazonOrderId()); 42 | 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/report/FulfilledShipmentsGetReport.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.report; 2 | 3 | /** 4 | * @description: 5 | * @className: FulfilledShipmentsGetReport 6 | * @type: JAVA 7 | * @date: 2020/11/10 20:11 8 | * @author: zhangkui 9 | */ 10 | public class FulfilledShipmentsGetReport { 11 | } 12 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/requestlimiter/Invokable.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.requestlimiter; 2 | 3 | 4 | import cn.amazon.aws.rp.spapi.clients.ApiException; 5 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * All SP APIs need to be wrapped with the interface and use ApiProxy to invoke. 11 | * @param 12 | */ 13 | public interface Invokable { 14 | 15 | /** 16 | * Convention for input - The key in map is the name of the parameter of the api call. 17 | * Handle multiple params https://stackoverflow.com/a/8716845 18 | * @param input 19 | * @return 20 | */ 21 | ApiResponse invoke(Map input) throws ApiException; 22 | 23 | /** 24 | * More invokables can share one rate limiter if they return the same limiter name. 25 | * @return 26 | */ 27 | String getRateLimiterNameSuffix(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/requestlimiter/RateException.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.requestlimiter; 2 | 3 | /** 4 | * If SP API return 429 in HTTP status code then we have to throw this exception. 5 | * API Proxy will catch this exception and retry. 6 | */ 7 | public class RateException extends Exception{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/lambda/vo/OrdersWithSeller.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.vo; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.model.OrderList; 4 | 5 | public class OrdersWithSeller { 6 | 7 | private OrderList orders; 8 | private String sellerId; 9 | 10 | public OrdersWithSeller(OrderList orders, String sellerId) { 11 | this.orders = orders; 12 | this.sellerId = sellerId; 13 | } 14 | 15 | public OrderList getOrders() { 16 | return orders; 17 | } 18 | 19 | public void setOrders(OrderList orders) { 20 | this.orders = orders; 21 | } 22 | 23 | public String getSellerId() { 24 | return sellerId; 25 | } 26 | 27 | public void setSellerId(String sellerId) { 28 | this.sellerId = sellerId; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/utils/AbPair.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.utils; 2 | 3 | public class AbPair { 4 | private A a; 5 | private B b; 6 | 7 | public AbPair(A a, B b) { 8 | this.a = a; 9 | this.b = b; 10 | } 11 | 12 | public A getA() { 13 | return a; 14 | } 15 | 16 | public void setA(A a) { 17 | this.a = a; 18 | } 19 | 20 | public B getB() { 21 | return b; 22 | } 23 | 24 | public void setB(B b) { 25 | this.b = b; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lambda/src/main/java/cn/amazon/aws/rp/spapi/utils/Utils.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.utils; 2 | 3 | import java.util.Collection; 4 | 5 | public class Utils { 6 | public static String getEnv(String name){ 7 | return System.getenv(name); 8 | } 9 | 10 | public static String getEnv(String name, String value) { 11 | String val = System.getenv(name); 12 | return val == null ? value : val; 13 | } 14 | 15 | public static boolean isNullOrEmpty(Collection list) { 16 | return list == null || list.isEmpty(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lambda/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %X{AWSRequestId} %-5p %c{1} - %m%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/clients/api/CatalogApiIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.clients.api; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.ApiException; 4 | import cn.amazon.aws.rp.spapi.clients.model.GetCatalogItemResponse; 5 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 6 | import org.junit.Ignore; 7 | import org.junit.jupiter.api.Test; 8 | 9 | import static org.junit.jupiter.api.Assertions.*; 10 | 11 | @Ignore 12 | class CatalogApiIT { 13 | 14 | @Test 15 | void buildCatalogApi() throws NoSuchFieldException, IllegalAccessException, ApiException { 16 | SellerCredentials credentials = new SellerCredentials(); 17 | credentials.setLWAAuthorizationCredentials_refreshToken("Atzr|IwEBIJ27mtx3w0pHV9Rc8TLfmcGX2yEQnC27-88Ya_uI8FqOdAXrdCTzJucIhj1nc-XHkHNxRbBosXdF33nJtDYOQYvql_FGwYBmPMAmu24YybdD3BblXut81LxL6HKTzfF2Ebgi_lF-KmHSxoz4glZCgH8a-2jbOZJbnvJKb_bAZLxWfsgLawhqlHrhyhpSoCAclVfvFGzWG2Wv1hJDgSV2ggMf-4Y26TJ58rM-gMLuL4ipjeOG7QWb7pLcdgcly5XiMuLJLGNVf8h_1-OznfgFgnroYrORlRRkCQkfdheDO_BT0BNj0GPm3bX5u3wsY9go4To"); 18 | credentials.setSeller_id("seller_jim"); 19 | 20 | CatalogApi catalogApi = CatalogApi.buildCatalogApi(credentials); 21 | GetCatalogItemResponse getCatalogItemResponse = catalogApi.getCatalogItem("ATVPDKIKX0DER","B0892F2531"); 22 | System.out.println(getCatalogItemResponse.getPayload()); 23 | } 24 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/clients/api/FinancesApiIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.clients.api; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.ApiException; 4 | import cn.amazon.aws.rp.spapi.clients.model.GetCatalogItemResponse; 5 | import cn.amazon.aws.rp.spapi.clients.model.ListFinancialEventsResponse; 6 | import cn.amazon.aws.rp.spapi.constants.DateConstants; 7 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 8 | import org.junit.jupiter.api.Test; 9 | import org.threeten.bp.LocalDateTime; 10 | import org.threeten.bp.OffsetDateTime; 11 | import org.threeten.bp.ZoneOffset; 12 | import org.threeten.bp.format.DateTimeFormatter; 13 | 14 | import static org.junit.jupiter.api.Assertions.*; 15 | 16 | class FinancesApiIT { 17 | 18 | @Test 19 | void buildFinancesApi() throws NoSuchFieldException, IllegalAccessException, ApiException { 20 | SellerCredentials credentials = new SellerCredentials(); 21 | credentials.setLWAAuthorizationCredentials_refreshToken("Atzr|IwEBIJ27mtx3w0pHV9Rc8TLfmcGX2yEQnC27-88Ya_uI8FqOdAXrdCTzJucIhj1nc-XHkHNxRbBosXdF33nJtDYOQYvql_FGwYBmPMAmu24YybdD3BblXut81LxL6HKTzfF2Ebgi_lF-KmHSxoz4glZCgH8a-2jbOZJbnvJKb_bAZLxWfsgLawhqlHrhyhpSoCAclVfvFGzWG2Wv1hJDgSV2ggMf-4Y26TJ58rM-gMLuL4ipjeOG7QWb7pLcdgcly5XiMuLJLGNVf8h_1-OznfgFgnroYrORlRRkCQkfdheDO_BT0BNj0GPm3bX5u3wsY9go4To"); 22 | credentials.setSeller_id("seller_jim"); 23 | 24 | FinancesApi financesApi = FinancesApi.buildFinancesApi(credentials); 25 | ListFinancialEventsResponse listFinancialEventsResponse= financesApi.listFinancialEvents(10, 26 | OffsetDateTime.of(LocalDateTime.parse("2020-08-02 06:34:36", DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC), 27 | OffsetDateTime.of(LocalDateTime.parse("2020-09-02 06:34:36", DateTimeFormatter.ofPattern(DateConstants.DATE_TIME_FORMAT)), ZoneOffset.UTC), 28 | ""); 29 | System.out.println(listFinancialEventsResponse.getPayload()); 30 | } 31 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/clients/api/SPAPIBuilderTest.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.clients.api; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.LWACredentials; 4 | import cn.amazon.aws.rp.spapi.utils.Utils; 5 | 6 | import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement; 7 | import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClientBuilder; 8 | import com.amazonaws.services.simplesystemsmanagement.model.GetParameterRequest; 9 | import com.google.gson.Gson; 10 | import com.google.gson.GsonBuilder; 11 | import org.junit.Ignore; 12 | import org.junit.Test; 13 | 14 | import static org.junit.jupiter.api.Assertions.*; 15 | 16 | public class SPAPIBuilderTest { 17 | private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); 18 | 19 | 20 | @Test 21 | @Ignore 22 | public void testStatic() { 23 | String lwaCredentialsJson = "{\n" + 24 | " \"clientId\": \"amzn1.application-oa2-client.XXX\",\n" + 25 | " \"clientSecret\": \"XXX\"\n" + 26 | "}"; 27 | LWACredentials lwaCredentials = gson.fromJson(lwaCredentialsJson, LWACredentials.class); 28 | assertNotNull(lwaCredentials); 29 | 30 | // AWSSimpleSystemsManagement simpleSystemsManagementClient = AWSSimpleSystemsManagementClientBuilder.defaultClient(); 31 | // 32 | // lwaCredentialsJson = simpleSystemsManagementClient.getParameter(new GetParameterRequest() 33 | // .withName(Utils.getEnv("SELLER_CENTRAL_APP_CREDENTIALS","seller_central_app_credentials")). 34 | // withWithDecryption(true)).getParameter().getValue(); 35 | // lwaCredentials = gson.fromJson(lwaCredentialsJson, LWACredentials.class); 36 | // assertNotNull(lwaCredentials); 37 | } 38 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/dynamodb/ApiTaskIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.common.IdWorker; 4 | import cn.amazon.aws.rp.spapi.constants.TaskConstants; 5 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SpApiTask; 6 | import cn.amazon.aws.rp.spapi.dynamodb.impl.SpApiTaskDao; 7 | import cn.amazon.aws.rp.spapi.enums.StatusEnum; 8 | import org.junit.Ignore; 9 | import org.junit.Test; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @description: 15 | * @className: ApiTaskTest 16 | * @type: JAVA 17 | * @date: 2020/11/11 14:41 18 | * @author: zhangkui 19 | */ 20 | @Ignore 21 | public class ApiTaskIT { 22 | private static final SpApiTaskDao spApiTaskDaoDdb = new SpApiTaskDao(); 23 | private static final IdWorker idWorker = new IdWorker(); 24 | 25 | @Test 26 | public void getTask() { 27 | List spApiTaskVOS = spApiTaskDaoDdb.getTask("A1HILDQKN3MNZ9_1_fulfilled_shipment_request_report"); 28 | spApiTaskVOS.forEach(spApiTaskVO -> { 29 | System.out.println(spApiTaskVO.getSellerKey()); 30 | System.out.println(spApiTaskVO.getStartTime()); 31 | }); 32 | } 33 | 34 | @Test 35 | public void delTask() { 36 | spApiTaskDaoDdb.delTask("A1HILDQKN3MNZ9_0_fulfilled_shipment_request_report", "A1HILDQKN3MNZ9"); 37 | } 38 | 39 | @Test 40 | public void addTask() { 41 | String taskName = TaskConstants.LIST_FINANCIAL_EVENTS; 42 | String sellerId = "seller_tom"; 43 | SpApiTask task = new SpApiTask(); 44 | task.setSellerKey(sellerId + "_" + taskName); 45 | task.setSellerId(sellerId); 46 | task.setStartTime("2020-08-01 00:00:00"); 47 | task.setEndTime("2020-08-02 00:00:00"); 48 | task.setTaskId(idWorker.nextId()); 49 | task.setTaskName(taskName); 50 | task.setExecuteStatus(StatusEnum.INIT.getStatus()); 51 | spApiTaskDaoDdb.addTask(task); 52 | } 53 | 54 | @Test 55 | public void upTask() { 56 | String taskName = TaskConstants.LIST_FINANCIAL_EVENTS; 57 | String sellerId = "A1HILDQKN3MNZ9"; 58 | spApiTaskDaoDdb.upTaskStatus(sellerId + "_" + taskName, sellerId, StatusEnum.INIT.getStatus()); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/dynamodb/CreateSampleSecretsIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | 4 | import com.amazonaws.AmazonServiceException; 5 | import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; 6 | import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder; 7 | import com.amazonaws.services.dynamodbv2.model.AttributeValue; 8 | import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException; 9 | 10 | import java.util.HashMap; 11 | 12 | /** 13 | * This class will save default secrets to DDB. It can optional done by adding from console. 14 | */ 15 | public class CreateSampleSecretsIT { 16 | 17 | private static final AmazonDynamoDB DDB = AmazonDynamoDBClientBuilder.standard().build(); 18 | private static final String TABLE_NAME = "spapi-secrets"; 19 | 20 | public void putItem(String tableName, String sellerID) { 21 | 22 | HashMap item_values = new HashMap(); 23 | 24 | item_values.put("seller_id", 25 | new AttributeValue(sellerID)); 26 | 27 | item_values.put("aWSAuthenticationCredentials_AK", 28 | new AttributeValue("")); 29 | item_values.put("aWSAuthenticationCredentials_SK", 30 | new AttributeValue("")); 31 | item_values.put("aWSAuthenticationCredentialsProvider_roleArn", 32 | new AttributeValue("")); 33 | item_values.put("lWAAuthorizationCredentials_clientid", 34 | new AttributeValue("")); 35 | item_values.put("lWAAuthorizationCredentials_clientSecret", 36 | new AttributeValue("b30deeb80824ac0685fedb0b01e99d28d6ee7a2973baedb25f3875dd704107fc")); 37 | item_values.put("lWAAuthorizationCredentials_refreshToken", 38 | new AttributeValue("")); 39 | 40 | try { 41 | DDB.putItem(tableName, item_values); 42 | } catch (ResourceNotFoundException e) { 43 | System.err.format("Error: The table \"%s\" can't be found.\n", tableName); 44 | System.err.println("Be sure that it exists and that you've typed its name correctly!"); 45 | } catch (AmazonServiceException e) { 46 | System.err.println("ERROR!!"); 47 | System.err.println(e.getMessage()); 48 | } catch (Exception e) { 49 | System.err.println("ERROR!"); 50 | System.err.println(e.getMessage()); 51 | } 52 | System.out.println("Done!"); 53 | } 54 | 55 | // public static void main(String[] args) { 56 | // final CreateSampleSecrets ddb = new CreateSampleSecrets(); 57 | //// ddb.putItem(TABLE_NAME, "seller_jim"); 58 | // ddb.putItem(TABLE_NAME, "seller_tom"); 59 | // System.out.println("hello"); 60 | // } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/dynamodb/OrdersDaoDdbIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.model.Order; 4 | import cn.amazon.aws.rp.spapi.clients.model.OrderList; 5 | import cn.amazon.aws.rp.spapi.dynamodb.impl.OrdersDao; 6 | import org.junit.Ignore; 7 | import org.junit.Test; 8 | 9 | public class OrdersDaoDdbIT { 10 | 11 | @Test 12 | @Ignore 13 | public void put() { 14 | final OrdersDao ordersDaoDdb = new OrdersDao(); 15 | Order o1 = new Order(); 16 | Order o2 = new Order(); 17 | Order o3 = new Order(); 18 | Order o4 = new Order(); 19 | Order o5 = new Order(); 20 | 21 | o1 = o1.amazonOrderId("1"); 22 | o2 = o2.amazonOrderId("2"); 23 | o3 = o3.amazonOrderId("3"); 24 | o4 = o4.amazonOrderId("4"); 25 | o5 = o5.amazonOrderId("5"); 26 | 27 | final OrderList orders = new OrderList(); 28 | 29 | orders.add(o1); 30 | orders.add(o2); 31 | orders.add(o3); 32 | orders.add(o4); 33 | orders.add(o5); 34 | ordersDaoDdb.put(orders, "sellerJim"); 35 | } 36 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/dynamodb/SellerCredentialsTest.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | import org.junit.Test; 7 | 8 | import static org.junit.Assert.*; 9 | 10 | public class SellerCredentialsTest { 11 | 12 | private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); 13 | @Test 14 | public void testGsonConvert() { 15 | final SellerCredentials sellerCredentials = new SellerCredentials(); 16 | sellerCredentials.setSeller_id("test"); 17 | // sellerCredentials.setAWSAuthenticationCredentials_AK("ak"); 18 | // sellerCredentials.setAWSAuthenticationCredentials_SK("sk"); 19 | // sellerCredentials.setAWSAuthenticationCredentialsProvider_roleArn("arn"); 20 | final SellerCredentials sellerCredentials1 = gson.fromJson(gson.toJson(sellerCredentials), SellerCredentials.class); 21 | 22 | assertEquals(sellerCredentials.getSeller_id(), sellerCredentials1.getSeller_id()); 23 | // assertEquals(sellerCredentials.getAWSAuthenticationCredentials_AK(), sellerCredentials1.getAWSAuthenticationCredentials_AK()); 24 | // assertEquals(sellerCredentials.getAWSAuthenticationCredentials_SK(), sellerCredentials1.getAWSAuthenticationCredentials_SK()); 25 | } 26 | 27 | @Test 28 | public void testSplit() { 29 | 30 | int size =17; 31 | final int batch = size / 10; 32 | final int left = size % 10; 33 | for (int i = 0; i < batch; i++) { 34 | System.out.println(">>> from " + i * 10 + ",to " + (i + 1) * 10); 35 | } 36 | System.out.println(">>> left "+ left); 37 | System.out.println(">>> exit"); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/dynamodb/SpApiSecretDaoDdbIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.dynamodb; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 4 | import cn.amazon.aws.rp.spapi.dynamodb.impl.SpApiSecretDao; 5 | import com.amazonaws.services.dynamodbv2.model.AttributeValue; 6 | import org.junit.Ignore; 7 | import org.junit.Test; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | import static org.junit.Assert.*; 13 | 14 | @Ignore 15 | public class SpApiSecretDaoDdbIT { 16 | 17 | private static final String K1 = "AWSAuthenticationCredentials_AK"; 18 | private static final String K2 = "AWSAuthenticationCredentials_SK"; 19 | private static final String K3 = "AWSAuthenticationCredentialsProvider_roleArn"; 20 | private static final String K4 = "LWAAuthorizationCredentials_clientid"; 21 | private static final String K5 = "LWAAuthorizationCredentials_refreshToken"; 22 | private static final String K6 = "LWAAuthorizationCredentials_clientSecret"; 23 | 24 | private static final SpApiSecretDao spApiSecretReader = new SpApiSecretDao(); 25 | 26 | @Test 27 | public void getSecretsForSeller() { 28 | final Map seller_jim = spApiSecretReader.getSecretsForSeller("seller_jim"); 29 | 30 | assertNotNull(seller_jim); 31 | assertNotNull(seller_jim.get(K1)); 32 | assertNotNull(seller_jim.get(K2)); 33 | assertNotNull(seller_jim.get(K3)); 34 | assertNotNull(seller_jim.get(K4)); 35 | assertNotNull(seller_jim.get(K5)); 36 | assertNotNull(seller_jim.get(K6)); 37 | } 38 | 39 | @Test 40 | public void getSecretsVOForSeller(){ 41 | final SellerCredentials seller_jim = spApiSecretReader.getSecretsVOForSeller("seller_jim"); 42 | 43 | assertEquals(seller_jim.getSeller_id(), "seller_jim"); 44 | // assertNotNull(seller_jim.getAWSAuthenticationCredentials_AK()); 45 | } 46 | 47 | @Test 48 | public void getSecretsVOForALlSeller(){ 49 | final List allSeller = spApiSecretReader.getSecretsVOForAllSeller(); 50 | assertTrue(allSeller.size() > 1); 51 | } 52 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/eventbridge/OrderReceivedEventGeneratorIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.eventbridge; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | import static org.junit.Assert.*; 7 | 8 | @Ignore 9 | public class OrderReceivedEventGeneratorIT { 10 | 11 | @Test 12 | public void testPut() { 13 | final OrderReceivedEventGenerator orderReceivedEventGenerator = new OrderReceivedEventGenerator(); 14 | 15 | orderReceivedEventGenerator.put(); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/lambda/finances/ExecuteTaskForOneSellerIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.finances; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 4 | import org.junit.Ignore; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | 10 | class ExecuteTaskForOneSellerIT { 11 | 12 | @Test 13 | void handleRequest() { 14 | ExecuteTaskForOneSeller executeTaskForOneSeller = new ExecuteTaskForOneSeller(); 15 | SellerCredentials credentials = new SellerCredentials(); 16 | credentials.setLWAAuthorizationCredentials_refreshToken("Atzr|IwEBIJ27mtx3w0pHV9Rc8TLfmcGX2yEQnC27-88Ya_uI8FqOdAXrdCTzJucIhj1nc-XHkHNxRbBosXdF33nJtDYOQYvql_FGwYBmPMAmu24YybdD3BblXut81LxL6HKTzfF2Ebgi_lF-KmHSxoz4glZCgH8a-2jbOZJbnvJKb_bAZLxWfsgLawhqlHrhyhpSoCAclVfvFGzWG2Wv1hJDgSV2ggMf-4Y26TJ58rM-gMLuL4ipjeOG7QWb7pLcdgcly5XiMuLJLGNVf8h_1-OznfgFgnroYrORlRRkCQkfdheDO_BT0BNj0GPm3bX5u3wsY9go4To"); 17 | credentials.setSeller_id("seller_jim"); 18 | executeTaskForOneSeller.handleRequest(credentials,null); 19 | } 20 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/lambda/order/GetAllSellerCredentialsAndPullOrdersIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.order; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.*; 6 | 7 | class GetAllSellerCredentialsAndPullOrdersIT { 8 | 9 | @Test 10 | void handleRequest() { 11 | GetAllSellerCredentialsAndPullOrders getAllSellerCredentialsAndPullOrders = new GetAllSellerCredentialsAndPullOrders(); 12 | getAllSellerCredentialsAndPullOrders.handleRequest(null,null); 13 | } 14 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/lambda/order/GetOrderListForOneSellerIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.order; 2 | 3 | import cn.amazon.aws.rp.spapi.dynamodb.entity.SellerCredentials; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.*; 7 | 8 | class GetOrderListForOneSellerIT { 9 | 10 | @Test 11 | void handleRequest() { 12 | GetOrderListForOneSeller getOrderListForOneSeller = new GetOrderListForOneSeller(); 13 | SellerCredentials credentials = new SellerCredentials(); 14 | credentials.setLWAAuthorizationCredentials_refreshToken("Atzr|IwEBIJ27mtx3w0pHV9Rc8TLfmcGX2yEQnC27-88Ya_uI8FqOdAXrdCTzJucIhj1nc-XHkHNxRbBosXdF33nJtDYOQYvql_FGwYBmPMAmu24YybdD3BblXut81LxL6HKTzfF2Ebgi_lF-KmHSxoz4glZCgH8a-2jbOZJbnvJKb_bAZLxWfsgLawhqlHrhyhpSoCAclVfvFGzWG2Wv1hJDgSV2ggMf-4Y26TJ58rM-gMLuL4ipjeOG7QWb7pLcdgcly5XiMuLJLGNVf8h_1-OznfgFgnroYrORlRRkCQkfdheDO_BT0BNj0GPm3bX5u3wsY9go4To"); 15 | credentials.setSeller_id("seller_jim"); 16 | getOrderListForOneSeller.handleRequest(credentials,null); 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/lambda/requestlimiter/ApiProxyTest.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.requestlimiter; 2 | 3 | import cn.amazon.aws.rp.spapi.clients.ApiException; 4 | import cn.amazon.aws.rp.spapi.clients.ApiResponse; 5 | import cn.amazon.aws.rp.spapi.utils.AbPair; 6 | import org.junit.Assert; 7 | import org.junit.Test; 8 | 9 | import java.util.Map; 10 | 11 | public class ApiProxyTest { 12 | 13 | /** 14 | * Server respond would be like "0.016", "1" - meaning the token per second. 15 | * if token is 0.016 16 | * 1 / 0.016 = 62 => interval 62, rate 1 17 | * 18 | *

19 | * If token is 2 20 | * 1 / 2 = 0.5 => interval 0.5, rate 1 => interval 1, rate 2 21 | *

22 | * 1 / 1 =1 => interval 1, rate 1 23 | */ 24 | @Test 25 | public void getRateAndInterval() { 26 | final ApiProxy apiProxy = new ApiProxy<>(new Invokable() { 27 | @Override 28 | public ApiResponse invoke(Map input) throws ApiException { 29 | return null; 30 | } 31 | 32 | @Override 33 | public String getRateLimiterNameSuffix() { 34 | return null; 35 | } 36 | }); 37 | 38 | AbPair rateInterval = apiProxy.getRateAndInterval("0.016"); 39 | Integer rate = rateInterval.getA(); // Rate 40 | Integer interval = rateInterval.getB(); // Interval 41 | Assert.assertEquals(rate, Integer.valueOf(1)); 42 | Assert.assertEquals(interval, Integer.valueOf(63)); 43 | 44 | rateInterval = apiProxy.getRateAndInterval("2"); 45 | rate = rateInterval.getA(); // Rate 46 | interval = rateInterval.getB(); // Interval 47 | Assert.assertEquals(rate, Integer.valueOf(2)); 48 | Assert.assertEquals(interval, Integer.valueOf(1)); 49 | } 50 | 51 | @Test 52 | public void testDived() { 53 | System.out.println((1d / 0.016)); 54 | System.out.println(Math.ceil(1d / 0.016)); 55 | } 56 | } -------------------------------------------------------------------------------- /lambda/src/test/java/cn/amazon/aws/rp/spapi/lambda/requestlimiter/RateLimiterRedisIT.java: -------------------------------------------------------------------------------- 1 | package cn.amazon.aws.rp.spapi.lambda.requestlimiter; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.Test; 5 | 6 | /** 7 | * Require to set environment variable REDIS_URL=127.0.0.1 and stat a redis. 8 | */ 9 | @Ignore 10 | public class RateLimiterRedisIT { 11 | 12 | @Test 13 | public void acquirePermit() { 14 | RateLimiterRedis.acquirePermit("Test9", 1, 1); 15 | } 16 | 17 | @Test 18 | public void acquirePermits() { 19 | for (int i = 0; i < 10; i++) { 20 | RateLimiterRedis.acquirePermit("Test9", 1, 1); 21 | } 22 | } 23 | 24 | @Test 25 | public void updateRateLimiter() { 26 | RateLimiterRedis.updateRateLimiter("Test9", 1, 2); 27 | } 28 | 29 | @Test 30 | public void acquirePermitsTakeLonger() { 31 | for (int i = 0; i < 5; i++) { 32 | RateLimiterRedis.acquirePermit("Test9", 1, 1); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /lambda/src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------