Java istemci kitaplığı oluşturma
Bir Java istemci kitaplığı oluşturun.
These instructions show you how to generate a Java client library for the Sellers API using Swagger Code Generator on a computer running Microsoft Windows. The process is the same for users of other operating systems such as macOS or Linux, with the replacement of Windows-specific semantics (for example, C:\). Although these instructions are for the Sellers API, you can modify the instructions to make client libraries for other APIs in the Selling Partner API. Refer to Models for Swagger models for each Selling Partner API section.
While a generated client library can help you make calls to the Selling Partner API, it does not contain code for LWA token exchange and authentication. For that, refer to Step 1. Request a Login with Amazon access token and Step 4. Create and sign your request. Or, for an SDK that includes LWA token exchange, refer to Generating a Java SDK with LWA token exchange.
Java istemci kütüphanesi oluşturmak için:
-
Install
Java 8
or newer,Apache Maven 3.6.
or greater, andGNU Wget
and make them available in your $PATH. -
Go to Models.
-
Henüz yapmadıysanız depoyu klonlayarak bilgisayarınızda yerel bir kopya oluşturun.
-
Bir komut istemi penceresi açın ve Swagger Code Generator'ı indirmek istediğiniz dizine gidin.
-
Swagger Code Generator'ın en son sürümünü indirin.
Örneğin:
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar -O swagger-codegen-cli.jarswagger-codegen-cli.jar
downloads to the current directory.Not
Tarayıcınızı şu adrese yönlendirerek maven.org'dan da indirebilirsiniz. https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar
-
swagger-codegen-cli.jar
dosyasını sizin için anlamlı olan bir dizin yapısına kopyalayın. Bu örnekteC:\\SwaggerToCL
dizinine kopyalayacağız. -
Şuraya git
sellers.json
içindeselling-partner-api-models\\models\\sellers-api-model
Deponun yerel kopyasının klasörü. -
sellers.json
+C:\\SwaggerToCL
. -
İstemci kütüphanesini oluşturun.
Örneğin:
java -jar C:\SwaggerToCL\swagger-codegen-cli.jar generate -i C:\SwaggerToCL\Sellers.json -l java -o C:\SwaggerToCL\Sellers_JavaCLİstemci kütüphanesi,
C:\\SwaggerToCL\\Sellers_JavaCL
konumuna kopyalanır.After you have generated your client library you can use it to help you make calls to the Selling Partner API. Refer to Connecting to Selling Partner API.
Updated 23 days ago