@@ -53,6 +53,7 @@ private constructor(
5353 private val background: JsonField <String >,
5454 private val blur: JsonField <Double >,
5555 private val border: JsonField <String >,
56+ private val colorize: JsonField <String >,
5657 private val colorProfile: JsonField <Boolean >,
5758 private val colorReplace: JsonField <String >,
5859 private val contrastStretch: JsonField <ContrastStretch >,
@@ -132,6 +133,7 @@ private constructor(
132133 background: JsonField <String > = JsonMissing .of(),
133134 @JsonProperty(" blur" ) @ExcludeMissing blur: JsonField <Double > = JsonMissing .of(),
134135 @JsonProperty(" border" ) @ExcludeMissing border: JsonField <String > = JsonMissing .of(),
136+ @JsonProperty(" colorize" ) @ExcludeMissing colorize: JsonField <String > = JsonMissing .of(),
135137 @JsonProperty(" colorProfile" )
136138 @ExcludeMissing
137139 colorProfile: JsonField <Boolean > = JsonMissing .of(),
@@ -209,6 +211,7 @@ private constructor(
209211 background,
210212 blur,
211213 border,
214+ colorize,
212215 colorProfile,
213216 colorReplace,
214217 contrastStretch,
@@ -399,6 +402,17 @@ private constructor(
399402 */
400403 fun border (): Optional <String > = border.getOptional(" border" )
401404
405+ /* *
406+ * Applies a color tint to the image. Accepts color and intensity as optional parameters.
407+ * - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray color.
408+ * - `in-intensity` - Intensity of the color (0-100). Default is 35. See
409+ * [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
410+ *
411+ * @throws ImageKitInvalidDataException if the JSON field has an unexpected type (e.g. if the
412+ * server responded with an unexpected value).
413+ */
414+ fun colorize (): Optional <String > = colorize.getOptional(" colorize" )
415+
402416 /* *
403417 * Indicates whether the output image should retain the original color profile. See
404418 * [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
@@ -932,6 +946,13 @@ private constructor(
932946 */
933947 @JsonProperty(" border" ) @ExcludeMissing fun _border (): JsonField <String > = border
934948
949+ /* *
950+ * Returns the raw JSON value of [colorize].
951+ *
952+ * Unlike [colorize], this method doesn't throw if the JSON field has an unexpected type.
953+ */
954+ @JsonProperty(" colorize" ) @ExcludeMissing fun _colorize (): JsonField <String > = colorize
955+
935956 /* *
936957 * Returns the raw JSON value of [colorProfile].
937958 *
@@ -1273,6 +1294,7 @@ private constructor(
12731294 private var background: JsonField <String > = JsonMissing .of()
12741295 private var blur: JsonField <Double > = JsonMissing .of()
12751296 private var border: JsonField <String > = JsonMissing .of()
1297+ private var colorize: JsonField <String > = JsonMissing .of()
12761298 private var colorProfile: JsonField <Boolean > = JsonMissing .of()
12771299 private var colorReplace: JsonField <String > = JsonMissing .of()
12781300 private var contrastStretch: JsonField <ContrastStretch > = JsonMissing .of()
@@ -1331,6 +1353,7 @@ private constructor(
13311353 background = transformation.background
13321354 blur = transformation.blur
13331355 border = transformation.border
1356+ colorize = transformation.colorize
13341357 colorProfile = transformation.colorProfile
13351358 colorReplace = transformation.colorReplace
13361359 contrastStretch = transformation.contrastStretch
@@ -1625,6 +1648,22 @@ private constructor(
16251648 */
16261649 fun border (border : JsonField <String >) = apply { this .border = border }
16271650
1651+ /* *
1652+ * Applies a color tint to the image. Accepts color and intensity as optional parameters.
1653+ * - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray color.
1654+ * - `in-intensity` - Intensity of the color (0-100). Default is 35. See
1655+ * [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize).
1656+ */
1657+ fun colorize (colorize : String ) = colorize(JsonField .of(colorize))
1658+
1659+ /* *
1660+ * Sets [Builder.colorize] to an arbitrary JSON value.
1661+ *
1662+ * You should usually call [Builder.colorize] with a well-typed [String] value instead. This
1663+ * method is primarily for setting the field to an undocumented or not yet supported value.
1664+ */
1665+ fun colorize (colorize : JsonField <String >) = apply { this .colorize = colorize }
1666+
16281667 /* *
16291668 * Indicates whether the output image should retain the original color profile. See
16301669 * [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
@@ -2510,6 +2549,7 @@ private constructor(
25102549 background,
25112550 blur,
25122551 border,
2552+ colorize,
25132553 colorProfile,
25142554 colorReplace,
25152555 contrastStretch,
@@ -2583,6 +2623,7 @@ private constructor(
25832623 background()
25842624 blur()
25852625 border()
2626+ colorize()
25862627 colorProfile()
25872628 colorReplace()
25882629 contrastStretch().ifPresent { it.validate() }
@@ -2655,6 +2696,7 @@ private constructor(
26552696 (if (background.asKnown().isPresent) 1 else 0 ) +
26562697 (if (blur.asKnown().isPresent) 1 else 0 ) +
26572698 (if (border.asKnown().isPresent) 1 else 0 ) +
2699+ (if (colorize.asKnown().isPresent) 1 else 0 ) +
26582700 (if (colorProfile.asKnown().isPresent) 1 else 0 ) +
26592701 (if (colorReplace.asKnown().isPresent) 1 else 0 ) +
26602702 (contrastStretch.asKnown().getOrNull()?.validity() ? : 0 ) +
@@ -4124,6 +4166,8 @@ private constructor(
41244166
41254167 @JvmField val MAINTAIN_RATIO = of(" maintain_ratio" )
41264168
4169+ @JvmField val MAINTAIN_RATIO_NO_ENLARGE = of(" maintain_ratio_no_enlarge" )
4170+
41274171 @JvmStatic fun of (value : String ) = Crop (JsonField .of(value))
41284172 }
41294173
@@ -4134,6 +4178,7 @@ private constructor(
41344178 AT_MAX_ENLARGE ,
41354179 AT_LEAST ,
41364180 MAINTAIN_RATIO ,
4181+ MAINTAIN_RATIO_NO_ENLARGE ,
41374182 }
41384183
41394184 /* *
@@ -4151,6 +4196,7 @@ private constructor(
41514196 AT_MAX_ENLARGE ,
41524197 AT_LEAST ,
41534198 MAINTAIN_RATIO ,
4199+ MAINTAIN_RATIO_NO_ENLARGE ,
41544200 /* * An enum member indicating that [Crop] was instantiated with an unknown value. */
41554201 _UNKNOWN ,
41564202 }
@@ -4169,6 +4215,7 @@ private constructor(
41694215 AT_MAX_ENLARGE -> Value .AT_MAX_ENLARGE
41704216 AT_LEAST -> Value .AT_LEAST
41714217 MAINTAIN_RATIO -> Value .MAINTAIN_RATIO
4218+ MAINTAIN_RATIO_NO_ENLARGE -> Value .MAINTAIN_RATIO_NO_ENLARGE
41724219 else -> Value ._UNKNOWN
41734220 }
41744221
@@ -4188,6 +4235,7 @@ private constructor(
41884235 AT_MAX_ENLARGE -> Known .AT_MAX_ENLARGE
41894236 AT_LEAST -> Known .AT_LEAST
41904237 MAINTAIN_RATIO -> Known .MAINTAIN_RATIO
4238+ MAINTAIN_RATIO_NO_ENLARGE -> Known .MAINTAIN_RATIO_NO_ENLARGE
41914239 else -> throw ImageKitInvalidDataException (" Unknown Crop: $value " )
41924240 }
41934241
@@ -4278,6 +4326,10 @@ private constructor(
42784326
42794327 @JvmField val PAD_EXTRACT = of(" pad_extract" )
42804328
4329+ @JvmField val PAD_RESIZE_NO_ENLARGE = of(" pad_resize_no_enlarge" )
4330+
4331+ @JvmField val PAD_EXTRACT_NO_SHRINK = of(" pad_extract_no_shrink" )
4332+
42814333 @JvmStatic fun of (value : String ) = CropMode (JsonField .of(value))
42824334 }
42834335
@@ -4286,6 +4338,8 @@ private constructor(
42864338 PAD_RESIZE ,
42874339 EXTRACT ,
42884340 PAD_EXTRACT ,
4341+ PAD_RESIZE_NO_ENLARGE ,
4342+ PAD_EXTRACT_NO_SHRINK ,
42894343 }
42904344
42914345 /* *
@@ -4301,6 +4355,8 @@ private constructor(
43014355 PAD_RESIZE ,
43024356 EXTRACT ,
43034357 PAD_EXTRACT ,
4358+ PAD_RESIZE_NO_ENLARGE ,
4359+ PAD_EXTRACT_NO_SHRINK ,
43044360 /* * An enum member indicating that [CropMode] was instantiated with an unknown value. */
43054361 _UNKNOWN ,
43064362 }
@@ -4317,6 +4373,8 @@ private constructor(
43174373 PAD_RESIZE -> Value .PAD_RESIZE
43184374 EXTRACT -> Value .EXTRACT
43194375 PAD_EXTRACT -> Value .PAD_EXTRACT
4376+ PAD_RESIZE_NO_ENLARGE -> Value .PAD_RESIZE_NO_ENLARGE
4377+ PAD_EXTRACT_NO_SHRINK -> Value .PAD_EXTRACT_NO_SHRINK
43204378 else -> Value ._UNKNOWN
43214379 }
43224380
@@ -4334,6 +4392,8 @@ private constructor(
43344392 PAD_RESIZE -> Known .PAD_RESIZE
43354393 EXTRACT -> Known .EXTRACT
43364394 PAD_EXTRACT -> Known .PAD_EXTRACT
4395+ PAD_RESIZE_NO_ENLARGE -> Known .PAD_RESIZE_NO_ENLARGE
4396+ PAD_EXTRACT_NO_SHRINK -> Known .PAD_EXTRACT_NO_SHRINK
43374397 else -> throw ImageKitInvalidDataException (" Unknown CropMode: $value " )
43384398 }
43394399
@@ -8726,6 +8786,7 @@ private constructor(
87268786 background == other.background &&
87278787 blur == other.blur &&
87288788 border == other.border &&
8789+ colorize == other.colorize &&
87298790 colorProfile == other.colorProfile &&
87308791 colorReplace == other.colorReplace &&
87318792 contrastStretch == other.contrastStretch &&
@@ -8785,6 +8846,7 @@ private constructor(
87858846 background,
87868847 blur,
87878848 border,
8849+ colorize,
87888850 colorProfile,
87898851 colorReplace,
87908852 contrastStretch,
@@ -8833,5 +8895,5 @@ private constructor(
88338895 override fun hashCode (): Int = hashCode
88348896
88358897 override fun toString () =
8836- "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, colorProfile=$colorProfile, colorReplace=$colorReplace, contrastStretch=$contrastStretch, crop=$crop, cropMode=$cropMode, defaultImage=$defaultImage, 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}"
8898+ "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, 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}"
88378899}
0 commit comments