Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.12.0"
".": "0.13.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d0090ff3ef876c554e7a1281d5cbe1666cf68aebfc60e05cb7f4302ee377b372.yml
openapi_spec_hash: 33fef541c420a28125f18cd1efc0d585
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-a880f2209deafc4a011da42eb52f1dac0308d18ae1daa1d7253edc3385c9b1c4.yml
openapi_spec_hash: ae5af3810d28e49a68b12f2bb2d2af0e
config_hash: 49c2ff978aaa5ccb4ce324a72f116010
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.13.0 (2025-10-01)

Full Changelog: [v0.12.0...v0.13.0](https://github.com/onkernel/kernel-go-sdk/compare/v0.12.0...v0.13.0)

### Features

* Update oAPI and data model for proxy status ([87b8365](https://github.com/onkernel/kernel-go-sdk/commit/87b8365a941544eaf38b09ca66d6f9a97e3b050b))

## 0.12.0 (2025-09-30)

Full Changelog: [v0.11.5...v0.12.0](https://github.com/onkernel/kernel-go-sdk/compare/v0.11.5...v0.12.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/onkernel/kernel-go-sdk@v0.12.0'
go get -u 'github.com/onkernel/kernel-go-sdk@v0.13.0'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.12.0" // x-release-please-version
const PackageVersion = "0.13.0" // x-release-please-version
49 changes: 49 additions & 0 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"net/http"
"slices"
"time"

"github.com/onkernel/kernel-go-sdk/internal/apijson"
"github.com/onkernel/kernel-go-sdk/internal/requestconfig"
Expand Down Expand Up @@ -87,14 +88,22 @@ type ProxyNewResponse struct {
ID string `json:"id"`
// Configuration specific to the selected proxy `type`.
Config ProxyNewResponseConfigUnion `json:"config"`
// Timestamp of the last health check performed on this proxy.
LastChecked time.Time `json:"last_checked" format:"date-time"`
// Readable name of the proxy.
Name string `json:"name"`
// Current health status of the proxy.
//
// Any of "available", "unavailable".
Status ProxyNewResponseStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Config respjson.Field
LastChecked respjson.Field
Name respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
Expand Down Expand Up @@ -336,6 +345,14 @@ func (r *ProxyNewResponseConfigCustomProxyConfig) UnmarshalJSON(data []byte) err
return apijson.UnmarshalRoot(data, r)
}

// Current health status of the proxy.
type ProxyNewResponseStatus string

const (
ProxyNewResponseStatusAvailable ProxyNewResponseStatus = "available"
ProxyNewResponseStatusUnavailable ProxyNewResponseStatus = "unavailable"
)

// Configuration for routing traffic through a proxy.
type ProxyGetResponse struct {
// Proxy type to use. In terms of quality for avoiding bot-detection, from best to
Expand All @@ -346,14 +363,22 @@ type ProxyGetResponse struct {
ID string `json:"id"`
// Configuration specific to the selected proxy `type`.
Config ProxyGetResponseConfigUnion `json:"config"`
// Timestamp of the last health check performed on this proxy.
LastChecked time.Time `json:"last_checked" format:"date-time"`
// Readable name of the proxy.
Name string `json:"name"`
// Current health status of the proxy.
//
// Any of "available", "unavailable".
Status ProxyGetResponseStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Config respjson.Field
LastChecked respjson.Field
Name respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
Expand Down Expand Up @@ -595,6 +620,14 @@ func (r *ProxyGetResponseConfigCustomProxyConfig) UnmarshalJSON(data []byte) err
return apijson.UnmarshalRoot(data, r)
}

// Current health status of the proxy.
type ProxyGetResponseStatus string

const (
ProxyGetResponseStatusAvailable ProxyGetResponseStatus = "available"
ProxyGetResponseStatusUnavailable ProxyGetResponseStatus = "unavailable"
)

// Configuration for routing traffic through a proxy.
type ProxyListResponse struct {
// Proxy type to use. In terms of quality for avoiding bot-detection, from best to
Expand All @@ -605,14 +638,22 @@ type ProxyListResponse struct {
ID string `json:"id"`
// Configuration specific to the selected proxy `type`.
Config ProxyListResponseConfigUnion `json:"config"`
// Timestamp of the last health check performed on this proxy.
LastChecked time.Time `json:"last_checked" format:"date-time"`
// Readable name of the proxy.
Name string `json:"name"`
// Current health status of the proxy.
//
// Any of "available", "unavailable".
Status ProxyListResponseStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
ID respjson.Field
Config respjson.Field
LastChecked respjson.Field
Name respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
Expand Down Expand Up @@ -854,6 +895,14 @@ func (r *ProxyListResponseConfigCustomProxyConfig) UnmarshalJSON(data []byte) er
return apijson.UnmarshalRoot(data, r)
}

// Current health status of the proxy.
type ProxyListResponseStatus string

const (
ProxyListResponseStatusAvailable ProxyListResponseStatus = "available"
ProxyListResponseStatusUnavailable ProxyListResponseStatus = "unavailable"
)

type ProxyNewParams struct {
// Proxy type to use. In terms of quality for avoiding bot-detection, from best to
// worst: `mobile` > `residential` > `isp` > `datacenter`.
Expand Down