@@ -20,10 +20,8 @@ import com.openai.core.ExcludeMissing
20
20
import com.openai.core.JsonField
21
21
import com.openai.core.JsonMissing
22
22
import com.openai.core.JsonValue
23
- import com.openai.core.checkKnown
24
23
import com.openai.core.checkRequired
25
24
import com.openai.core.getOrThrow
26
- import com.openai.core.toImmutable
27
25
import com.openai.errors.OpenAIInvalidDataException
28
26
import java.util.Collections
29
27
import java.util.Objects
@@ -525,18 +523,14 @@ private constructor(
525
523
private constructor (
526
524
private val query: JsonField <String >,
527
525
private val type: JsonValue ,
528
- private val domains: JsonField <List <String >>,
529
526
private val additionalProperties: MutableMap <String , JsonValue >,
530
527
) {
531
528
532
529
@JsonCreator
533
530
private constructor (
534
531
@JsonProperty(" query" ) @ExcludeMissing query: JsonField <String > = JsonMissing .of(),
535
532
@JsonProperty(" type" ) @ExcludeMissing type: JsonValue = JsonMissing .of(),
536
- @JsonProperty(" domains" )
537
- @ExcludeMissing
538
- domains: JsonField <List <String >> = JsonMissing .of(),
539
- ) : this (query, type, domains, mutableMapOf ())
533
+ ) : this (query, type, mutableMapOf ())
540
534
541
535
/* *
542
536
* The search query.
@@ -560,30 +554,13 @@ private constructor(
560
554
*/
561
555
@JsonProperty(" type" ) @ExcludeMissing fun _type (): JsonValue = type
562
556
563
- /* *
564
- * Domains to restrict the search or domains where results were found.
565
- *
566
- * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if
567
- * the server responded with an unexpected value).
568
- */
569
- fun domains (): Optional <List <String >> = domains.getOptional(" domains" )
570
-
571
557
/* *
572
558
* Returns the raw JSON value of [query].
573
559
*
574
560
* Unlike [query], this method doesn't throw if the JSON field has an unexpected type.
575
561
*/
576
562
@JsonProperty(" query" ) @ExcludeMissing fun _query (): JsonField <String > = query
577
563
578
- /* *
579
- * Returns the raw JSON value of [domains].
580
- *
581
- * Unlike [domains], this method doesn't throw if the JSON field has an unexpected type.
582
- */
583
- @JsonProperty(" domains" )
584
- @ExcludeMissing
585
- fun _domains (): JsonField <List <String >> = domains
586
-
587
564
@JsonAnySetter
588
565
private fun putAdditionalProperty (key : String , value : JsonValue ) {
589
566
additionalProperties.put(key, value)
@@ -614,14 +591,12 @@ private constructor(
614
591
615
592
private var query: JsonField <String >? = null
616
593
private var type: JsonValue = JsonValue .from(" search" )
617
- private var domains: JsonField <MutableList <String >>? = null
618
594
private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
619
595
620
596
@JvmSynthetic
621
597
internal fun from (search : Search ) = apply {
622
598
query = search.query
623
599
type = search.type
624
- domains = search.domains.map { it.toMutableList() }
625
600
additionalProperties = search.additionalProperties.toMutableMap()
626
601
}
627
602
@@ -651,32 +626,6 @@ private constructor(
651
626
*/
652
627
fun type (type : JsonValue ) = apply { this .type = type }
653
628
654
- /* * Domains to restrict the search or domains where results were found. */
655
- fun domains (domains : List <String >) = domains(JsonField .of(domains))
656
-
657
- /* *
658
- * Sets [Builder.domains] to an arbitrary JSON value.
659
- *
660
- * You should usually call [Builder.domains] with a well-typed `List<String>` value
661
- * instead. This method is primarily for setting the field to an undocumented or not
662
- * yet supported value.
663
- */
664
- fun domains (domains : JsonField <List <String >>) = apply {
665
- this .domains = domains.map { it.toMutableList() }
666
- }
667
-
668
- /* *
669
- * Adds a single [String] to [domains].
670
- *
671
- * @throws IllegalStateException if the field was previously set to a non-list.
672
- */
673
- fun addDomain (domain : String ) = apply {
674
- domains =
675
- (domains ? : JsonField .of(mutableListOf ())).also {
676
- checkKnown(" domains" , it).add(domain)
677
- }
678
- }
679
-
680
629
fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
681
630
this .additionalProperties.clear()
682
631
putAllAdditionalProperties(additionalProperties)
@@ -712,12 +661,7 @@ private constructor(
712
661
* @throws IllegalStateException if any required field is unset.
713
662
*/
714
663
fun build (): Search =
715
- Search (
716
- checkRequired(" query" , query),
717
- type,
718
- (domains ? : JsonMissing .of()).map { it.toImmutable() },
719
- additionalProperties.toMutableMap(),
720
- )
664
+ Search (checkRequired(" query" , query), type, additionalProperties.toMutableMap())
721
665
}
722
666
723
667
private var validated: Boolean = false
@@ -733,7 +677,6 @@ private constructor(
733
677
throw OpenAIInvalidDataException (" 'type' is invalid, received $it " )
734
678
}
735
679
}
736
- domains()
737
680
validated = true
738
681
}
739
682
@@ -754,25 +697,24 @@ private constructor(
754
697
@JvmSynthetic
755
698
internal fun validity (): Int =
756
699
(if (query.asKnown().isPresent) 1 else 0 ) +
757
- type.let { if (it == JsonValue .from(" search" )) 1 else 0 } +
758
- (domains.asKnown().getOrNull()?.size ? : 0 )
700
+ type.let { if (it == JsonValue .from(" search" )) 1 else 0 }
759
701
760
702
override fun equals (other : Any? ): Boolean {
761
703
if (this == = other) {
762
704
return true
763
705
}
764
706
765
- return /* spotless:off */ other is Search && query == other.query && type == other.type && domains == other.domains && additionalProperties == other.additionalProperties /* spotless:on */
707
+ return /* spotless:off */ other is Search && query == other.query && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */
766
708
}
767
709
768
710
/* spotless:off */
769
- private val hashCode: Int by lazy { Objects .hash(query, type, domains, additionalProperties) }
711
+ private val hashCode: Int by lazy { Objects .hash(query, type, additionalProperties) }
770
712
/* spotless:on */
771
713
772
714
override fun hashCode (): Int = hashCode
773
715
774
716
override fun toString () =
775
- " Search{query=$query , type=$type , domains= $domains , additionalProperties=$additionalProperties }"
717
+ " Search{query=$query , type=$type , additionalProperties=$additionalProperties }"
776
718
}
777
719
778
720
/* * Action type "open_page" - Opens a specific URL from search results. */
0 commit comments