Skip to content

Commit 1b2efd8

Browse files
feat(api): update via SDK Studio
1 parent 3094578 commit 1b2efd8

6 files changed

Lines changed: 32 additions & 33 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5d4e11bc46eeecee7363d56a9dfe946acee997d5b352c2b0a50c20e742c54d2d.yml
33
openapi_spec_hash: 333e53ad9c706296b9afdb8ff73bec8f
4-
config_hash: df959c379e1145106030a4869b006afe
4+
config_hash: 79af9b3bec53ee798dddcf815befa25d

aliases.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ type paramObj = param.APIObject
1616

1717
type Error = apierror.Error
1818

19-
// This is an alias to an internal type.
20-
type Error = shared.Error
21-
2219
// This is an alias to an internal type.
2320
type ErrorDetail = shared.ErrorDetail
2421

@@ -27,6 +24,9 @@ type ErrorDetail = shared.ErrorDetail
2724
// This is an alias to an internal type.
2825
type ErrorEvent = shared.ErrorEvent
2926

27+
// This is an alias to an internal type.
28+
type ErrorEventError = shared.ErrorEventError
29+
3030
// A log entry from the application.
3131
//
3232
// This is an alias to an internal type.

api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Shared Response Types
22

3-
- <a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared">shared</a>.<a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared#Error">Error</a>
43
- <a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared">shared</a>.<a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared#ErrorDetail">ErrorDetail</a>
54
- <a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared">shared</a>.<a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared#ErrorEvent">ErrorEvent</a>
65
- <a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared">shared</a>.<a href="https://pkg.go.dev/github.com/onkernel/kernel-go-sdk/shared#LogEvent">LogEvent</a>

deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ type DeploymentFollowResponseUnion struct {
279279
// This field is from variant [DeploymentFollowResponseAppVersionSummaryEvent].
280280
EnvVars map[string]string `json:"env_vars"`
281281
// This field is from variant [shared.ErrorEvent].
282-
Error shared.Error `json:"error"`
282+
Error shared.ErrorEventError `json:"error"`
283283
JSON struct {
284284
Event respjson.Field
285285
Message respjson.Field

invocation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ type InvocationFollowResponseUnion struct {
322322
// This field is from variant [InvocationStateEvent].
323323
Invocation InvocationStateEventInvocation `json:"invocation"`
324324
// This field is from variant [shared.ErrorEvent].
325-
Error shared.Error `json:"error"`
325+
Error shared.ErrorEventError `json:"error"`
326326
JSON struct {
327327
Event respjson.Field
328328
Message respjson.Field

shared/shared.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,6 @@ type paramUnion = param.APIUnion
1717
// aliased to make [param.APIObject] private when embedding
1818
type paramObj = param.APIObject
1919

20-
type Error struct {
21-
// Application-specific error code (machine-readable)
22-
Code string `json:"code,required"`
23-
// Human-readable error description for debugging
24-
Message string `json:"message,required"`
25-
// Additional error details (for multiple errors)
26-
Details []ErrorDetail `json:"details"`
27-
InnerError ErrorDetail `json:"inner_error"`
28-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
29-
JSON struct {
30-
Code respjson.Field
31-
Message respjson.Field
32-
Details respjson.Field
33-
InnerError respjson.Field
34-
ExtraFields map[string]respjson.Field
35-
raw string
36-
} `json:"-"`
37-
}
38-
39-
// Returns the unmodified JSON received from the API
40-
func (r Error) RawJSON() string { return r.JSON.raw }
41-
func (r *Error) UnmarshalJSON(data []byte) error {
42-
return apijson.UnmarshalRoot(data, r)
43-
}
44-
4520
type ErrorDetail struct {
4621
// Lower-level error code providing more specific detail
4722
Code string `json:"code"`
@@ -64,7 +39,7 @@ func (r *ErrorDetail) UnmarshalJSON(data []byte) error {
6439

6540
// An error event from the application.
6641
type ErrorEvent struct {
67-
Error Error `json:"error,required"`
42+
Error ErrorEventError `json:"error,required"`
6843
// Event type identifier (always "error").
6944
Event constant.Error `json:"event,required"`
7045
// Time the error occurred.
@@ -87,6 +62,31 @@ func (r *ErrorEvent) UnmarshalJSON(data []byte) error {
8762

8863
func (ErrorEvent) ImplInvocationFollowResponseUnion() {}
8964

65+
type ErrorEventError struct {
66+
// Application-specific error code (machine-readable)
67+
Code string `json:"code,required"`
68+
// Human-readable error description for debugging
69+
Message string `json:"message,required"`
70+
// Additional error details (for multiple errors)
71+
Details []ErrorDetail `json:"details"`
72+
InnerError ErrorDetail `json:"inner_error"`
73+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
74+
JSON struct {
75+
Code respjson.Field
76+
Message respjson.Field
77+
Details respjson.Field
78+
InnerError respjson.Field
79+
ExtraFields map[string]respjson.Field
80+
raw string
81+
} `json:"-"`
82+
}
83+
84+
// Returns the unmodified JSON received from the API
85+
func (r ErrorEventError) RawJSON() string { return r.JSON.raw }
86+
func (r *ErrorEventError) UnmarshalJSON(data []byte) error {
87+
return apijson.UnmarshalRoot(data, r)
88+
}
89+
9090
// A log entry from the application.
9191
type LogEvent struct {
9292
// Event type identifier (always "log").

0 commit comments

Comments
 (0)