Skip to content

Commit 09a68d6

Browse files
feat(api): manual updates
1 parent e01a75a commit 09a68d6

35 files changed

+109
-117
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml
33
openapi_spec_hash: 1d382866fce3284f26d341f112988d9d
4-
config_hash: 54c05a157f2cc730fac9e1df5dc3ca29
4+
config_hash: 29a2351fe2be89392b15719be8bc964f

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import com.imagekit.api.client.ImageKitClient;
8383
import com.imagekit.api.client.okhttp.ImageKitOkHttpClient;
8484

8585
ImageKitClient client = ImageKitOkHttpClient.builder()
86-
.privateApiKey("My Private API Key")
86+
.privateKey("My Private Key")
8787
.password("My Password")
8888
.build();
8989
```
@@ -98,15 +98,15 @@ ImageKitClient client = ImageKitOkHttpClient.builder()
9898
// Configures using the `imagekit.imagekitPrivateApiKey`, `imagekit.optionalImagekitIgnoresThis`, `imagekit.imagekitWebhookSecret` and `imagekit.baseUrl` system properties
9999
// Or configures using the `IMAGEKIT_PRIVATE_API_KEY`, `OPTIONAL_IMAGEKIT_IGNORES_THIS`, `IMAGEKIT_WEBHOOK_SECRET` and `IMAGE_KIT_BASE_URL` environment variables
100100
.fromEnv()
101-
.privateApiKey("My Private API Key")
101+
.privateKey("My Private Key")
102102
.build();
103103
```
104104

105105
See this table for the available options:
106106

107107
| Setter | System property | Environment variable | Required | Default value |
108108
| --------------- | -------------------------------------- | -------------------------------- | -------- | --------------------------- |
109-
| `privateApiKey` | `imagekit.imagekitPrivateApiKey` | `IMAGEKIT_PRIVATE_API_KEY` | true | - |
109+
| `privateKey` | `imagekit.imagekitPrivateApiKey` | `IMAGEKIT_PRIVATE_API_KEY` | true | - |
110110
| `password` | `imagekit.optionalImagekitIgnoresThis` | `OPTIONAL_IMAGEKIT_IGNORES_THIS` | false | `"do_not_set"` |
111111
| `webhookSecret` | `imagekit.imagekitWebhookSecret` | `IMAGEKIT_WEBHOOK_SECRET` | false | - |
112112
| `baseUrl` | `imagekit.baseUrl` | `IMAGE_KIT_BASE_URL` | true | `"https://api.imagekit.io"` |

image-kit-java-client-okhttp/src/main/kotlin/com/imagekit/api/client/okhttp/ImageKitOkHttpClient.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,10 @@ class ImageKitOkHttpClient private constructor() {
187187
* Your ImageKit private API key (it starts with `private_`). You can view and manage API
188188
* keys in the [dashboard](https://imagekit.io/dashboard/developer/api-keys).
189189
*/
190-
fun privateApiKey(privateApiKey: String) = apply {
191-
clientOptions.privateApiKey(privateApiKey)
192-
}
190+
fun privateKey(privateKey: String) = apply { clientOptions.privateKey(privateKey) }
193191

194192
/**
195-
* ImageKit Basic Auth only uses the username field and ignores the password. This field is
196-
* unused.
193+
* ImageKit Basic Auth only uses the `private_key` as username and ignores the password.
197194
*
198195
* Defaults to `"do_not_set"`.
199196
*/

image-kit-java-client-okhttp/src/main/kotlin/com/imagekit/api/client/okhttp/ImageKitOkHttpClientAsync.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,10 @@ class ImageKitOkHttpClientAsync private constructor() {
187187
* Your ImageKit private API key (it starts with `private_`). You can view and manage API
188188
* keys in the [dashboard](https://imagekit.io/dashboard/developer/api-keys).
189189
*/
190-
fun privateApiKey(privateApiKey: String) = apply {
191-
clientOptions.privateApiKey(privateApiKey)
192-
}
190+
fun privateKey(privateKey: String) = apply { clientOptions.privateKey(privateKey) }
193191

194192
/**
195-
* ImageKit Basic Auth only uses the username field and ignores the password. This field is
196-
* unused.
193+
* ImageKit Basic Auth only uses the `private_key` as username and ignores the password.
197194
*
198195
* Defaults to `"do_not_set"`.
199196
*/

image-kit-java-core/src/main/kotlin/com/imagekit/api/core/ClientOptions.kt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private constructor(
8888
* Your ImageKit private API key (it starts with `private_`). You can view and manage API keys
8989
* in the [dashboard](https://imagekit.io/dashboard/developer/api-keys).
9090
*/
91-
@get:JvmName("privateApiKey") val privateApiKey: String,
91+
@get:JvmName("privateKey") val privateKey: String,
9292
private val password: String?,
9393
private val webhookSecret: String?,
9494
) {
@@ -109,8 +109,7 @@ private constructor(
109109
fun baseUrlOverridden(): Boolean = baseUrl != null
110110

111111
/**
112-
* ImageKit Basic Auth only uses the username field and ignores the password. This field is
113-
* unused.
112+
* ImageKit Basic Auth only uses the `private_key` as username and ignores the password.
114113
*
115114
* Defaults to `"do_not_set"`.
116115
*/
@@ -137,7 +136,7 @@ private constructor(
137136
* The following fields are required:
138137
* ```java
139138
* .httpClient()
140-
* .privateApiKey()
139+
* .privateKey()
141140
* ```
142141
*/
143142
@JvmStatic fun builder() = Builder()
@@ -163,7 +162,7 @@ private constructor(
163162
private var responseValidation: Boolean = false
164163
private var timeout: Timeout = Timeout.default()
165164
private var maxRetries: Int = 2
166-
private var privateApiKey: String? = null
165+
private var privateKey: String? = null
167166
private var password: String? = "do_not_set"
168167
private var webhookSecret: String? = null
169168

@@ -179,7 +178,7 @@ private constructor(
179178
responseValidation = clientOptions.responseValidation
180179
timeout = clientOptions.timeout
181180
maxRetries = clientOptions.maxRetries
182-
privateApiKey = clientOptions.privateApiKey
181+
privateKey = clientOptions.privateKey
183182
password = clientOptions.password
184183
webhookSecret = clientOptions.webhookSecret
185184
}
@@ -281,11 +280,10 @@ private constructor(
281280
* Your ImageKit private API key (it starts with `private_`). You can view and manage API
282281
* keys in the [dashboard](https://imagekit.io/dashboard/developer/api-keys).
283282
*/
284-
fun privateApiKey(privateApiKey: String) = apply { this.privateApiKey = privateApiKey }
283+
fun privateKey(privateKey: String) = apply { this.privateKey = privateKey }
285284

286285
/**
287-
* ImageKit Basic Auth only uses the username field and ignores the password. This field is
288-
* unused.
286+
* ImageKit Basic Auth only uses the `private_key` as username and ignores the password.
289287
*
290288
* Defaults to `"do_not_set"`.
291289
*/
@@ -396,7 +394,7 @@ private constructor(
396394
*
397395
* |Setter |System property |Environment variable |Required|Default value |
398396
* |---------------|--------------------------------------|--------------------------------|--------|---------------------------|
399-
* |`privateApiKey`|`imagekit.imagekitPrivateApiKey` |`IMAGEKIT_PRIVATE_API_KEY` |true |- |
397+
* |`privateKey` |`imagekit.imagekitPrivateApiKey` |`IMAGEKIT_PRIVATE_API_KEY` |true |- |
400398
* |`password` |`imagekit.optionalImagekitIgnoresThis`|`OPTIONAL_IMAGEKIT_IGNORES_THIS`|false |`"do_not_set"` |
401399
* |`webhookSecret`|`imagekit.imagekitWebhookSecret` |`IMAGEKIT_WEBHOOK_SECRET` |false |- |
402400
* |`baseUrl` |`imagekit.baseUrl` |`IMAGE_KIT_BASE_URL` |true |`"https://api.imagekit.io"`|
@@ -409,7 +407,7 @@ private constructor(
409407
}
410408
(System.getProperty("imagekit.imagekitPrivateApiKey")
411409
?: System.getenv("IMAGEKIT_PRIVATE_API_KEY"))
412-
?.let { privateApiKey(it) }
410+
?.let { privateKey(it) }
413411
(System.getProperty("imagekit.optionalImagekitIgnoresThis")
414412
?: System.getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS"))
415413
?.let { password(it) }
@@ -426,14 +424,14 @@ private constructor(
426424
* The following fields are required:
427425
* ```java
428426
* .httpClient()
429-
* .privateApiKey()
427+
* .privateKey()
430428
* ```
431429
*
432430
* @throws IllegalStateException if any required field is unset.
433431
*/
434432
fun build(): ClientOptions {
435433
val httpClient = checkRequired("httpClient", httpClient)
436-
val privateApiKey = checkRequired("privateApiKey", privateApiKey)
434+
val privateKey = checkRequired("privateKey", privateKey)
437435

438436
val headers = Headers.builder()
439437
val queryParams = QueryParams.builder()
@@ -444,7 +442,7 @@ private constructor(
444442
headers.put("X-Stainless-Package-Version", getPackageVersion())
445443
headers.put("X-Stainless-Runtime", "JRE")
446444
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
447-
privateApiKey.let { username ->
445+
privateKey.let { username ->
448446
password?.let { password ->
449447
if (!username.isEmpty() && !password.isEmpty()) {
450448
headers.put(
@@ -473,7 +471,7 @@ private constructor(
473471
responseValidation,
474472
timeout,
475473
maxRetries,
476-
privateApiKey,
474+
privateKey,
477475
password,
478476
webhookSecret,
479477
)

image-kit-java-core/src/test/kotlin/com/imagekit/api/core/ClientOptionsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class ClientOptionsTest {
2121
var clientOptions =
2222
ClientOptions.builder()
2323
.httpClient(httpClient)
24-
.privateApiKey("My Private API Key")
24+
.privateKey("My Private Key")
2525
.password("My Password")
2626
.build()
2727
verify(httpClient, never()).close()

image-kit-java-core/src/test/kotlin/com/imagekit/api/services/ErrorHandlingTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ internal class ErrorHandlingTest {
5555
client =
5656
ImageKitOkHttpClient.builder()
5757
.baseUrl(wmRuntimeInfo.httpBaseUrl)
58-
.privateApiKey("My Private API Key")
58+
.privateKey("My Private Key")
5959
.password("My Password")
6060
.build()
6161
}

image-kit-java-core/src/test/kotlin/com/imagekit/api/services/ServiceParamsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal class ServiceParamsTest {
3333
client =
3434
ImageKitOkHttpClient.builder()
3535
.baseUrl(wmRuntimeInfo.httpBaseUrl)
36-
.privateApiKey("My Private API Key")
36+
.privateKey("My Private Key")
3737
.password("My Password")
3838
.build()
3939
}

image-kit-java-core/src/test/kotlin/com/imagekit/api/services/async/AssetServiceAsyncTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal class AssetServiceAsyncTest {
1818
val client =
1919
ImageKitOkHttpClientAsync.builder()
2020
.baseUrl(TestServerExtension.BASE_URL)
21-
.privateApiKey("My Private API Key")
21+
.privateKey("My Private Key")
2222
.password("My Password")
2323
.build()
2424
val assetServiceAsync = client.assets()

image-kit-java-core/src/test/kotlin/com/imagekit/api/services/async/CustomMetadataFieldServiceAsyncTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class CustomMetadataFieldServiceAsyncTest {
2020
val client =
2121
ImageKitOkHttpClientAsync.builder()
2222
.baseUrl(TestServerExtension.BASE_URL)
23-
.privateApiKey("My Private API Key")
23+
.privateKey("My Private Key")
2424
.password("My Password")
2525
.build()
2626
val customMetadataFieldServiceAsync = client.customMetadataFields()
@@ -74,7 +74,7 @@ internal class CustomMetadataFieldServiceAsyncTest {
7474
val client =
7575
ImageKitOkHttpClientAsync.builder()
7676
.baseUrl(TestServerExtension.BASE_URL)
77-
.privateApiKey("My Private API Key")
77+
.privateKey("My Private Key")
7878
.password("My Password")
7979
.build()
8080
val customMetadataFieldServiceAsync = client.customMetadataFields()
@@ -127,7 +127,7 @@ internal class CustomMetadataFieldServiceAsyncTest {
127127
val client =
128128
ImageKitOkHttpClientAsync.builder()
129129
.baseUrl(TestServerExtension.BASE_URL)
130-
.privateApiKey("My Private API Key")
130+
.privateKey("My Private Key")
131131
.password("My Password")
132132
.build()
133133
val customMetadataFieldServiceAsync = client.customMetadataFields()
@@ -147,7 +147,7 @@ internal class CustomMetadataFieldServiceAsyncTest {
147147
val client =
148148
ImageKitOkHttpClientAsync.builder()
149149
.baseUrl(TestServerExtension.BASE_URL)
150-
.privateApiKey("My Private API Key")
150+
.privateKey("My Private Key")
151151
.password("My Password")
152152
.build()
153153
val customMetadataFieldServiceAsync = client.customMetadataFields()

0 commit comments

Comments
 (0)