@@ -27,35 +27,36 @@ class AllModels
27
27
private constructor (
28
28
private val string: String? = null ,
29
29
private val chatModel: ChatModel ? = null ,
30
- private val unionMember2 : UnionMember2 ? = null ,
30
+ private val responsesOnlyModel : ResponsesOnlyModel ? = null ,
31
31
private val _json : JsonValue ? = null ,
32
32
) {
33
33
34
34
fun string (): Optional <String > = Optional .ofNullable(string)
35
35
36
36
fun chatModel (): Optional <ChatModel > = Optional .ofNullable(chatModel)
37
37
38
- fun unionMember2 (): Optional <UnionMember2 > = Optional .ofNullable(unionMember2 )
38
+ fun responsesOnlyModel (): Optional <ResponsesOnlyModel > = Optional .ofNullable(responsesOnlyModel )
39
39
40
40
fun isString (): Boolean = string != null
41
41
42
42
fun isChatModel (): Boolean = chatModel != null
43
43
44
- fun isUnionMember2 (): Boolean = unionMember2 != null
44
+ fun isResponsesOnlyModel (): Boolean = responsesOnlyModel != null
45
45
46
46
fun asString (): String = string.getOrThrow(" string" )
47
47
48
48
fun asChatModel (): ChatModel = chatModel.getOrThrow(" chatModel" )
49
49
50
- fun asUnionMember2 (): UnionMember2 = unionMember2.getOrThrow(" unionMember2" )
50
+ fun asResponsesOnlyModel (): ResponsesOnlyModel =
51
+ responsesOnlyModel.getOrThrow(" responsesOnlyModel" )
51
52
52
53
fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
53
54
54
55
fun <T > accept (visitor : Visitor <T >): T =
55
56
when {
56
57
string != null -> visitor.visitString(string)
57
58
chatModel != null -> visitor.visitChatModel(chatModel)
58
- unionMember2 != null -> visitor.visitUnionMember2(unionMember2 )
59
+ responsesOnlyModel != null -> visitor.visitResponsesOnlyModel(responsesOnlyModel )
59
60
else -> visitor.unknown(_json )
60
61
}
61
62
@@ -74,8 +75,8 @@ private constructor(
74
75
chatModel.validate()
75
76
}
76
77
77
- override fun visitUnionMember2 ( unionMember2 : UnionMember2 ) {
78
- unionMember2 .validate()
78
+ override fun visitResponsesOnlyModel ( responsesOnlyModel : ResponsesOnlyModel ) {
79
+ responsesOnlyModel .validate()
79
80
}
80
81
}
81
82
)
@@ -103,7 +104,8 @@ private constructor(
103
104
104
105
override fun visitChatModel (chatModel : ChatModel ) = chatModel.validity()
105
106
106
- override fun visitUnionMember2 (unionMember2 : UnionMember2 ) = unionMember2.validity()
107
+ override fun visitResponsesOnlyModel (responsesOnlyModel : ResponsesOnlyModel ) =
108
+ responsesOnlyModel.validity()
107
109
108
110
override fun unknown (json : JsonValue ? ) = 0
109
111
}
@@ -114,16 +116,16 @@ private constructor(
114
116
return true
115
117
}
116
118
117
- return /* spotless:off */ other is AllModels && string == other.string && chatModel == other.chatModel && unionMember2 == other.unionMember2 /* spotless:on */
119
+ return /* spotless:off */ other is AllModels && string == other.string && chatModel == other.chatModel && responsesOnlyModel == other.responsesOnlyModel /* spotless:on */
118
120
}
119
121
120
- override fun hashCode (): Int = /* spotless:off */ Objects .hash(string, chatModel, unionMember2 ) /* spotless:on */
122
+ override fun hashCode (): Int = /* spotless:off */ Objects .hash(string, chatModel, responsesOnlyModel ) /* spotless:on */
121
123
122
124
override fun toString (): String =
123
125
when {
124
126
string != null -> " AllModels{string=$string }"
125
127
chatModel != null -> " AllModels{chatModel=$chatModel }"
126
- unionMember2 != null -> " AllModels{unionMember2= $unionMember2 }"
128
+ responsesOnlyModel != null -> " AllModels{responsesOnlyModel= $responsesOnlyModel }"
127
129
_json != null -> " AllModels{_unknown=$_json }"
128
130
else -> throw IllegalStateException (" Invalid AllModels" )
129
131
}
@@ -135,7 +137,8 @@ private constructor(
135
137
@JvmStatic fun ofChatModel (chatModel : ChatModel ) = AllModels (chatModel = chatModel)
136
138
137
139
@JvmStatic
138
- fun ofUnionMember2 (unionMember2 : UnionMember2 ) = AllModels (unionMember2 = unionMember2)
140
+ fun ofResponsesOnlyModel (responsesOnlyModel : ResponsesOnlyModel ) =
141
+ AllModels (responsesOnlyModel = responsesOnlyModel)
139
142
}
140
143
141
144
/* * An interface that defines how to map each variant of [AllModels] to a value of type [T]. */
@@ -145,7 +148,7 @@ private constructor(
145
148
146
149
fun visitChatModel (chatModel : ChatModel ): T
147
150
148
- fun visitUnionMember2 ( unionMember2 : UnionMember2 ): T
151
+ fun visitResponsesOnlyModel ( responsesOnlyModel : ResponsesOnlyModel ): T
149
152
150
153
/* *
151
154
* Maps an unknown variant of [AllModels] to a value of type [T].
@@ -171,8 +174,8 @@ private constructor(
171
174
tryDeserialize(node, jacksonTypeRef<ChatModel >())?.let {
172
175
AllModels (chatModel = it, _json = json)
173
176
},
174
- tryDeserialize(node, jacksonTypeRef<UnionMember2 >())?.let {
175
- AllModels (unionMember2 = it, _json = json)
177
+ tryDeserialize(node, jacksonTypeRef<ResponsesOnlyModel >())?.let {
178
+ AllModels (responsesOnlyModel = it, _json = json)
176
179
},
177
180
tryDeserialize(node, jacksonTypeRef<String >())?.let {
178
181
AllModels (string = it, _json = json)
@@ -203,15 +206,16 @@ private constructor(
203
206
when {
204
207
value.string != null -> generator.writeObject(value.string)
205
208
value.chatModel != null -> generator.writeObject(value.chatModel)
206
- value.unionMember2 != null -> generator.writeObject(value.unionMember2 )
209
+ value.responsesOnlyModel != null -> generator.writeObject(value.responsesOnlyModel )
207
210
value._json != null -> generator.writeObject(value._json )
208
211
else -> throw IllegalStateException (" Invalid AllModels" )
209
212
}
210
213
}
211
214
}
212
215
213
- class UnionMember2 @JsonCreator private constructor(private val value : JsonField <String >) :
214
- Enum {
216
+ class ResponsesOnlyModel
217
+ @JsonCreator
218
+ private constructor (private val value: JsonField <String >) : Enum {
215
219
216
220
/* *
217
221
* Returns this class instance's raw value.
@@ -233,10 +237,10 @@ private constructor(
233
237
234
238
@JvmField val COMPUTER_USE_PREVIEW_2025_03_11 = of(" computer-use-preview-2025-03-11" )
235
239
236
- @JvmStatic fun of (value : String ) = UnionMember2 (JsonField .of(value))
240
+ @JvmStatic fun of (value : String ) = ResponsesOnlyModel (JsonField .of(value))
237
241
}
238
242
239
- /* * An enum containing [UnionMember2 ]'s known values. */
243
+ /* * An enum containing [ResponsesOnlyModel ]'s known values. */
240
244
enum class Known {
241
245
O1_PRO ,
242
246
O1_PRO_2025_03_19 ,
@@ -245,9 +249,9 @@ private constructor(
245
249
}
246
250
247
251
/* *
248
- * An enum containing [UnionMember2 ]'s known values, as well as an [_UNKNOWN] member.
252
+ * An enum containing [ResponsesOnlyModel ]'s known values, as well as an [_UNKNOWN] member.
249
253
*
250
- * An instance of [UnionMember2 ] can contain an unknown value in a couple of cases:
254
+ * An instance of [ResponsesOnlyModel ] can contain an unknown value in a couple of cases:
251
255
* - It was deserialized from data that doesn't match any known member. For example, if the
252
256
* SDK is on an older version than the API, then the API may respond with new members that
253
257
* the SDK is unaware of.
@@ -259,7 +263,8 @@ private constructor(
259
263
COMPUTER_USE_PREVIEW ,
260
264
COMPUTER_USE_PREVIEW_2025_03_11 ,
261
265
/* *
262
- * An enum member indicating that [UnionMember2] was instantiated with an unknown value.
266
+ * An enum member indicating that [ResponsesOnlyModel] was instantiated with an unknown
267
+ * value.
263
268
*/
264
269
_UNKNOWN ,
265
270
}
@@ -295,7 +300,7 @@ private constructor(
295
300
O1_PRO_2025_03_19 -> Known .O1_PRO_2025_03_19
296
301
COMPUTER_USE_PREVIEW -> Known .COMPUTER_USE_PREVIEW
297
302
COMPUTER_USE_PREVIEW_2025_03_11 -> Known .COMPUTER_USE_PREVIEW_2025_03_11
298
- else -> throw OpenAIInvalidDataException (" Unknown UnionMember2 : $value " )
303
+ else -> throw OpenAIInvalidDataException (" Unknown ResponsesOnlyModel : $value " )
299
304
}
300
305
301
306
/* *
@@ -312,7 +317,7 @@ private constructor(
312
317
313
318
private var validated: Boolean = false
314
319
315
- fun validate (): UnionMember2 = apply {
320
+ fun validate (): ResponsesOnlyModel = apply {
316
321
if (validated) {
317
322
return @apply
318
323
}
@@ -342,7 +347,7 @@ private constructor(
342
347
return true
343
348
}
344
349
345
- return /* spotless:off */ other is UnionMember2 && value == other.value /* spotless:on */
350
+ return /* spotless:off */ other is ResponsesOnlyModel && value == other.value /* spotless:on */
346
351
}
347
352
348
353
override fun hashCode () = value.hashCode()
0 commit comments