Skip to content

Commit 45f319b

Browse files
author
stlc-bot
committed
Build SDK
Stainless-Generated-From: 506c413
1 parent 3afcdfd commit 45f319b

7 files changed

Lines changed: 65 additions & 1 deletion

File tree

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

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ private constructor(
8383
private val radius: JsonField<Radius>,
8484
private val raw: JsonField<String>,
8585
private val rotation: JsonField<Rotation>,
86+
private val saturation: JsonField<Long>,
8687
private val shadow: JsonField<Shadow>,
8788
private val sharpen: JsonField<Sharpen>,
8889
private val startOffset: JsonField<StartOffset>,
@@ -178,6 +179,7 @@ private constructor(
178179
@JsonProperty("radius") @ExcludeMissing radius: JsonField<Radius> = JsonMissing.of(),
179180
@JsonProperty("raw") @ExcludeMissing raw: JsonField<String> = JsonMissing.of(),
180181
@JsonProperty("rotation") @ExcludeMissing rotation: JsonField<Rotation> = JsonMissing.of(),
182+
@JsonProperty("saturation") @ExcludeMissing saturation: JsonField<Long> = JsonMissing.of(),
181183
@JsonProperty("shadow") @ExcludeMissing shadow: JsonField<Shadow> = JsonMissing.of(),
182184
@JsonProperty("sharpen") @ExcludeMissing sharpen: JsonField<Sharpen> = JsonMissing.of(),
183185
@JsonProperty("startOffset")
@@ -243,6 +245,7 @@ private constructor(
243245
radius,
244246
raw,
245247
rotation,
248+
saturation,
246249
shadow,
247250
sharpen,
248251
startOffset,
@@ -723,6 +726,17 @@ private constructor(
723726
*/
724727
fun rotation(): Optional<Rotation> = rotation.getOptional("rotation")
725728

729+
/**
730+
* Adjusts the color saturation of the image. Accepts an integer from -100 to 100. Negative
731+
* values desaturate (`-100` is fully gray), positive values increase saturation, and `0` leaves
732+
* the image unchanged. Supported inside image overlays. Not supported for animated images. See
733+
* [Saturation](https://imagekit.io/docs/effects-and-enhancements#saturation---e-saturation).
734+
*
735+
* @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
736+
* server responded with an unexpected value).
737+
*/
738+
fun saturation(): Optional<Long> = saturation.getOptional("saturation")
739+
726740
/**
727741
* Adds a shadow beneath solid objects in an image with a transparent background. For AI-based
728742
* drop shadows, refer to aiDropShadow. Pass `true` for a default shadow, or provide a string
@@ -1181,6 +1195,13 @@ private constructor(
11811195
*/
11821196
@JsonProperty("rotation") @ExcludeMissing fun _rotation(): JsonField<Rotation> = rotation
11831197

1198+
/**
1199+
* Returns the raw JSON value of [saturation].
1200+
*
1201+
* Unlike [saturation], this method doesn't throw if the JSON field has an unexpected type.
1202+
*/
1203+
@JsonProperty("saturation") @ExcludeMissing fun _saturation(): JsonField<Long> = saturation
1204+
11841205
/**
11851206
* Returns the raw JSON value of [shadow].
11861207
*
@@ -1346,6 +1367,7 @@ private constructor(
13461367
private var radius: JsonField<Radius> = JsonMissing.of()
13471368
private var raw: JsonField<String> = JsonMissing.of()
13481369
private var rotation: JsonField<Rotation> = JsonMissing.of()
1370+
private var saturation: JsonField<Long> = JsonMissing.of()
13491371
private var shadow: JsonField<Shadow> = JsonMissing.of()
13501372
private var sharpen: JsonField<Sharpen> = JsonMissing.of()
13511373
private var startOffset: JsonField<StartOffset> = JsonMissing.of()
@@ -1406,6 +1428,7 @@ private constructor(
14061428
radius = transformation.radius
14071429
raw = transformation.raw
14081430
rotation = transformation.rotation
1431+
saturation = transformation.saturation
14091432
shadow = transformation.shadow
14101433
sharpen = transformation.sharpen
14111434
startOffset = transformation.startOffset
@@ -2280,6 +2303,23 @@ private constructor(
22802303
/** Alias for calling [rotation] with `Rotation.ofString(string)`. */
22812304
fun rotation(string: String) = rotation(Rotation.ofString(string))
22822305

2306+
/**
2307+
* Adjusts the color saturation of the image. Accepts an integer from -100 to 100. Negative
2308+
* values desaturate (`-100` is fully gray), positive values increase saturation, and `0`
2309+
* leaves the image unchanged. Supported inside image overlays. Not supported for animated
2310+
* images. See
2311+
* [Saturation](https://imagekit.io/docs/effects-and-enhancements#saturation---e-saturation).
2312+
*/
2313+
fun saturation(saturation: Long) = saturation(JsonField.of(saturation))
2314+
2315+
/**
2316+
* Sets [Builder.saturation] to an arbitrary JSON value.
2317+
*
2318+
* You should usually call [Builder.saturation] with a well-typed [Long] value instead. This
2319+
* method is primarily for setting the field to an undocumented or not yet supported value.
2320+
*/
2321+
fun saturation(saturation: JsonField<Long>) = apply { this.saturation = saturation }
2322+
22832323
/**
22842324
* Adds a shadow beneath solid objects in an image with a transparent background. For
22852325
* AI-based drop shadows, refer to aiDropShadow. Pass `true` for a default shadow, or
@@ -2626,6 +2666,7 @@ private constructor(
26262666
radius,
26272667
raw,
26282668
rotation,
2669+
saturation,
26292670
shadow,
26302671
sharpen,
26312672
startOffset,
@@ -2701,6 +2742,7 @@ private constructor(
27012742
radius().ifPresent { it.validate() }
27022743
raw()
27032744
rotation().ifPresent { it.validate() }
2745+
saturation()
27042746
shadow().ifPresent { it.validate() }
27052747
sharpen().ifPresent { it.validate() }
27062748
startOffset().ifPresent { it.validate() }
@@ -2775,6 +2817,7 @@ private constructor(
27752817
(radius.asKnown().getOrNull()?.validity() ?: 0) +
27762818
(if (raw.asKnown().isPresent) 1 else 0) +
27772819
(rotation.asKnown().getOrNull()?.validity() ?: 0) +
2820+
(if (saturation.asKnown().isPresent) 1 else 0) +
27782821
(shadow.asKnown().getOrNull()?.validity() ?: 0) +
27792822
(sharpen.asKnown().getOrNull()?.validity() ?: 0) +
27802823
(startOffset.asKnown().getOrNull()?.validity() ?: 0) +
@@ -9080,6 +9123,7 @@ private constructor(
90809123
radius == other.radius &&
90819124
raw == other.raw &&
90829125
rotation == other.rotation &&
9126+
saturation == other.saturation &&
90839127
shadow == other.shadow &&
90849128
sharpen == other.sharpen &&
90859129
startOffset == other.startOffset &&
@@ -9141,6 +9185,7 @@ private constructor(
91419185
radius,
91429186
raw,
91439187
rotation,
9188+
saturation,
91449189
shadow,
91459190
sharpen,
91469191
startOffset,
@@ -9161,5 +9206,5 @@ private constructor(
91619206
override fun hashCode(): Int = hashCode
91629207

91639208
override fun toString() =
9164-
"Transformation{aiChangeBackground=$aiChangeBackground, aiDropShadow=$aiDropShadow, aiEdit=$aiEdit, aiRemoveBackground=$aiRemoveBackground, aiRemoveBackgroundExternal=$aiRemoveBackgroundExternal, aiRetouch=$aiRetouch, aiUpscale=$aiUpscale, aiVariation=$aiVariation, aspectRatio=$aspectRatio, audioCodec=$audioCodec, background=$background, blur=$blur, border=$border, colorize=$colorize, colorProfile=$colorProfile, colorReplace=$colorReplace, contrastStretch=$contrastStretch, crop=$crop, cropMode=$cropMode, defaultImage=$defaultImage, density=$density, distort=$distort, dpr=$dpr, duration=$duration, endOffset=$endOffset, flip=$flip, focus=$focus, format=$format, gradient=$gradient, grayscale=$grayscale, height=$height, lossless=$lossless, metadata=$metadata, named=$named, opacity=$opacity, original=$original, overlay=$overlay, page=$page, progressive=$progressive, quality=$quality, radius=$radius, raw=$raw, rotation=$rotation, shadow=$shadow, sharpen=$sharpen, startOffset=$startOffset, streamingResolutions=$streamingResolutions, trim=$trim, unsharpMask=$unsharpMask, videoCodec=$videoCodec, width=$width, x=$x, xCenter=$xCenter, y=$y, yCenter=$yCenter, zoom=$zoom, additionalProperties=$additionalProperties}"
9209+
"Transformation{aiChangeBackground=$aiChangeBackground, aiDropShadow=$aiDropShadow, aiEdit=$aiEdit, aiRemoveBackground=$aiRemoveBackground, aiRemoveBackgroundExternal=$aiRemoveBackgroundExternal, aiRetouch=$aiRetouch, aiUpscale=$aiUpscale, aiVariation=$aiVariation, aspectRatio=$aspectRatio, audioCodec=$audioCodec, background=$background, blur=$blur, border=$border, colorize=$colorize, colorProfile=$colorProfile, colorReplace=$colorReplace, contrastStretch=$contrastStretch, crop=$crop, cropMode=$cropMode, defaultImage=$defaultImage, density=$density, distort=$distort, dpr=$dpr, duration=$duration, endOffset=$endOffset, flip=$flip, focus=$focus, format=$format, gradient=$gradient, grayscale=$grayscale, height=$height, lossless=$lossless, metadata=$metadata, named=$named, opacity=$opacity, original=$original, overlay=$overlay, page=$page, progressive=$progressive, quality=$quality, radius=$radius, raw=$raw, rotation=$rotation, saturation=$saturation, shadow=$shadow, sharpen=$sharpen, startOffset=$startOffset, streamingResolutions=$streamingResolutions, trim=$trim, unsharpMask=$unsharpMask, videoCodec=$videoCodec, width=$width, x=$x, xCenter=$xCenter, y=$y, yCenter=$yCenter, zoom=$zoom, additionalProperties=$additionalProperties}"
91659210
}

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/GetImageAttributesOptionsTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ internal class GetImageAttributesOptionsTest {
111111
.radius(20.0)
112112
.raw("raw")
113113
.rotation(90.0)
114+
.saturation(-100L)
114115
.shadowTrue()
115116
.sharpenTrue()
116117
.startOffset(0.0)
@@ -227,6 +228,7 @@ internal class GetImageAttributesOptionsTest {
227228
.radius(20.0)
228229
.raw("raw")
229230
.rotation(90.0)
231+
.saturation(-100L)
230232
.shadowTrue()
231233
.sharpenTrue()
232234
.startOffset(0.0)
@@ -353,6 +355,7 @@ internal class GetImageAttributesOptionsTest {
353355
.radius(20.0)
354356
.raw("raw")
355357
.rotation(90.0)
358+
.saturation(-100L)
356359
.shadowTrue()
357360
.sharpenTrue()
358361
.startOffset(0.0)

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/ImageOverlayTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ internal class ImageOverlayTest {
115115
.radius(20.0)
116116
.raw("raw")
117117
.rotation(90.0)
118+
.saturation(-100L)
118119
.shadowTrue()
119120
.sharpenTrue()
120121
.startOffset(0.0)
@@ -230,6 +231,7 @@ internal class ImageOverlayTest {
230231
.radius(20.0)
231232
.raw("raw")
232233
.rotation(90.0)
234+
.saturation(-100L)
233235
.shadowTrue()
234236
.sharpenTrue()
235237
.startOffset(0.0)
@@ -353,6 +355,7 @@ internal class ImageOverlayTest {
353355
.radius(20.0)
354356
.raw("raw")
355357
.rotation(90.0)
358+
.saturation(-100L)
356359
.shadowTrue()
357360
.sharpenTrue()
358361
.startOffset(0.0)

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/OverlayTest.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ internal class OverlayTest {
211211
.radius(20.0)
212212
.raw("raw")
213213
.rotation(90.0)
214+
.saturation(-100L)
214215
.shadowTrue()
215216
.sharpenTrue()
216217
.startOffset(0.0)
@@ -346,6 +347,7 @@ internal class OverlayTest {
346347
.radius(20.0)
347348
.raw("raw")
348349
.rotation(90.0)
350+
.saturation(-100L)
349351
.shadowTrue()
350352
.sharpenTrue()
351353
.startOffset(0.0)
@@ -475,6 +477,7 @@ internal class OverlayTest {
475477
.radius(20.0)
476478
.raw("raw")
477479
.rotation(90.0)
480+
.saturation(-100L)
478481
.shadowTrue()
479482
.sharpenTrue()
480483
.startOffset(0.0)
@@ -610,6 +613,7 @@ internal class OverlayTest {
610613
.radius(20.0)
611614
.raw("raw")
612615
.rotation(90.0)
616+
.saturation(-100L)
613617
.shadowTrue()
614618
.sharpenTrue()
615619
.startOffset(0.0)

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/SrcOptionsTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ internal class SrcOptionsTest {
111111
.radius(20.0)
112112
.raw("raw")
113113
.rotation(90.0)
114+
.saturation(-100L)
114115
.shadowTrue()
115116
.sharpenTrue()
116117
.startOffset(0.0)
@@ -221,6 +222,7 @@ internal class SrcOptionsTest {
221222
.radius(20.0)
222223
.raw("raw")
223224
.rotation(90.0)
225+
.saturation(-100L)
224226
.shadowTrue()
225227
.sharpenTrue()
226228
.startOffset(0.0)
@@ -340,6 +342,7 @@ internal class SrcOptionsTest {
340342
.radius(20.0)
341343
.raw("raw")
342344
.rotation(90.0)
345+
.saturation(-100L)
343346
.shadowTrue()
344347
.sharpenTrue()
345348
.startOffset(0.0)

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/TransformationTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ internal class TransformationTest {
9191
.radius(20.0)
9292
.raw("raw")
9393
.rotation(90.0)
94+
.saturation(-100L)
9495
.shadowTrue()
9596
.sharpenTrue()
9697
.startOffset(0.0)
@@ -189,6 +190,7 @@ internal class TransformationTest {
189190
assertThat(transformation.radius()).contains(Transformation.Radius.ofNumber(20.0))
190191
assertThat(transformation.raw()).contains("raw")
191192
assertThat(transformation.rotation()).contains(Transformation.Rotation.ofNumber(90.0))
193+
assertThat(transformation.saturation()).contains(-100L)
192194
assertThat(transformation.shadow()).contains(Transformation.Shadow.ofTrue())
193195
assertThat(transformation.sharpen()).contains(Transformation.Sharpen.ofTrue())
194196
assertThat(transformation.startOffset()).contains(Transformation.StartOffset.ofNumber(0.0))
@@ -287,6 +289,7 @@ internal class TransformationTest {
287289
.radius(20.0)
288290
.raw("raw")
289291
.rotation(90.0)
292+
.saturation(-100L)
290293
.shadowTrue()
291294
.sharpenTrue()
292295
.startOffset(0.0)

‎image-kit-java-core/src/test/kotlin/io/imagekit/models/VideoOverlayTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ internal class VideoOverlayTest {
115115
.radius(20.0)
116116
.raw("raw")
117117
.rotation(90.0)
118+
.saturation(-100L)
118119
.shadowTrue()
119120
.sharpenTrue()
120121
.startOffset(0.0)
@@ -230,6 +231,7 @@ internal class VideoOverlayTest {
230231
.radius(20.0)
231232
.raw("raw")
232233
.rotation(90.0)
234+
.saturation(-100L)
233235
.shadowTrue()
234236
.sharpenTrue()
235237
.startOffset(0.0)
@@ -353,6 +355,7 @@ internal class VideoOverlayTest {
353355
.radius(20.0)
354356
.raw("raw")
355357
.rotation(90.0)
358+
.saturation(-100L)
356359
.shadowTrue()
357360
.sharpenTrue()
358361
.startOffset(0.0)

0 commit comments

Comments
 (0)