diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a713055..d52d2b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.12.0" + ".": "0.13.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a1c1d77..2223539 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d3708a..1c8f49e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 92bd9a1..3bc4230 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the 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' ``` diff --git a/internal/version.go b/internal/version.go index 71064e9..871f096 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.12.0" // x-release-please-version +const PackageVersion = "0.13.0" // x-release-please-version diff --git a/proxy.go b/proxy.go index 8e21ecb..271bf0e 100644 --- a/proxy.go +++ b/proxy.go @@ -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" @@ -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:"-"` @@ -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 @@ -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:"-"` @@ -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 @@ -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:"-"` @@ -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`.