Skip to content

Commit cd94707

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: 2ed2977
1 parent 5d0e729 commit cd94707

9 files changed

Lines changed: 127 additions & 178 deletions

File tree

image-kit-java-core/src/main/kotlin/io/imagekit/models/NamedTransformation.kt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import java.util.Objects
1717
import java.util.Optional
1818

1919
/**
20-
* A named transformation is an alias for an actual transformation string, allowing you to apply and
21-
* later update complex transformations without changing your image or video URLs. Learn more about
20+
* A named transformation is an alias for a transformation string, letting you apply and later
21+
* update complex transformations without changing your image or video URLs. Learn more about
2222
* [named transformations](https://imagekit.io/docs/transformations#named-transformations).
2323
*/
2424
class NamedTransformation
@@ -46,24 +46,23 @@ private constructor(
4646
) : this(id, createdAt, enabled, name, transformation, mutableMapOf())
4747

4848
/**
49-
* Unique identifier of the named transformation. This is generated by ImageKit when you create
50-
* a new named transformation.
49+
* Unique identifier generated by ImageKit when the named transformation was created.
5150
*
5251
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
5352
* server responded with an unexpected value).
5453
*/
5554
fun id(): Optional<String> = id.getOptional("id")
5655

5756
/**
58-
* Timestamp (ISO string) when the named transformation was created.
57+
* ISO 8601 timestamp of when the named transformation was created.
5958
*
6059
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
6160
* server responded with an unexpected value).
6261
*/
6362
fun createdAt(): Optional<OffsetDateTime> = createdAt.getOptional("createdAt")
6463

6564
/**
66-
* Whether this named transformation is currently enabled.
65+
* Whether the named transformation is currently enabled.
6766
*
6867
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
6968
* server responded with an unexpected value).
@@ -79,8 +78,8 @@ private constructor(
7978
fun name(): Optional<String> = name.getOptional("name")
8079

8180
/**
82-
* The transformation this name refers to. Always returned with the `tr:` prefix included,
83-
* regardless of whether you supplied it when creating or updating the named transformation.
81+
* Transformation string this name refers to. Always includes the `tr:` prefix, even if you
82+
* omitted it in the request.
8483
*
8584
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
8685
* server responded with an unexpected value).
@@ -164,10 +163,7 @@ private constructor(
164163
additionalProperties = namedTransformation.additionalProperties.toMutableMap()
165164
}
166165

167-
/**
168-
* Unique identifier of the named transformation. This is generated by ImageKit when you
169-
* create a new named transformation.
170-
*/
166+
/** Unique identifier generated by ImageKit when the named transformation was created. */
171167
fun id(id: String) = id(JsonField.of(id))
172168

173169
/**
@@ -178,7 +174,7 @@ private constructor(
178174
*/
179175
fun id(id: JsonField<String>) = apply { this.id = id }
180176

181-
/** Timestamp (ISO string) when the named transformation was created. */
177+
/** ISO 8601 timestamp of when the named transformation was created. */
182178
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
183179

184180
/**
@@ -190,7 +186,7 @@ private constructor(
190186
*/
191187
fun createdAt(createdAt: JsonField<OffsetDateTime>) = apply { this.createdAt = createdAt }
192188

193-
/** Whether this named transformation is currently enabled. */
189+
/** Whether the named transformation is currently enabled. */
194190
fun enabled(enabled: Boolean) = enabled(JsonField.of(enabled))
195191

196192
/**
@@ -213,8 +209,8 @@ private constructor(
213209
fun name(name: JsonField<String>) = apply { this.name = name }
214210

215211
/**
216-
* The transformation this name refers to. Always returned with the `tr:` prefix included,
217-
* regardless of whether you supplied it when creating or updating the named transformation.
212+
* Transformation string this name refers to. Always includes the `tr:` prefix, even if you
213+
* omitted it in the request.
218214
*/
219215
fun transformation(transformation: String) = transformation(JsonField.of(transformation))
220216

image-kit-java-core/src/main/kotlin/io/imagekit/models/namedtransformations/NamedTransformationCreateParams.kt

Lines changed: 38 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ import java.util.Optional
2222
/**
2323
* Creates a new named transformation and returns the created object.
2424
*
25-
* Named transformations let you assign a short, reusable name to a complex transformation string,
26-
* so it can be applied in image and video URLs as `tr:n-<name>` and later updated without changing
27-
* any existing URLs.
28-
*
29-
* Learn more about
25+
* A named transformation is a short, reusable name for a transformation string. Use it in image and
26+
* video URLs as `tr:n-<name>`, and update the underlying transformation later without changing
27+
* existing URLs. Learn more about
3028
* [named transformations](https://imagekit.io/docs/transformations#named-transformations).
3129
*
32-
* **Note:** You can create up to 250 named transformations per account. Once this limit is reached,
33-
* the request fails with a `400` error.
30+
* You can create up to 250 named transformations per account.
3431
*/
3532
class NamedTransformationCreateParams
3633
private constructor(
@@ -40,32 +37,28 @@ private constructor(
4037
) : Params {
4138

4239
/**
43-
* Name of the named transformation. This is the alias used to refer to the transformation
44-
* string in image and video URLs, for example `tr:n-<name>`. Can only contain alphanumeric
45-
* characters or `_` (hyphens are not allowed), and must be unique for your account. Name
46-
* matching is case-sensitive, so `Small_Thumbnail` and `small_thumbnail` are treated as
47-
* different names.
40+
* Alias for the transformation string, used in URLs as `tr:n-<name>`. Must contain only
41+
* alphanumeric characters or `_` (no hyphens), and be unique for your account. Name matching is
42+
* case-sensitive.
4843
*
4944
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type or is
5045
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
5146
*/
5247
fun name(): String = body.name()
5348

5449
/**
55-
* The transformation this name refers to, expressed as one or more comma-separated
56-
* transformation parameters, for example `w-150,h-150,fo-center,cm-resize`. You do not need to
57-
* prefix this with `tr:` — it is added automatically. If you do include it, it must appear in
58-
* lowercase at the start of the string, or the request is rejected. Learn more about the
59-
* [transformation syntax](https://imagekit.io/docs/transformations).
50+
* The transformation string this name refers to, for example `w-150,h-150,fo-center,cm-resize`.
51+
* The `tr:` prefix is optional — it's added automatically if missing, and validated if present.
52+
* Learn more about the [transformation syntax](https://imagekit.io/docs/transformations).
6053
*
6154
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type or is
6255
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
6356
*/
6457
fun transformation(): String = body.transformation()
6558

6659
/**
67-
* Whether this named transformation is enabled. Set to `false` to temporarily disable it
68-
* without deleting it — requests using a disabled named transformation fail at delivery time.
60+
* Whether the named transformation is enabled. Set to `false` to disable it without deleting
61+
* it; requests using a disabled named transformation fail at delivery time.
6962
*
7063
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
7164
* server responded with an unexpected value).
@@ -146,11 +139,9 @@ private constructor(
146139
fun body(body: Body) = apply { this.body = body.toBuilder() }
147140

148141
/**
149-
* Name of the named transformation. This is the alias used to refer to the transformation
150-
* string in image and video URLs, for example `tr:n-<name>`. Can only contain alphanumeric
151-
* characters or `_` (hyphens are not allowed), and must be unique for your account. Name
152-
* matching is case-sensitive, so `Small_Thumbnail` and `small_thumbnail` are treated as
153-
* different names.
142+
* Alias for the transformation string, used in URLs as `tr:n-<name>`. Must contain only
143+
* alphanumeric characters or `_` (no hyphens), and be unique for your account. Name
144+
* matching is case-sensitive.
154145
*/
155146
fun name(name: String) = apply { body.name(name) }
156147

@@ -163,11 +154,10 @@ private constructor(
163154
fun name(name: JsonField<String>) = apply { body.name(name) }
164155

165156
/**
166-
* The transformation this name refers to, expressed as one or more comma-separated
167-
* transformation parameters, for example `w-150,h-150,fo-center,cm-resize`. You do not need
168-
* to prefix this with `tr:` — it is added automatically. If you do include it, it must
169-
* appear in lowercase at the start of the string, or the request is rejected. Learn more
170-
* about the [transformation syntax](https://imagekit.io/docs/transformations).
157+
* The transformation string this name refers to, for example
158+
* `w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
159+
* automatically if missing, and validated if present. Learn more about the
160+
* [transformation syntax](https://imagekit.io/docs/transformations).
171161
*/
172162
fun transformation(transformation: String) = apply { body.transformation(transformation) }
173163

@@ -183,9 +173,8 @@ private constructor(
183173
}
184174

185175
/**
186-
* Whether this named transformation is enabled. Set to `false` to temporarily disable it
187-
* without deleting it — requests using a disabled named transformation fail at delivery
188-
* time.
176+
* Whether the named transformation is enabled. Set to `false` to disable it without
177+
* deleting it; requests using a disabled named transformation fail at delivery time.
189178
*/
190179
fun enabled(enabled: Boolean) = apply { body.enabled(enabled) }
191180

@@ -360,33 +349,29 @@ private constructor(
360349
) : this(name, transformation, enabled, mutableMapOf())
361350

362351
/**
363-
* Name of the named transformation. This is the alias used to refer to the transformation
364-
* string in image and video URLs, for example `tr:n-<name>`. Can only contain alphanumeric
365-
* characters or `_` (hyphens are not allowed), and must be unique for your account. Name
366-
* matching is case-sensitive, so `Small_Thumbnail` and `small_thumbnail` are treated as
367-
* different names.
352+
* Alias for the transformation string, used in URLs as `tr:n-<name>`. Must contain only
353+
* alphanumeric characters or `_` (no hyphens), and be unique for your account. Name
354+
* matching is case-sensitive.
368355
*
369356
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type or is
370357
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
371358
*/
372359
fun name(): String = name.getRequired("name")
373360

374361
/**
375-
* The transformation this name refers to, expressed as one or more comma-separated
376-
* transformation parameters, for example `w-150,h-150,fo-center,cm-resize`. You do not need
377-
* to prefix this with `tr:` — it is added automatically. If you do include it, it must
378-
* appear in lowercase at the start of the string, or the request is rejected. Learn more
379-
* about the [transformation syntax](https://imagekit.io/docs/transformations).
362+
* The transformation string this name refers to, for example
363+
* `w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
364+
* automatically if missing, and validated if present. Learn more about the
365+
* [transformation syntax](https://imagekit.io/docs/transformations).
380366
*
381367
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type or is
382368
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
383369
*/
384370
fun transformation(): String = transformation.getRequired("transformation")
385371

386372
/**
387-
* Whether this named transformation is enabled. Set to `false` to temporarily disable it
388-
* without deleting it — requests using a disabled named transformation fail at delivery
389-
* time.
373+
* Whether the named transformation is enabled. Set to `false` to disable it without
374+
* deleting it; requests using a disabled named transformation fail at delivery time.
390375
*
391376
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if
392377
* the server responded with an unexpected value).
@@ -460,11 +445,9 @@ private constructor(
460445
}
461446

462447
/**
463-
* Name of the named transformation. This is the alias used to refer to the
464-
* transformation string in image and video URLs, for example `tr:n-<name>`. Can only
465-
* contain alphanumeric characters or `_` (hyphens are not allowed), and must be unique
466-
* for your account. Name matching is case-sensitive, so `Small_Thumbnail` and
467-
* `small_thumbnail` are treated as different names.
448+
* Alias for the transformation string, used in URLs as `tr:n-<name>`. Must contain only
449+
* alphanumeric characters or `_` (no hyphens), and be unique for your account. Name
450+
* matching is case-sensitive.
468451
*/
469452
fun name(name: String) = name(JsonField.of(name))
470453

@@ -478,11 +461,9 @@ private constructor(
478461
fun name(name: JsonField<String>) = apply { this.name = name }
479462

480463
/**
481-
* The transformation this name refers to, expressed as one or more comma-separated
482-
* transformation parameters, for example `w-150,h-150,fo-center,cm-resize`. You do not
483-
* need to prefix this with `tr:` — it is added automatically. If you do include it, it
484-
* must appear in lowercase at the start of the string, or the request is rejected.
485-
* Learn more about the
464+
* The transformation string this name refers to, for example
465+
* `w-150,h-150,fo-center,cm-resize`. The `tr:` prefix is optional — it's added
466+
* automatically if missing, and validated if present. Learn more about the
486467
* [transformation syntax](https://imagekit.io/docs/transformations).
487468
*/
488469
fun transformation(transformation: String) =
@@ -500,9 +481,8 @@ private constructor(
500481
}
501482

502483
/**
503-
* Whether this named transformation is enabled. Set to `false` to temporarily disable
504-
* it without deleting it — requests using a disabled named transformation fail at
505-
* delivery time.
484+
* Whether the named transformation is enabled. Set to `false` to disable it without
485+
* deleting it; requests using a disabled named transformation fail at delivery time.
506486
*/
507487
fun enabled(enabled: Boolean) = enabled(JsonField.of(enabled))
508488

image-kit-java-core/src/main/kotlin/io/imagekit/models/namedtransformations/NamedTransformationDeleteParams.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ import kotlin.jvm.optionals.getOrNull
1414
/**
1515
* Permanently deletes the named transformation identified by `id` and returns the deleted object.
1616
*
17-
* **Note:**
18-
* - If another *enabled* named transformation, or your account's upload
19-
* pre-transformation/post-transformation settings, reference this named transformation (via the
20-
* `n-<name>` token), the request fails with a `409` error whose `message` describes what it is
21-
* referenced by. A reference from a named transformation that is itself disabled does not block
22-
* this request. Remove or disable those references first, then retry the deletion. This is a
23-
* best-effort check and cannot detect references baked into your own application code or
24-
* previously generated URLs.
17+
* Deletion fails with a `409` error if the named transformation is still referenced (via the
18+
* `n-<name>` token) by another enabled named transformation, or by an upload
19+
* pre-transformation/post-transformation setting. References from disabled named transformations
20+
* don't count. This check is best-effort and can't detect references in your own application code
21+
* or in previously generated URLs.
2522
*/
2623
class NamedTransformationDeleteParams
2724
private constructor(

0 commit comments

Comments
 (0)