Skip to content

Commit e09f05c

Browse files
feat(api): api update
1 parent e7cf423 commit e09f05c

File tree

5 files changed

+120
-4
lines changed

5 files changed

+120
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 16
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-ec0e897d65bee0947046681fd3cd465ee5b44c98b020594736fb9f274ee2c00b.yml
3-
openapi_spec_hash: 9c76eb4b912f046fc93a030b9a7489a3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-98ef96cef5b06ad7a29dadba48258da7d9ea0a2b3938dc9e714ae06eb9afa1a3.yml
3+
openapi_spec_hash: 9e957a30999dff7d4ada925e437bd202
44
config_hash: c3aaaa9794dba44d524c06591ab17894

brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandAiProductResponse.kt

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ private constructor(
373373
private constructor(
374374
private val description: JsonField<String>,
375375
private val features: JsonField<List<String>>,
376+
private val images: JsonField<List<String>>,
376377
private val name: JsonField<String>,
377378
private val tags: JsonField<List<String>>,
378379
private val targetAudience: JsonField<List<String>>,
@@ -394,6 +395,9 @@ private constructor(
394395
@JsonProperty("features")
395396
@ExcludeMissing
396397
features: JsonField<List<String>> = JsonMissing.of(),
398+
@JsonProperty("images")
399+
@ExcludeMissing
400+
images: JsonField<List<String>> = JsonMissing.of(),
397401
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
398402
@JsonProperty("tags") @ExcludeMissing tags: JsonField<List<String>> = JsonMissing.of(),
399403
@JsonProperty("target_audience")
@@ -419,6 +423,7 @@ private constructor(
419423
) : this(
420424
description,
421425
features,
426+
images,
422427
name,
423428
tags,
424429
targetAudience,
@@ -448,6 +453,14 @@ private constructor(
448453
*/
449454
fun features(): List<String> = features.getRequired("features")
450455

456+
/**
457+
* URLs to product images on the page (up to 7)
458+
*
459+
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type or is
460+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
461+
*/
462+
fun images(): List<String> = images.getRequired("images")
463+
451464
/**
452465
* Name of the product
453466
*
@@ -547,6 +560,13 @@ private constructor(
547560
@ExcludeMissing
548561
fun _features(): JsonField<List<String>> = features
549562

563+
/**
564+
* Returns the raw JSON value of [images].
565+
*
566+
* Unlike [images], this method doesn't throw if the JSON field has an unexpected type.
567+
*/
568+
@JsonProperty("images") @ExcludeMissing fun _images(): JsonField<List<String>> = images
569+
550570
/**
551571
* Returns the raw JSON value of [name].
552572
*
@@ -647,6 +667,7 @@ private constructor(
647667
* ```java
648668
* .description()
649669
* .features()
670+
* .images()
650671
* .name()
651672
* .tags()
652673
* .targetAudience()
@@ -660,6 +681,7 @@ private constructor(
660681

661682
private var description: JsonField<String>? = null
662683
private var features: JsonField<MutableList<String>>? = null
684+
private var images: JsonField<MutableList<String>>? = null
663685
private var name: JsonField<String>? = null
664686
private var tags: JsonField<MutableList<String>>? = null
665687
private var targetAudience: JsonField<MutableList<String>>? = null
@@ -676,6 +698,7 @@ private constructor(
676698
internal fun from(product: Product) = apply {
677699
description = product.description
678700
features = product.features.map { it.toMutableList() }
701+
images = product.images.map { it.toMutableList() }
679702
name = product.name
680703
tags = product.tags.map { it.toMutableList() }
681704
targetAudience = product.targetAudience.map { it.toMutableList() }
@@ -729,6 +752,32 @@ private constructor(
729752
}
730753
}
731754

755+
/** URLs to product images on the page (up to 7) */
756+
fun images(images: List<String>) = images(JsonField.of(images))
757+
758+
/**
759+
* Sets [Builder.images] to an arbitrary JSON value.
760+
*
761+
* You should usually call [Builder.images] with a well-typed `List<String>` value
762+
* instead. This method is primarily for setting the field to an undocumented or not yet
763+
* supported value.
764+
*/
765+
fun images(images: JsonField<List<String>>) = apply {
766+
this.images = images.map { it.toMutableList() }
767+
}
768+
769+
/**
770+
* Adds a single [String] to [images].
771+
*
772+
* @throws IllegalStateException if the field was previously set to a non-list.
773+
*/
774+
fun addImage(image: String) = apply {
775+
images =
776+
(images ?: JsonField.of(mutableListOf())).also {
777+
checkKnown("images", it).add(image)
778+
}
779+
}
780+
732781
/** Name of the product */
733782
fun name(name: String) = name(JsonField.of(name))
734783

@@ -942,6 +991,7 @@ private constructor(
942991
* ```java
943992
* .description()
944993
* .features()
994+
* .images()
945995
* .name()
946996
* .tags()
947997
* .targetAudience()
@@ -953,6 +1003,7 @@ private constructor(
9531003
Product(
9541004
checkRequired("description", description),
9551005
checkRequired("features", features).map { it.toImmutable() },
1006+
checkRequired("images", images).map { it.toImmutable() },
9561007
checkRequired("name", name),
9571008
checkRequired("tags", tags).map { it.toImmutable() },
9581009
checkRequired("targetAudience", targetAudience).map { it.toImmutable() },
@@ -976,6 +1027,7 @@ private constructor(
9761027

9771028
description()
9781029
features()
1030+
images()
9791031
name()
9801032
tags()
9811033
targetAudience()
@@ -1007,6 +1059,7 @@ private constructor(
10071059
internal fun validity(): Int =
10081060
(if (description.asKnown().isPresent) 1 else 0) +
10091061
(features.asKnown().getOrNull()?.size ?: 0) +
1062+
(images.asKnown().getOrNull()?.size ?: 0) +
10101063
(if (name.asKnown().isPresent) 1 else 0) +
10111064
(tags.asKnown().getOrNull()?.size ?: 0) +
10121065
(targetAudience.asKnown().getOrNull()?.size ?: 0) +
@@ -1322,6 +1375,7 @@ private constructor(
13221375
return other is Product &&
13231376
description == other.description &&
13241377
features == other.features &&
1378+
images == other.images &&
13251379
name == other.name &&
13261380
tags == other.tags &&
13271381
targetAudience == other.targetAudience &&
@@ -1339,6 +1393,7 @@ private constructor(
13391393
Objects.hash(
13401394
description,
13411395
features,
1396+
images,
13421397
name,
13431398
tags,
13441399
targetAudience,
@@ -1356,7 +1411,7 @@ private constructor(
13561411
override fun hashCode(): Int = hashCode
13571412

13581413
override fun toString() =
1359-
"Product{description=$description, features=$features, name=$name, tags=$tags, targetAudience=$targetAudience, billingFrequency=$billingFrequency, category=$category, currency=$currency, imageUrl=$imageUrl, price=$price, pricingModel=$pricingModel, url=$url, additionalProperties=$additionalProperties}"
1414+
"Product{description=$description, features=$features, images=$images, name=$name, tags=$tags, targetAudience=$targetAudience, billingFrequency=$billingFrequency, category=$category, currency=$currency, imageUrl=$imageUrl, price=$price, pricingModel=$pricingModel, url=$url, additionalProperties=$additionalProperties}"
13601415
}
13611416

13621417
override fun equals(other: Any?): Boolean {

brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandAiProductsResponse.kt

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ private constructor(
169169
private constructor(
170170
private val description: JsonField<String>,
171171
private val features: JsonField<List<String>>,
172+
private val images: JsonField<List<String>>,
172173
private val name: JsonField<String>,
173174
private val tags: JsonField<List<String>>,
174175
private val targetAudience: JsonField<List<String>>,
@@ -190,6 +191,9 @@ private constructor(
190191
@JsonProperty("features")
191192
@ExcludeMissing
192193
features: JsonField<List<String>> = JsonMissing.of(),
194+
@JsonProperty("images")
195+
@ExcludeMissing
196+
images: JsonField<List<String>> = JsonMissing.of(),
193197
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
194198
@JsonProperty("tags") @ExcludeMissing tags: JsonField<List<String>> = JsonMissing.of(),
195199
@JsonProperty("target_audience")
@@ -215,6 +219,7 @@ private constructor(
215219
) : this(
216220
description,
217221
features,
222+
images,
218223
name,
219224
tags,
220225
targetAudience,
@@ -244,6 +249,14 @@ private constructor(
244249
*/
245250
fun features(): List<String> = features.getRequired("features")
246251

252+
/**
253+
* URLs to product images on the page (up to 7)
254+
*
255+
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type or is
256+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
257+
*/
258+
fun images(): List<String> = images.getRequired("images")
259+
247260
/**
248261
* Name of the product
249262
*
@@ -343,6 +356,13 @@ private constructor(
343356
@ExcludeMissing
344357
fun _features(): JsonField<List<String>> = features
345358

359+
/**
360+
* Returns the raw JSON value of [images].
361+
*
362+
* Unlike [images], this method doesn't throw if the JSON field has an unexpected type.
363+
*/
364+
@JsonProperty("images") @ExcludeMissing fun _images(): JsonField<List<String>> = images
365+
346366
/**
347367
* Returns the raw JSON value of [name].
348368
*
@@ -443,6 +463,7 @@ private constructor(
443463
* ```java
444464
* .description()
445465
* .features()
466+
* .images()
446467
* .name()
447468
* .tags()
448469
* .targetAudience()
@@ -456,6 +477,7 @@ private constructor(
456477

457478
private var description: JsonField<String>? = null
458479
private var features: JsonField<MutableList<String>>? = null
480+
private var images: JsonField<MutableList<String>>? = null
459481
private var name: JsonField<String>? = null
460482
private var tags: JsonField<MutableList<String>>? = null
461483
private var targetAudience: JsonField<MutableList<String>>? = null
@@ -472,6 +494,7 @@ private constructor(
472494
internal fun from(product: Product) = apply {
473495
description = product.description
474496
features = product.features.map { it.toMutableList() }
497+
images = product.images.map { it.toMutableList() }
475498
name = product.name
476499
tags = product.tags.map { it.toMutableList() }
477500
targetAudience = product.targetAudience.map { it.toMutableList() }
@@ -525,6 +548,32 @@ private constructor(
525548
}
526549
}
527550

551+
/** URLs to product images on the page (up to 7) */
552+
fun images(images: List<String>) = images(JsonField.of(images))
553+
554+
/**
555+
* Sets [Builder.images] to an arbitrary JSON value.
556+
*
557+
* You should usually call [Builder.images] with a well-typed `List<String>` value
558+
* instead. This method is primarily for setting the field to an undocumented or not yet
559+
* supported value.
560+
*/
561+
fun images(images: JsonField<List<String>>) = apply {
562+
this.images = images.map { it.toMutableList() }
563+
}
564+
565+
/**
566+
* Adds a single [String] to [images].
567+
*
568+
* @throws IllegalStateException if the field was previously set to a non-list.
569+
*/
570+
fun addImage(image: String) = apply {
571+
images =
572+
(images ?: JsonField.of(mutableListOf())).also {
573+
checkKnown("images", it).add(image)
574+
}
575+
}
576+
528577
/** Name of the product */
529578
fun name(name: String) = name(JsonField.of(name))
530579

@@ -738,6 +787,7 @@ private constructor(
738787
* ```java
739788
* .description()
740789
* .features()
790+
* .images()
741791
* .name()
742792
* .tags()
743793
* .targetAudience()
@@ -749,6 +799,7 @@ private constructor(
749799
Product(
750800
checkRequired("description", description),
751801
checkRequired("features", features).map { it.toImmutable() },
802+
checkRequired("images", images).map { it.toImmutable() },
752803
checkRequired("name", name),
753804
checkRequired("tags", tags).map { it.toImmutable() },
754805
checkRequired("targetAudience", targetAudience).map { it.toImmutable() },
@@ -772,6 +823,7 @@ private constructor(
772823

773824
description()
774825
features()
826+
images()
775827
name()
776828
tags()
777829
targetAudience()
@@ -803,6 +855,7 @@ private constructor(
803855
internal fun validity(): Int =
804856
(if (description.asKnown().isPresent) 1 else 0) +
805857
(features.asKnown().getOrNull()?.size ?: 0) +
858+
(images.asKnown().getOrNull()?.size ?: 0) +
806859
(if (name.asKnown().isPresent) 1 else 0) +
807860
(tags.asKnown().getOrNull()?.size ?: 0) +
808861
(targetAudience.asKnown().getOrNull()?.size ?: 0) +
@@ -1118,6 +1171,7 @@ private constructor(
11181171
return other is Product &&
11191172
description == other.description &&
11201173
features == other.features &&
1174+
images == other.images &&
11211175
name == other.name &&
11221176
tags == other.tags &&
11231177
targetAudience == other.targetAudience &&
@@ -1135,6 +1189,7 @@ private constructor(
11351189
Objects.hash(
11361190
description,
11371191
features,
1192+
images,
11381193
name,
11391194
tags,
11401195
targetAudience,
@@ -1152,7 +1207,7 @@ private constructor(
11521207
override fun hashCode(): Int = hashCode
11531208

11541209
override fun toString() =
1155-
"Product{description=$description, features=$features, name=$name, tags=$tags, targetAudience=$targetAudience, billingFrequency=$billingFrequency, category=$category, currency=$currency, imageUrl=$imageUrl, price=$price, pricingModel=$pricingModel, url=$url, additionalProperties=$additionalProperties}"
1210+
"Product{description=$description, features=$features, images=$images, name=$name, tags=$tags, targetAudience=$targetAudience, billingFrequency=$billingFrequency, category=$category, currency=$currency, imageUrl=$imageUrl, price=$price, pricingModel=$pricingModel, url=$url, additionalProperties=$additionalProperties}"
11561211
}
11571212

11581213
override fun equals(other: Any?): Boolean {

brand-dev-java-core/src/test/kotlin/com/branddev/api/models/brand/BrandAiProductResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class BrandAiProductResponseTest {
1919
BrandAiProductResponse.Product.builder()
2020
.description("description")
2121
.addFeature("string")
22+
.addImage("string")
2223
.name("name")
2324
.addTag("string")
2425
.addTargetAudience("string")
@@ -41,6 +42,7 @@ internal class BrandAiProductResponseTest {
4142
BrandAiProductResponse.Product.builder()
4243
.description("description")
4344
.addFeature("string")
45+
.addImage("string")
4446
.name("name")
4547
.addTag("string")
4648
.addTargetAudience("string")
@@ -66,6 +68,7 @@ internal class BrandAiProductResponseTest {
6668
BrandAiProductResponse.Product.builder()
6769
.description("description")
6870
.addFeature("string")
71+
.addImage("string")
6972
.name("name")
7073
.addTag("string")
7174
.addTargetAudience("string")

brand-dev-java-core/src/test/kotlin/com/branddev/api/models/brand/BrandAiProductsResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal class BrandAiProductsResponseTest {
1818
BrandAiProductsResponse.Product.builder()
1919
.description("description")
2020
.addFeature("string")
21+
.addImage("string")
2122
.name("name")
2223
.addTag("string")
2324
.addTargetAudience("string")
@@ -37,6 +38,7 @@ internal class BrandAiProductsResponseTest {
3738
BrandAiProductsResponse.Product.builder()
3839
.description("description")
3940
.addFeature("string")
41+
.addImage("string")
4042
.name("name")
4143
.addTag("string")
4244
.addTargetAudience("string")
@@ -60,6 +62,7 @@ internal class BrandAiProductsResponseTest {
6062
BrandAiProductsResponse.Product.builder()
6163
.description("description")
6264
.addFeature("string")
65+
.addImage("string")
6366
.name("name")
6467
.addTag("string")
6568
.addTargetAudience("string")

0 commit comments

Comments
 (0)