Skip to content

Commit 5d0e729

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: f7f8131
1 parent 4edbca7 commit 5d0e729

11 files changed

Lines changed: 239 additions & 169 deletions

File tree

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

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class NamedTransformation
2626
private constructor(
2727
private val id: JsonField<String>,
2828
private val createdAt: JsonField<OffsetDateTime>,
29-
private val disabled: JsonField<Boolean>,
29+
private val enabled: JsonField<Boolean>,
3030
private val name: JsonField<String>,
3131
private val transformation: JsonField<String>,
3232
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -38,12 +38,12 @@ private constructor(
3838
@JsonProperty("createdAt")
3939
@ExcludeMissing
4040
createdAt: JsonField<OffsetDateTime> = JsonMissing.of(),
41-
@JsonProperty("disabled") @ExcludeMissing disabled: JsonField<Boolean> = JsonMissing.of(),
41+
@JsonProperty("enabled") @ExcludeMissing enabled: JsonField<Boolean> = JsonMissing.of(),
4242
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
4343
@JsonProperty("transformation")
4444
@ExcludeMissing
4545
transformation: JsonField<String> = JsonMissing.of(),
46-
) : this(id, createdAt, disabled, name, transformation, mutableMapOf())
46+
) : this(id, createdAt, enabled, name, transformation, mutableMapOf())
4747

4848
/**
4949
* Unique identifier of the named transformation. This is generated by ImageKit when you create
@@ -55,20 +55,20 @@ private constructor(
5555
fun id(): Optional<String> = id.getOptional("id")
5656

5757
/**
58-
* Timestamp when the named transformation was created.
58+
* Timestamp (ISO string) when the named transformation was created.
5959
*
6060
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
6161
* server responded with an unexpected value).
6262
*/
6363
fun createdAt(): Optional<OffsetDateTime> = createdAt.getOptional("createdAt")
6464

6565
/**
66-
* Whether this named transformation is currently disabled.
66+
* Whether this named transformation is currently enabled.
6767
*
6868
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
6969
* server responded with an unexpected value).
7070
*/
71-
fun disabled(): Optional<Boolean> = disabled.getOptional("disabled")
71+
fun enabled(): Optional<Boolean> = enabled.getOptional("enabled")
7272

7373
/**
7474
* Name of the named transformation, used as `tr:n-<name>` in image and video URLs.
@@ -79,7 +79,8 @@ private constructor(
7979
fun name(): Optional<String> = name.getOptional("name")
8080

8181
/**
82-
* The transformation string this name refers to.
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.
8384
*
8485
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
8586
* server responded with an unexpected value).
@@ -103,11 +104,11 @@ private constructor(
103104
fun _createdAt(): JsonField<OffsetDateTime> = createdAt
104105

105106
/**
106-
* Returns the raw JSON value of [disabled].
107+
* Returns the raw JSON value of [enabled].
107108
*
108-
* Unlike [disabled], this method doesn't throw if the JSON field has an unexpected type.
109+
* Unlike [enabled], this method doesn't throw if the JSON field has an unexpected type.
109110
*/
110-
@JsonProperty("disabled") @ExcludeMissing fun _disabled(): JsonField<Boolean> = disabled
111+
@JsonProperty("enabled") @ExcludeMissing fun _enabled(): JsonField<Boolean> = enabled
111112

112113
/**
113114
* Returns the raw JSON value of [name].
@@ -148,7 +149,7 @@ private constructor(
148149

149150
private var id: JsonField<String> = JsonMissing.of()
150151
private var createdAt: JsonField<OffsetDateTime> = JsonMissing.of()
151-
private var disabled: JsonField<Boolean> = JsonMissing.of()
152+
private var enabled: JsonField<Boolean> = JsonMissing.of()
152153
private var name: JsonField<String> = JsonMissing.of()
153154
private var transformation: JsonField<String> = JsonMissing.of()
154155
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -157,7 +158,7 @@ private constructor(
157158
internal fun from(namedTransformation: NamedTransformation) = apply {
158159
id = namedTransformation.id
159160
createdAt = namedTransformation.createdAt
160-
disabled = namedTransformation.disabled
161+
enabled = namedTransformation.enabled
161162
name = namedTransformation.name
162163
transformation = namedTransformation.transformation
163164
additionalProperties = namedTransformation.additionalProperties.toMutableMap()
@@ -177,7 +178,7 @@ private constructor(
177178
*/
178179
fun id(id: JsonField<String>) = apply { this.id = id }
179180

180-
/** Timestamp when the named transformation was created. */
181+
/** Timestamp (ISO string) when the named transformation was created. */
181182
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
182183

183184
/**
@@ -189,17 +190,16 @@ private constructor(
189190
*/
190191
fun createdAt(createdAt: JsonField<OffsetDateTime>) = apply { this.createdAt = createdAt }
191192

192-
/** Whether this named transformation is currently disabled. */
193-
fun disabled(disabled: Boolean) = disabled(JsonField.of(disabled))
193+
/** Whether this named transformation is currently enabled. */
194+
fun enabled(enabled: Boolean) = enabled(JsonField.of(enabled))
194195

195196
/**
196-
* Sets [Builder.disabled] to an arbitrary JSON value.
197+
* Sets [Builder.enabled] to an arbitrary JSON value.
197198
*
198-
* You should usually call [Builder.disabled] with a well-typed [Boolean] value instead.
199-
* This method is primarily for setting the field to an undocumented or not yet supported
200-
* value.
199+
* You should usually call [Builder.enabled] with a well-typed [Boolean] value instead. This
200+
* method is primarily for setting the field to an undocumented or not yet supported value.
201201
*/
202-
fun disabled(disabled: JsonField<Boolean>) = apply { this.disabled = disabled }
202+
fun enabled(enabled: JsonField<Boolean>) = apply { this.enabled = enabled }
203203

204204
/** Name of the named transformation, used as `tr:n-<name>` in image and video URLs. */
205205
fun name(name: String) = name(JsonField.of(name))
@@ -212,7 +212,10 @@ private constructor(
212212
*/
213213
fun name(name: JsonField<String>) = apply { this.name = name }
214214

215-
/** The transformation string this name refers to. */
215+
/**
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.
218+
*/
216219
fun transformation(transformation: String) = transformation(JsonField.of(transformation))
217220

218221
/**
@@ -254,7 +257,7 @@ private constructor(
254257
NamedTransformation(
255258
id,
256259
createdAt,
257-
disabled,
260+
enabled,
258261
name,
259262
transformation,
260263
additionalProperties.toMutableMap(),
@@ -278,7 +281,7 @@ private constructor(
278281

279282
id()
280283
createdAt()
281-
disabled()
284+
enabled()
282285
name()
283286
transformation()
284287
validated = true
@@ -301,7 +304,7 @@ private constructor(
301304
internal fun validity(): Int =
302305
(if (id.asKnown().isPresent) 1 else 0) +
303306
(if (createdAt.asKnown().isPresent) 1 else 0) +
304-
(if (disabled.asKnown().isPresent) 1 else 0) +
307+
(if (enabled.asKnown().isPresent) 1 else 0) +
305308
(if (name.asKnown().isPresent) 1 else 0) +
306309
(if (transformation.asKnown().isPresent) 1 else 0)
307310

@@ -313,18 +316,18 @@ private constructor(
313316
return other is NamedTransformation &&
314317
id == other.id &&
315318
createdAt == other.createdAt &&
316-
disabled == other.disabled &&
319+
enabled == other.enabled &&
317320
name == other.name &&
318321
transformation == other.transformation &&
319322
additionalProperties == other.additionalProperties
320323
}
321324

322325
private val hashCode: Int by lazy {
323-
Objects.hash(id, createdAt, disabled, name, transformation, additionalProperties)
326+
Objects.hash(id, createdAt, enabled, name, transformation, additionalProperties)
324327
}
325328

326329
override fun hashCode(): Int = hashCode
327330

328331
override fun toString() =
329-
"NamedTransformation{id=$id, createdAt=$createdAt, disabled=$disabled, name=$name, transformation=$transformation, additionalProperties=$additionalProperties}"
332+
"NamedTransformation{id=$id, createdAt=$createdAt, enabled=$enabled, name=$name, transformation=$transformation, additionalProperties=$additionalProperties}"
330333
}

0 commit comments

Comments
 (0)