Skip to content

Commit a095e93

Browse files
committedJan 30, 2025
fix: fix interface implementation stub names for unions (#3871)
1 parent f55b0b9 commit a095e93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2733
-2884
lines changed
 

‎accounts/member.go

+8-11
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ func (r MemberNewParamsBody) MarshalJSON() (data []byte, err error) {
204204
return apijson.MarshalRoot(r)
205205
}
206206

207-
func (r MemberNewParamsBody) implementsAccountsMemberNewParamsBodyUnion() {}
207+
func (r MemberNewParamsBody) implementsMemberNewParamsBodyUnion() {}
208208

209209
// Satisfied by [accounts.MemberNewParamsBodyIAMCreateMemberWithRoles],
210210
// [accounts.MemberNewParamsBodyIAMCreateMemberWithPolicies],
211211
// [MemberNewParamsBody].
212212
type MemberNewParamsBodyUnion interface {
213-
implementsAccountsMemberNewParamsBodyUnion()
213+
implementsMemberNewParamsBodyUnion()
214214
}
215215

216216
type MemberNewParamsBodyIAMCreateMemberWithRoles struct {
@@ -225,7 +225,7 @@ func (r MemberNewParamsBodyIAMCreateMemberWithRoles) MarshalJSON() (data []byte,
225225
return apijson.MarshalRoot(r)
226226
}
227227

228-
func (r MemberNewParamsBodyIAMCreateMemberWithRoles) implementsAccountsMemberNewParamsBodyUnion() {}
228+
func (r MemberNewParamsBodyIAMCreateMemberWithRoles) implementsMemberNewParamsBodyUnion() {}
229229

230230
type MemberNewParamsBodyIAMCreateMemberWithRolesStatus string
231231

@@ -254,8 +254,7 @@ func (r MemberNewParamsBodyIAMCreateMemberWithPolicies) MarshalJSON() (data []by
254254
return apijson.MarshalRoot(r)
255255
}
256256

257-
func (r MemberNewParamsBodyIAMCreateMemberWithPolicies) implementsAccountsMemberNewParamsBodyUnion() {
258-
}
257+
func (r MemberNewParamsBodyIAMCreateMemberWithPolicies) implementsMemberNewParamsBodyUnion() {}
259258

260259
type MemberNewParamsBodyIAMCreateMemberWithPoliciesPolicy struct {
261260
// Allow or deny operations against the resources.
@@ -399,13 +398,13 @@ func (r MemberUpdateParamsBody) MarshalJSON() (data []byte, err error) {
399398
return apijson.MarshalRoot(r)
400399
}
401400

402-
func (r MemberUpdateParamsBody) implementsAccountsMemberUpdateParamsBodyUnion() {}
401+
func (r MemberUpdateParamsBody) implementsMemberUpdateParamsBodyUnion() {}
403402

404403
// Satisfied by [accounts.MemberUpdateParamsBodyIAMUpdateMemberWithRoles],
405404
// [accounts.MemberUpdateParamsBodyIAMUpdateMemberWithPolicies],
406405
// [MemberUpdateParamsBody].
407406
type MemberUpdateParamsBodyUnion interface {
408-
implementsAccountsMemberUpdateParamsBodyUnion()
407+
implementsMemberUpdateParamsBodyUnion()
409408
}
410409

411410
type MemberUpdateParamsBodyIAMUpdateMemberWithRoles struct {
@@ -417,8 +416,7 @@ func (r MemberUpdateParamsBodyIAMUpdateMemberWithRoles) MarshalJSON() (data []by
417416
return apijson.MarshalRoot(r)
418417
}
419418

420-
func (r MemberUpdateParamsBodyIAMUpdateMemberWithRoles) implementsAccountsMemberUpdateParamsBodyUnion() {
421-
}
419+
func (r MemberUpdateParamsBodyIAMUpdateMemberWithRoles) implementsMemberUpdateParamsBodyUnion() {}
422420

423421
// A member's status in the account.
424422
type MemberUpdateParamsBodyIAMUpdateMemberWithRolesStatus string
@@ -459,8 +457,7 @@ func (r MemberUpdateParamsBodyIAMUpdateMemberWithPolicies) MarshalJSON() (data [
459457
return apijson.MarshalRoot(r)
460458
}
461459

462-
func (r MemberUpdateParamsBodyIAMUpdateMemberWithPolicies) implementsAccountsMemberUpdateParamsBodyUnion() {
463-
}
460+
func (r MemberUpdateParamsBodyIAMUpdateMemberWithPolicies) implementsMemberUpdateParamsBodyUnion() {}
464461

465462
type MemberUpdateParamsBodyIAMUpdateMemberWithPoliciesPolicy struct {
466463
// Allow or deny operations against the resources.

‎ai/ai.go

+30-31
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (r *AIService) Run(ctx context.Context, modelName string, params AIRunParam
8282
// [ai.AIRunResponseObject], [ai.AIRunResponseTranslation],
8383
// [ai.AIRunResponseSummarization] or [ai.AIRunResponseImageToText].
8484
type AIRunResponseUnion interface {
85-
ImplementsAIAIRunResponseUnion()
85+
ImplementsAIRunResponseUnion()
8686
}
8787

8888
func init() {
@@ -138,7 +138,7 @@ func init() {
138138

139139
type AIRunResponseTextClassification []AIRunResponseTextClassificationItem
140140

141-
func (r AIRunResponseTextClassification) ImplementsAIAIRunResponseUnion() {}
141+
func (r AIRunResponseTextClassification) ImplementsAIRunResponseUnion() {}
142142

143143
type AIRunResponseTextClassificationItem struct {
144144
// The classification label assigned to the text (e.g., 'POSITIVE' or 'NEGATIVE')
@@ -188,7 +188,7 @@ func (r aiRunResponseAudioJSON) RawJSON() string {
188188
return r.raw
189189
}
190190

191-
func (r AIRunResponseAudio) ImplementsAIAIRunResponseUnion() {}
191+
func (r AIRunResponseAudio) ImplementsAIRunResponseUnion() {}
192192

193193
type AIRunResponseTextEmbeddings struct {
194194
// Embeddings of the requested text values
@@ -214,7 +214,7 @@ func (r aiRunResponseTextEmbeddingsJSON) RawJSON() string {
214214
return r.raw
215215
}
216216

217-
func (r AIRunResponseTextEmbeddings) ImplementsAIAIRunResponseUnion() {}
217+
func (r AIRunResponseTextEmbeddings) ImplementsAIRunResponseUnion() {}
218218

219219
type AIRunResponseAutomaticSpeechRecognition struct {
220220
// The transcription
@@ -244,7 +244,7 @@ func (r aiRunResponseAutomaticSpeechRecognitionJSON) RawJSON() string {
244244
return r.raw
245245
}
246246

247-
func (r AIRunResponseAutomaticSpeechRecognition) ImplementsAIAIRunResponseUnion() {}
247+
func (r AIRunResponseAutomaticSpeechRecognition) ImplementsAIRunResponseUnion() {}
248248

249249
type AIRunResponseAutomaticSpeechRecognitionWord struct {
250250
// The ending second when the word completes
@@ -275,7 +275,7 @@ func (r aiRunResponseAutomaticSpeechRecognitionWordJSON) RawJSON() string {
275275

276276
type AIRunResponseImageClassification []AIRunResponseImageClassificationItem
277277

278-
func (r AIRunResponseImageClassification) ImplementsAIAIRunResponseUnion() {}
278+
func (r AIRunResponseImageClassification) ImplementsAIRunResponseUnion() {}
279279

280280
type AIRunResponseImageClassificationItem struct {
281281
// The predicted category or class for the input image based on analysis
@@ -305,7 +305,7 @@ func (r aiRunResponseImageClassificationItemJSON) RawJSON() string {
305305

306306
type AIRunResponseObjectDetection []AIRunResponseObjectDetectionItem
307307

308-
func (r AIRunResponseObjectDetection) ImplementsAIAIRunResponseUnion() {}
308+
func (r AIRunResponseObjectDetection) ImplementsAIRunResponseUnion() {}
309309

310310
type AIRunResponseObjectDetectionItem struct {
311311
// Coordinates defining the bounding box around the detected object
@@ -395,7 +395,7 @@ func (r aiRunResponseObjectJSON) RawJSON() string {
395395
return r.raw
396396
}
397397

398-
func (r AIRunResponseObject) ImplementsAIAIRunResponseUnion() {}
398+
func (r AIRunResponseObject) ImplementsAIRunResponseUnion() {}
399399

400400
type AIRunResponseObjectToolCall struct {
401401
// The arguments passed to be passed to the tool call request
@@ -473,7 +473,7 @@ func (r aiRunResponseTranslationJSON) RawJSON() string {
473473
return r.raw
474474
}
475475

476-
func (r AIRunResponseTranslation) ImplementsAIAIRunResponseUnion() {}
476+
func (r AIRunResponseTranslation) ImplementsAIRunResponseUnion() {}
477477

478478
type AIRunResponseSummarization struct {
479479
// The summarized version of the input text
@@ -497,7 +497,7 @@ func (r aiRunResponseSummarizationJSON) RawJSON() string {
497497
return r.raw
498498
}
499499

500-
func (r AIRunResponseSummarization) ImplementsAIAIRunResponseUnion() {}
500+
func (r AIRunResponseSummarization) ImplementsAIRunResponseUnion() {}
501501

502502
type AIRunResponseImageToText struct {
503503
Description string `json:"description"`
@@ -520,7 +520,7 @@ func (r aiRunResponseImageToTextJSON) RawJSON() string {
520520
return r.raw
521521
}
522522

523-
func (r AIRunResponseImageToText) ImplementsAIAIRunResponseUnion() {}
523+
func (r AIRunResponseImageToText) ImplementsAIRunResponseUnion() {}
524524

525525
type AIRunParams struct {
526526
AccountID param.Field[string] `path:"account_id,required"`
@@ -600,7 +600,7 @@ func (r AIRunParamsBody) MarshalJSON() (data []byte, err error) {
600600
return apijson.MarshalRoot(r)
601601
}
602602

603-
func (r AIRunParamsBody) implementsAIAIRunParamsBodyUnion() {}
603+
func (r AIRunParamsBody) implementsAIRunParamsBodyUnion() {}
604604

605605
// Satisfied by [ai.AIRunParamsBodyTextClassification],
606606
// [ai.AIRunParamsBodyTextToImage], [ai.AIRunParamsBodyTextToSpeech],
@@ -611,7 +611,7 @@ func (r AIRunParamsBody) implementsAIAIRunParamsBodyUnion() {}
611611
// [ai.AIRunParamsBodyTranslation], [ai.AIRunParamsBodySummarization],
612612
// [ai.AIRunParamsBodyImageToText], [AIRunParamsBody].
613613
type AIRunParamsBodyUnion interface {
614-
implementsAIAIRunParamsBodyUnion()
614+
implementsAIRunParamsBodyUnion()
615615
}
616616

617617
type AIRunParamsBodyTextClassification struct {
@@ -623,7 +623,7 @@ func (r AIRunParamsBodyTextClassification) MarshalJSON() (data []byte, err error
623623
return apijson.MarshalRoot(r)
624624
}
625625

626-
func (r AIRunParamsBodyTextClassification) implementsAIAIRunParamsBodyUnion() {}
626+
func (r AIRunParamsBodyTextClassification) implementsAIRunParamsBodyUnion() {}
627627

628628
type AIRunParamsBodyTextToImage struct {
629629
// A text description of the image you want to generate
@@ -658,7 +658,7 @@ func (r AIRunParamsBodyTextToImage) MarshalJSON() (data []byte, err error) {
658658
return apijson.MarshalRoot(r)
659659
}
660660

661-
func (r AIRunParamsBodyTextToImage) implementsAIAIRunParamsBodyUnion() {}
661+
func (r AIRunParamsBodyTextToImage) implementsAIRunParamsBodyUnion() {}
662662

663663
type AIRunParamsBodyTextToSpeech struct {
664664
// A text description of the image you want to generate
@@ -672,7 +672,7 @@ func (r AIRunParamsBodyTextToSpeech) MarshalJSON() (data []byte, err error) {
672672
return apijson.MarshalRoot(r)
673673
}
674674

675-
func (r AIRunParamsBodyTextToSpeech) implementsAIAIRunParamsBodyUnion() {}
675+
func (r AIRunParamsBodyTextToSpeech) implementsAIRunParamsBodyUnion() {}
676676

677677
type AIRunParamsBodyTextEmbeddings struct {
678678
// The text to embed
@@ -683,19 +683,18 @@ func (r AIRunParamsBodyTextEmbeddings) MarshalJSON() (data []byte, err error) {
683683
return apijson.MarshalRoot(r)
684684
}
685685

686-
func (r AIRunParamsBodyTextEmbeddings) implementsAIAIRunParamsBodyUnion() {}
686+
func (r AIRunParamsBodyTextEmbeddings) implementsAIRunParamsBodyUnion() {}
687687

688688
// The text to embed
689689
//
690690
// Satisfied by [shared.UnionString], [ai.AIRunParamsBodyTextEmbeddingsTextArray].
691691
type AIRunParamsBodyTextEmbeddingsTextUnion interface {
692-
ImplementsAIAIRunParamsBodyTextEmbeddingsTextUnion()
692+
ImplementsAIRunParamsBodyTextEmbeddingsTextUnion()
693693
}
694694

695695
type AIRunParamsBodyTextEmbeddingsTextArray []string
696696

697-
func (r AIRunParamsBodyTextEmbeddingsTextArray) ImplementsAIAIRunParamsBodyTextEmbeddingsTextUnion() {
698-
}
697+
func (r AIRunParamsBodyTextEmbeddingsTextArray) ImplementsAIRunParamsBodyTextEmbeddingsTextUnion() {}
699698

700699
type AIRunParamsBodyAutomaticSpeechRecognition struct {
701700
// An array of integers that represent the audio data constrained to 8-bit unsigned
@@ -712,7 +711,7 @@ func (r AIRunParamsBodyAutomaticSpeechRecognition) MarshalJSON() (data []byte, e
712711
return apijson.MarshalRoot(r)
713712
}
714713

715-
func (r AIRunParamsBodyAutomaticSpeechRecognition) implementsAIAIRunParamsBodyUnion() {}
714+
func (r AIRunParamsBodyAutomaticSpeechRecognition) implementsAIRunParamsBodyUnion() {}
716715

717716
type AIRunParamsBodyImageClassification struct {
718717
// An array of integers that represent the image data constrained to 8-bit unsigned
@@ -724,7 +723,7 @@ func (r AIRunParamsBodyImageClassification) MarshalJSON() (data []byte, err erro
724723
return apijson.MarshalRoot(r)
725724
}
726725

727-
func (r AIRunParamsBodyImageClassification) implementsAIAIRunParamsBodyUnion() {}
726+
func (r AIRunParamsBodyImageClassification) implementsAIRunParamsBodyUnion() {}
728727

729728
type AIRunParamsBodyObjectDetection struct {
730729
// An array of integers that represent the image data constrained to 8-bit unsigned
@@ -736,7 +735,7 @@ func (r AIRunParamsBodyObjectDetection) MarshalJSON() (data []byte, err error) {
736735
return apijson.MarshalRoot(r)
737736
}
738737

739-
func (r AIRunParamsBodyObjectDetection) implementsAIAIRunParamsBodyUnion() {}
738+
func (r AIRunParamsBodyObjectDetection) implementsAIRunParamsBodyUnion() {}
740739

741740
type AIRunParamsBodyPrompt struct {
742741
// The input text prompt for the model to generate a response.
@@ -776,7 +775,7 @@ func (r AIRunParamsBodyPrompt) MarshalJSON() (data []byte, err error) {
776775
return apijson.MarshalRoot(r)
777776
}
778777

779-
func (r AIRunParamsBodyPrompt) implementsAIAIRunParamsBodyUnion() {}
778+
func (r AIRunParamsBodyPrompt) implementsAIRunParamsBodyUnion() {}
780779

781780
type AIRunParamsBodyMessages struct {
782781
// An array of message objects representing the conversation history.
@@ -813,7 +812,7 @@ func (r AIRunParamsBodyMessages) MarshalJSON() (data []byte, err error) {
813812
return apijson.MarshalRoot(r)
814813
}
815814

816-
func (r AIRunParamsBodyMessages) implementsAIAIRunParamsBodyUnion() {}
815+
func (r AIRunParamsBodyMessages) implementsAIRunParamsBodyUnion() {}
817816

818817
type AIRunParamsBodyMessagesMessage struct {
819818
// The content of the message as a string.
@@ -850,12 +849,12 @@ func (r AIRunParamsBodyMessagesTool) MarshalJSON() (data []byte, err error) {
850849
return apijson.MarshalRoot(r)
851850
}
852851

853-
func (r AIRunParamsBodyMessagesTool) implementsAIAIRunParamsBodyMessagesToolUnion() {}
852+
func (r AIRunParamsBodyMessagesTool) implementsAIRunParamsBodyMessagesToolUnion() {}
854853

855854
// Satisfied by [ai.AIRunParamsBodyMessagesToolsObject],
856855
// [ai.AIRunParamsBodyMessagesToolsObject], [AIRunParamsBodyMessagesTool].
857856
type AIRunParamsBodyMessagesToolUnion interface {
858-
implementsAIAIRunParamsBodyMessagesToolUnion()
857+
implementsAIRunParamsBodyMessagesToolUnion()
859858
}
860859

861860
type AIRunParamsBodyMessagesToolsObject struct {
@@ -871,7 +870,7 @@ func (r AIRunParamsBodyMessagesToolsObject) MarshalJSON() (data []byte, err erro
871870
return apijson.MarshalRoot(r)
872871
}
873872

874-
func (r AIRunParamsBodyMessagesToolsObject) implementsAIAIRunParamsBodyMessagesToolUnion() {}
873+
func (r AIRunParamsBodyMessagesToolsObject) implementsAIRunParamsBodyMessagesToolUnion() {}
875874

876875
// Schema defining the parameters accepted by the tool.
877876
type AIRunParamsBodyMessagesToolsObjectParameters struct {
@@ -912,7 +911,7 @@ func (r AIRunParamsBodyTranslation) MarshalJSON() (data []byte, err error) {
912911
return apijson.MarshalRoot(r)
913912
}
914913

915-
func (r AIRunParamsBodyTranslation) implementsAIAIRunParamsBodyUnion() {}
914+
func (r AIRunParamsBodyTranslation) implementsAIRunParamsBodyUnion() {}
916915

917916
type AIRunParamsBodySummarization struct {
918917
// The text that you want the model to summarize
@@ -925,7 +924,7 @@ func (r AIRunParamsBodySummarization) MarshalJSON() (data []byte, err error) {
925924
return apijson.MarshalRoot(r)
926925
}
927926

928-
func (r AIRunParamsBodySummarization) implementsAIAIRunParamsBodyUnion() {}
927+
func (r AIRunParamsBodySummarization) implementsAIRunParamsBodyUnion() {}
929928

930929
type AIRunParamsBodyImageToText struct {
931930
// An array of integers that represent the image data constrained to 8-bit unsigned
@@ -963,7 +962,7 @@ func (r AIRunParamsBodyImageToText) MarshalJSON() (data []byte, err error) {
963962
return apijson.MarshalRoot(r)
964963
}
965964

966-
func (r AIRunParamsBodyImageToText) implementsAIAIRunParamsBodyUnion() {}
965+
func (r AIRunParamsBodyImageToText) implementsAIRunParamsBodyUnion() {}
967966

968967
type AIRunResponseEnvelope struct {
969968
// An array of classification results for the input text

0 commit comments

Comments
 (0)
Please sign in to comment.