Skip to content

Commit b3e2b21

Browse files
authored
Merge pull request #416 from Ecwid/ECWID_95251
ECWID-95251 - README.md fixes
2 parents 3a834f3 + a3f0525 commit b3e2b21

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@ apiHost=app.local.ecwid.com
1515
apiPort=8443
1616
```
1717

18+
#### Adding the Library to a Maven Project
19+
20+
To add the current library to a Maven project, you need to add the following block of code to your project's `pom.xml` file inside the `<dependencies>` tag:
21+
22+
```xml
23+
<dependency>
24+
<groupId>com.ecwid.apiclient</groupId>
25+
<artifactId>api-client</artifactId>
26+
<version>0.326.0</version>
27+
</dependency>
28+
```
29+
30+
#### Adding the Library to a Gradle Project
31+
32+
To add the current library to a Gradle project using Kotlin DSL, you need to add the following line to your project's `build.gradle.kts` file inside the `dependencies` block:
33+
34+
```kotlin
35+
implementation("com.ecwid.apiclient:api-client:0.326.0")
36+
```
37+
1838
## Examples
1939

2040
#### Simple example:
@@ -25,7 +45,7 @@ val apiClient = ApiClient.create(
2545
storeId = 1003,
2646
apiToken = "secret_mysecuretoken"),
2747
httpTransport = ApacheCommonsHttpClientTransport(),
28-
jsonTransformerProvider = GsonTransformerProvider()
48+
jsonTransformerProvider = GsonTransformerProvider())
2949

3050
val customer = apiClient.getCustomerDetails(CustomerDetailsRequest(customerId = 1))
3151
println("api/v3 customer: $customer")
@@ -39,7 +59,7 @@ val apiClient = ApiClient.create(
3959
storeId = 1003,
4060
apiToken = "secret_mysecuretoken"),
4161
httpTransport = ApacheCommonsHttpClientTransport(),
42-
jsonTransformerProvider = GsonTransformerProvider()
62+
jsonTransformerProvider = GsonTransformerProvider())
4363

4464
val requestsForBatch = listOf(CustomerDetailsRequest(1), CustomerDetailsRequest(2))
4565
val batch = apiClient.createBatch(CreateBatchRequest(requestsForBatch, stopOnFirstFailure = true))
@@ -57,6 +77,6 @@ while (true) {
5777
.map { it.toTypedResponse(FetchedCustomer::class.java) }
5878
.mapNotNull { if (it !is TypedBatchResponse.Ok<FetchedCustomer>) it.toString() else null }
5979
println("api/v3 customers: ${customers.joinToString { it.id.toString() }}, errors: ${errors.joinToString()}")
60-
break;
80+
break
6181
}
6282
```

0 commit comments

Comments
 (0)