@@ -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}
0 commit comments