From 6f721ac3da13678eb476f8231617510e8f0b9e34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 04:53:37 +0000 Subject: [PATCH 1/4] fix: fix issue with unmarshaling in some cases --- authconnection.go | 6 +++--- credential.go | 5 ++--- credentialprovider.go | 5 ++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/authconnection.go b/authconnection.go index ed76924..7af27d7 100644 --- a/authconnection.go +++ b/authconnection.go @@ -1079,7 +1079,7 @@ func (r AuthConnectionNewParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.ManagedAuthCreateRequest) } func (r *AuthConnectionNewParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.ManagedAuthCreateRequest) + return apijson.UnmarshalRoot(data, r) } type AuthConnectionUpdateParams struct { @@ -1092,7 +1092,7 @@ func (r AuthConnectionUpdateParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.ManagedAuthUpdateRequest) } func (r *AuthConnectionUpdateParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.ManagedAuthUpdateRequest) + return apijson.UnmarshalRoot(data, r) } type AuthConnectionListParams struct { @@ -1161,5 +1161,5 @@ func (r AuthConnectionSubmitParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.SubmitFieldsRequest) } func (r *AuthConnectionSubmitParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.SubmitFieldsRequest) + return apijson.UnmarshalRoot(data, r) } diff --git a/credential.go b/credential.go index 28b5839..fd8befe 100644 --- a/credential.go +++ b/credential.go @@ -4,7 +4,6 @@ package kernel import ( "context" - "encoding/json" "errors" "fmt" "net/http" @@ -260,7 +259,7 @@ func (r CredentialNewParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.CreateCredentialRequest) } func (r *CredentialNewParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.CreateCredentialRequest) + return apijson.UnmarshalRoot(data, r) } type CredentialUpdateParams struct { @@ -273,7 +272,7 @@ func (r CredentialUpdateParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.UpdateCredentialRequest) } func (r *CredentialUpdateParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.UpdateCredentialRequest) + return apijson.UnmarshalRoot(data, r) } type CredentialListParams struct { diff --git a/credentialprovider.go b/credentialprovider.go index 244dd18..f445e8d 100644 --- a/credentialprovider.go +++ b/credentialprovider.go @@ -4,7 +4,6 @@ package kernel import ( "context" - "encoding/json" "errors" "fmt" "net/http" @@ -323,7 +322,7 @@ func (r CredentialProviderNewParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.CreateCredentialProviderRequest) } func (r *CredentialProviderNewParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.CreateCredentialProviderRequest) + return apijson.UnmarshalRoot(data, r) } type CredentialProviderUpdateParams struct { @@ -336,5 +335,5 @@ func (r CredentialProviderUpdateParams) MarshalJSON() (data []byte, err error) { return shimjson.Marshal(r.UpdateCredentialProviderRequest) } func (r *CredentialProviderUpdateParams) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &r.UpdateCredentialProviderRequest) + return apijson.UnmarshalRoot(data, r) } From f0fe2910eac3224852fad313732f0f353c3b5a0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:17:57 +0000 Subject: [PATCH 2/4] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ed1b33..1bda9d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 104 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-20310988401243aa5c4a2e2ac6cba5dd90873fb7b83497a2d50c691352c0dd7b.yml -openapi_spec_hash: e19e650b4b2c8c8fde1f739c4aab6b33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-403eadeddcd92ecf5c0ada739fb59d73d829a9b463788a81ac3ed97d0cd3a64b.yml +openapi_spec_hash: 8fdd3a5bd5e035f0adeb72329c215ad7 config_hash: 16e4457a0bb26e98a335a1c2a572290a From 084975a54df1144592e3f61655ee423df3d38393 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:48:18 +0000 Subject: [PATCH 3/4] feat: Add optional url parameter to proxy check endpoint --- .stats.yml | 4 ++-- api.md | 2 +- proxy.go | 34 +++++++++++++++++++++++++++++++--- proxy_test.go | 10 ++++++++-- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1bda9d3..4bc313e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 104 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-403eadeddcd92ecf5c0ada739fb59d73d829a9b463788a81ac3ed97d0cd3a64b.yml -openapi_spec_hash: 8fdd3a5bd5e035f0adeb72329c215ad7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-f7024f4171c7c4ec558de1c27f338b1089ffddd0d2dbfdb9bb9f9c2abe8f47bf.yml +openapi_spec_hash: ced43682b49e73a2862f99b49abb4fcd config_hash: 16e4457a0bb26e98a335a1c2a572290a diff --git a/api.md b/api.md index 4271fc8..5959743 100644 --- a/api.md +++ b/api.md @@ -256,7 +256,7 @@ Methods: - client.Proxies.Get(ctx context.Context, id string) (\*kernel.ProxyGetResponse, error) - client.Proxies.List(ctx context.Context) (\*[]kernel.ProxyListResponse, error) - client.Proxies.Delete(ctx context.Context, id string) error -- client.Proxies.Check(ctx context.Context, id string) (\*kernel.ProxyCheckResponse, error) +- client.Proxies.Check(ctx context.Context, id string, body kernel.ProxyCheckParams) (\*kernel.ProxyCheckResponse, error) # Extensions diff --git a/proxy.go b/proxy.go index 12544df..63b60dd 100644 --- a/proxy.go +++ b/proxy.go @@ -80,15 +80,20 @@ func (r *ProxyService) Delete(ctx context.Context, id string, opts ...option.Req return err } -// Run a health check on the proxy to verify it's working. -func (r *ProxyService) Check(ctx context.Context, id string, opts ...option.RequestOption) (res *ProxyCheckResponse, err error) { +// Run a health check on the proxy to verify it's working. Optionally specify a URL +// to test reachability against a specific target. For ISP and datacenter proxies, +// this reliably tests whether the target site is reachable from the proxy's stable +// exit IP. For residential and mobile proxies, the exit node varies between +// requests, so this validates proxy configuration and connectivity rather than +// guaranteeing site-specific reachability. +func (r *ProxyService) Check(ctx context.Context, id string, body ProxyCheckParams, opts ...option.RequestOption) (res *ProxyCheckResponse, err error) { opts = slices.Concat(r.Options, opts) if id == "" { err = errors.New("missing required id parameter") return nil, err } path := fmt.Sprintf("proxies/%s/check", id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...) return res, err } @@ -1584,3 +1589,26 @@ const ( ProxyNewParamsProtocolHTTP ProxyNewParamsProtocol = "http" ProxyNewParamsProtocolHTTPS ProxyNewParamsProtocol = "https" ) + +type ProxyCheckParams struct { + // An optional URL to test reachability against. If provided, the proxy check will + // test connectivity to this URL instead of the default test URLs. Only HTTP and + // HTTPS schemes are allowed, and the URL must resolve to a public IP address. For + // ISP and datacenter proxies, the exit IP is stable, so a successful check + // reliably indicates that subsequent browser sessions will reach the target site + // with the same IP. For residential and mobile proxies, the exit node changes + // between requests, so a successful check validates proxy configuration but does + // not guarantee that a subsequent browser session will use the same exit IP or + // reach the same site — it is useful for verifying credentials and connectivity, + // not for predicting site-specific behavior. + URL param.Opt[string] `json:"url,omitzero"` + paramObj +} + +func (r ProxyCheckParams) MarshalJSON() (data []byte, err error) { + type shadow ProxyCheckParams + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *ProxyCheckParams) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} diff --git a/proxy_test.go b/proxy_test.go index 5624d4d..494d4bb 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -115,7 +115,7 @@ func TestProxyDelete(t *testing.T) { } } -func TestProxyCheck(t *testing.T) { +func TestProxyCheckWithOptionalParams(t *testing.T) { t.Skip("Mock server tests are disabled") baseURL := "http://localhost:4010" if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { @@ -128,7 +128,13 @@ func TestProxyCheck(t *testing.T) { option.WithBaseURL(baseURL), option.WithAPIKey("My API Key"), ) - _, err := client.Proxies.Check(context.TODO(), "id") + _, err := client.Proxies.Check( + context.TODO(), + "id", + kernel.ProxyCheckParams{ + URL: kernel.String("url"), + }, + ) if err != nil { var apierr *kernel.Error if errors.As(err, &apierr) { From e5584c36c66711d0fb7122016f2520fd2c2d8712 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:49:00 +0000 Subject: [PATCH 4/4] release: 0.46.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fc0d7ff..563004f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.45.0" + ".": "0.46.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 36ae3e9..cc126cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.46.0 (2026-04-06) + +Full Changelog: [v0.45.0...v0.46.0](https://github.com/kernel/kernel-go-sdk/compare/v0.45.0...v0.46.0) + +### Features + +* Add optional url parameter to proxy check endpoint ([084975a](https://github.com/kernel/kernel-go-sdk/commit/084975a54df1144592e3f61655ee423df3d38393)) + + +### Bug Fixes + +* fix issue with unmarshaling in some cases ([6f721ac](https://github.com/kernel/kernel-go-sdk/commit/6f721ac3da13678eb476f8231617510e8f0b9e34)) + ## 0.45.0 (2026-03-30) Full Changelog: [v0.44.0...v0.45.0](https://github.com/kernel/kernel-go-sdk/compare/v0.44.0...v0.45.0) diff --git a/README.md b/README.md index c114a13..03f632f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.45.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.46.0' ``` diff --git a/internal/version.go b/internal/version.go index 0f8ee25..75aab7a 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.45.0" // x-release-please-version +const PackageVersion = "0.46.0" // x-release-please-version