Skip to content

Commit

Permalink
fix: fix interface implementation stub names for unions (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jan 28, 2025
1 parent f1e30cc commit 0ac5655
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (r apiErrorObjectJSON) RawJSON() string {
return r.raw
}

func (r APIErrorObject) ImplementsSharedErrorObject() {}
func (r APIErrorObject) ImplementsErrorObject() {}

type APIErrorObjectType string

Expand Down Expand Up @@ -70,7 +70,7 @@ func (r authenticationErrorJSON) RawJSON() string {
return r.raw
}

func (r AuthenticationError) ImplementsSharedErrorObject() {}
func (r AuthenticationError) ImplementsErrorObject() {}

type AuthenticationErrorType string

Expand Down Expand Up @@ -108,7 +108,7 @@ func (r billingErrorJSON) RawJSON() string {
return r.raw
}

func (r BillingError) ImplementsSharedErrorObject() {}
func (r BillingError) ImplementsErrorObject() {}

type BillingErrorType string

Expand Down Expand Up @@ -168,7 +168,7 @@ func (r ErrorObject) AsUnion() ErrorObjectUnion {
// [shared.RateLimitError], [shared.GatewayTimeoutError], [shared.APIErrorObject]
// or [shared.OverloadedError].
type ErrorObjectUnion interface {
ImplementsSharedErrorObject()
ImplementsErrorObject()
}

func init() {
Expand Down Expand Up @@ -304,7 +304,7 @@ func (r gatewayTimeoutErrorJSON) RawJSON() string {
return r.raw
}

func (r GatewayTimeoutError) ImplementsSharedErrorObject() {}
func (r GatewayTimeoutError) ImplementsErrorObject() {}

type GatewayTimeoutErrorType string

Expand Down Expand Up @@ -343,7 +343,7 @@ func (r invalidRequestErrorJSON) RawJSON() string {
return r.raw
}

func (r InvalidRequestError) ImplementsSharedErrorObject() {}
func (r InvalidRequestError) ImplementsErrorObject() {}

type InvalidRequestErrorType string

Expand Down Expand Up @@ -381,7 +381,7 @@ func (r notFoundErrorJSON) RawJSON() string {
return r.raw
}

func (r NotFoundError) ImplementsSharedErrorObject() {}
func (r NotFoundError) ImplementsErrorObject() {}

type NotFoundErrorType string

Expand Down Expand Up @@ -419,7 +419,7 @@ func (r overloadedErrorJSON) RawJSON() string {
return r.raw
}

func (r OverloadedError) ImplementsSharedErrorObject() {}
func (r OverloadedError) ImplementsErrorObject() {}

type OverloadedErrorType string

Expand Down Expand Up @@ -457,7 +457,7 @@ func (r permissionErrorJSON) RawJSON() string {
return r.raw
}

func (r PermissionError) ImplementsSharedErrorObject() {}
func (r PermissionError) ImplementsErrorObject() {}

type PermissionErrorType string

Expand Down Expand Up @@ -495,7 +495,7 @@ func (r rateLimitErrorJSON) RawJSON() string {
return r.raw
}

func (r RateLimitError) ImplementsSharedErrorObject() {}
func (r RateLimitError) ImplementsErrorObject() {}

type RateLimitErrorType string

Expand Down
3 changes: 2 additions & 1 deletion shared/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ package shared

type UnionString string

func (UnionString) ImplementsModelParam() {}
func (UnionString) ImplementsModel() {}
func (UnionString) ImplementsContentBlockSourceContentUnionParam() {}
func (UnionString) ImplementsMessageCountTokensParamsSystemUnion() {}
func (UnionString) ImplementsAnthropicBeta() {}
func (UnionString) ImplementsAnthropicBetaParam() {}
func (UnionString) ImplementsBetaContentBlockSourceContentUnionParam() {}
func (UnionString) ImplementsBetaMessageCountTokensParamsSystemUnion() {}

0 comments on commit 0ac5655

Please # to comment.