diff --git a/out/openapi.json b/out/openapi.json index fd8259a654..7622a2a249 100644 --- a/out/openapi.json +++ b/out/openapi.json @@ -587,7 +587,7 @@ "in": "query", "required": false, "schema": { - "$ref": "#/components/schemas/RunnerConfigVariant" + "$ref": "#/components/schemas/NamespacesRunnerConfigVariant" } } ], @@ -1355,6 +1355,12 @@ } ] }, + "NamespacesRunnerConfigVariant": { + "type": "string", + "enum": [ + "serverless" + ] + }, "NamespacesRunnerConfigsDeleteResponse": { "type": "object" }, diff --git a/packages/core/api-public/src/actors/create.rs b/packages/core/api-public/src/actors/create.rs index f661b5b12c..929b5526de 100644 --- a/packages/core/api-public/src/actors/create.rs +++ b/packages/core/api-public/src/actors/create.rs @@ -9,7 +9,7 @@ use rivet_api_client::request_remote_datacenter; use rivet_api_types::actors::create::{CreateRequest, CreateResponse}; use rivet_types::actors::CrashPolicy; use serde::{Deserialize, Serialize}; -use utoipa::{IntoParams, ToSchema}; +use utoipa::IntoParams; #[derive(Debug, Serialize, Deserialize, IntoParams)] #[serde(deny_unknown_fields)] diff --git a/packages/core/api-public/src/router.rs b/packages/core/api-public/src/router.rs index a33b8b3243..d165f55f0f 100644 --- a/packages/core/api-public/src/router.rs +++ b/packages/core/api-public/src/router.rs @@ -29,6 +29,7 @@ use crate::{actors, datacenters, namespaces, runners, ui}; namespaces::runner_configs::delete, datacenters::list, ))] +#[openapi(components(schemas(namespace::keys::RunnerConfigVariant)))] pub struct ApiDoc; pub async fn router( diff --git a/packages/services/namespace/src/keys.rs b/packages/services/namespace/src/keys.rs index caa49d1005..800b943793 100644 --- a/packages/services/namespace/src/keys.rs +++ b/packages/services/namespace/src/keys.rs @@ -194,6 +194,7 @@ impl<'de> TupleUnpack<'de> for ByNameKey { #[derive(Clone, Copy, Debug, Serialize, Deserialize, strum::FromRepr, ToSchema)] #[serde(rename_all = "snake_case")] +#[schema(as = NamespacesRunnerConfigVariant)] pub enum RunnerConfigVariant { Serverless = 0, } diff --git a/sdks/go/api-full/client/client.go b/sdks/go/api-full/client/client.go index cf6bb5840c..79acd8db56 100644 --- a/sdks/go/api-full/client/client.go +++ b/sdks/go/api-full/client/client.go @@ -11,6 +11,7 @@ import ( core "sdk/core" datacenters "sdk/datacenters" namespaces "sdk/namespaces" + namespacesrunnerconfigs "sdk/namespacesrunnerconfigs" runners "sdk/runners" ) @@ -19,9 +20,10 @@ type Client struct { caller *core.Caller header http.Header - Datacenters *datacenters.Client - Namespaces *namespaces.Client - Runners *runners.Client + Datacenters *datacenters.Client + Namespaces *namespaces.Client + NamespacesRunnerConfigs *namespacesrunnerconfigs.Client + Runners *runners.Client } func NewClient(opts ...core.ClientOption) *Client { @@ -30,12 +32,13 @@ func NewClient(opts ...core.ClientOption) *Client { opt(options) } return &Client{ - baseURL: options.BaseURL, - caller: core.NewCaller(options.HTTPClient), - header: options.ToHeader(), - Datacenters: datacenters.NewClient(opts...), - Namespaces: namespaces.NewClient(opts...), - Runners: runners.NewClient(opts...), + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + Datacenters: datacenters.NewClient(opts...), + Namespaces: namespaces.NewClient(opts...), + NamespacesRunnerConfigs: namespacesrunnerconfigs.NewClient(opts...), + Runners: runners.NewClient(opts...), } } diff --git a/sdks/go/api-full/namespaces.go b/sdks/go/api-full/namespaces.go index ae25884661..c9c39b431d 100644 --- a/sdks/go/api-full/namespaces.go +++ b/sdks/go/api-full/namespaces.go @@ -8,7 +8,8 @@ type NamespacesCreateRequest struct { } type NamespacesListRequest struct { - Limit *int `json:"-"` - Cursor *string `json:"-"` - Name *string `json:"-"` + Limit *int `json:"-"` + Cursor *string `json:"-"` + Name *string `json:"-"` + NamespaceId []*RivetId `json:"-"` } diff --git a/sdks/go/api-full/namespaces/client.go b/sdks/go/api-full/namespaces/client.go index 1bc4af7b1f..5edf914d12 100644 --- a/sdks/go/api-full/namespaces/client.go +++ b/sdks/go/api-full/namespaces/client.go @@ -46,6 +46,9 @@ func (c *Client) List(ctx context.Context, request *sdk.NamespacesListRequest) ( if request.Name != nil { queryParams.Add("name", fmt.Sprintf("%v", *request.Name)) } + for _, value := range request.NamespaceId { + queryParams.Add("namespace_id", fmt.Sprintf("%v", *value)) + } if len(queryParams) > 0 { endpointURL += "?" + queryParams.Encode() } diff --git a/sdks/go/api-full/namespaces_runner_configs.go b/sdks/go/api-full/namespaces_runner_configs.go new file mode 100644 index 0000000000..b354881a0b --- /dev/null +++ b/sdks/go/api-full/namespaces_runner_configs.go @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +package api + +type NamespacesRunnerConfigsListRequest struct { + Limit *int `json:"-"` + Cursor *string `json:"-"` + Variant *NamespacesRunnerConfigVariant `json:"-"` +} diff --git a/sdks/go/api-full/namespacesrunnerconfigs/client.go b/sdks/go/api-full/namespacesrunnerconfigs/client.go new file mode 100644 index 0000000000..66a1816e48 --- /dev/null +++ b/sdks/go/api-full/namespacesrunnerconfigs/client.go @@ -0,0 +1,133 @@ +// This file was auto-generated by Fern from our API Definition. + +package namespacesrunnerconfigs + +import ( + context "context" + fmt "fmt" + http "net/http" + url "net/url" + sdk "sdk" + core "sdk/core" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header +} + +func NewClient(opts ...core.ClientOption) *Client { + options := core.NewClientOptions() + for _, opt := range opts { + opt(options) + } + return &Client{ + baseURL: options.BaseURL, + caller: core.NewCaller(options.HTTPClient), + header: options.ToHeader(), + } +} + +func (c *Client) List(ctx context.Context, namespaceId sdk.RivetId, request *sdk.NamespacesRunnerConfigsListRequest) (*sdk.NamespacesRunnerConfigsListResponse, error) { + baseURL := "" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"namespaces/%v/runner-configs", namespaceId) + + queryParams := make(url.Values) + if request.Limit != nil { + queryParams.Add("limit", fmt.Sprintf("%v", *request.Limit)) + } + if request.Cursor != nil { + queryParams.Add("cursor", fmt.Sprintf("%v", *request.Cursor)) + } + if request.Variant != nil { + queryParams.Add("variant", fmt.Sprintf("%v", *request.Variant)) + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + + var response *sdk.NamespacesRunnerConfigsListResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +func (c *Client) Get(ctx context.Context, namespaceId sdk.RivetId, runnerName string) (*sdk.NamespacesRunnerConfigsGetResponse, error) { + baseURL := "" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"namespaces/%v/runner-configs/%v", namespaceId, runnerName) + + var response *sdk.NamespacesRunnerConfigsGetResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +func (c *Client) Upsert(ctx context.Context, namespaceId sdk.RivetId, runnerName string, request sdk.NamespacesRunnerConfigsUpsertRequest) (sdk.NamespacesRunnerConfigsUpsertResponse, error) { + baseURL := "" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"namespaces/%v/runner-configs/%v", namespaceId, runnerName) + + var response sdk.NamespacesRunnerConfigsUpsertResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodPut, + Headers: c.header, + Request: request, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} + +func (c *Client) Delete(ctx context.Context, namespaceId sdk.RivetId, runnerName string) (sdk.NamespacesRunnerConfigsDeleteResponse, error) { + baseURL := "" + if c.baseURL != "" { + baseURL = c.baseURL + } + endpointURL := fmt.Sprintf(baseURL+"/"+"namespaces/%v/runner-configs/%v", namespaceId, runnerName) + + var response sdk.NamespacesRunnerConfigsDeleteResponse + if err := c.caller.Call( + ctx, + &core.CallParams{ + URL: endpointURL, + Method: http.MethodDelete, + Headers: c.header, + Response: &response, + }, + ); err != nil { + return nil, err + } + return response, nil +} diff --git a/sdks/go/api-full/types.go b/sdks/go/api-full/types.go index aa0250f80a..6b9809deef 100644 --- a/sdks/go/api-full/types.go +++ b/sdks/go/api-full/types.go @@ -375,7 +375,6 @@ func (c CrashPolicy) Ptr() *CrashPolicy { type Datacenter struct { DatacenterLabel int `json:"datacenter_label"` Name string `json:"name"` - Url string `json:"url"` _rawJSON json.RawMessage } @@ -553,161 +552,200 @@ func (n *NamespacesListResponse) String() string { return fmt.Sprintf("%#v", n) } -type Pagination struct { - Cursor *string `json:"cursor,omitempty"` +type NamespacesRunnerConfig struct { + Serverless *NamespacesRunnerConfigServerless `json:"serverless,omitempty"` _rawJSON json.RawMessage } -func (p *Pagination) UnmarshalJSON(data []byte) error { - type unmarshaler Pagination +func (n *NamespacesRunnerConfig) UnmarshalJSON(data []byte) error { + type unmarshaler NamespacesRunnerConfig var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *p = Pagination(value) - p._rawJSON = json.RawMessage(data) + *n = NamespacesRunnerConfig(value) + n._rawJSON = json.RawMessage(data) return nil } -func (p *Pagination) String() string { - if len(p._rawJSON) > 0 { - if value, err := core.StringifyJSON(p._rawJSON); err == nil { +func (n *NamespacesRunnerConfig) String() string { + if len(n._rawJSON) > 0 { + if value, err := core.StringifyJSON(n._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(p); err == nil { + if value, err := core.StringifyJSON(n); err == nil { return value } - return fmt.Sprintf("%#v", p) + return fmt.Sprintf("%#v", n) } -type RivetId = string +type NamespacesRunnerConfigServerless struct { + MaxRunners int `json:"max_runners"` + MinRunners int `json:"min_runners"` + // Seconds. + RequestLifespan int `json:"request_lifespan"` + RunnersMargin int `json:"runners_margin"` + SlotsPerRunner int `json:"slots_per_runner"` + Url string `json:"url"` -type Runner struct { - AddressesHttp StringHttpAddressHashableMap `json:"addresses_http,omitempty"` - AddressesTcp StringTcpAddressHashableMap `json:"addresses_tcp,omitempty"` - AddressesUdp StringUdpAddressHashableMap `json:"addresses_udp,omitempty"` - CreateTs int64 `json:"create_ts"` - Datacenter string `json:"datacenter"` - DrainTs *int64 `json:"drain_ts,omitempty"` - Key string `json:"key"` - LastConnectedTs *int64 `json:"last_connected_ts,omitempty"` - LastPingTs int64 `json:"last_ping_ts"` - LastRtt int `json:"last_rtt"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Name string `json:"name"` - NamespaceId RivetId `json:"namespace_id"` - RemainingSlots int `json:"remaining_slots"` - RunnerId RivetId `json:"runner_id"` - StopTs *int64 `json:"stop_ts,omitempty"` - TotalSlots int `json:"total_slots"` - Version int `json:"version"` + _rawJSON json.RawMessage +} + +func (n *NamespacesRunnerConfigServerless) UnmarshalJSON(data []byte) error { + type unmarshaler NamespacesRunnerConfigServerless + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *n = NamespacesRunnerConfigServerless(value) + n._rawJSON = json.RawMessage(data) + return nil +} + +func (n *NamespacesRunnerConfigServerless) String() string { + if len(n._rawJSON) > 0 { + if value, err := core.StringifyJSON(n._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(n); err == nil { + return value + } + return fmt.Sprintf("%#v", n) +} + +type NamespacesRunnerConfigVariant = string + +type NamespacesRunnerConfigsDeleteResponse = map[string]interface{} + +type NamespacesRunnerConfigsGetResponse struct { + RunnerConfig *NamespacesRunnerConfig `json:"runner_config,omitempty"` _rawJSON json.RawMessage } -func (r *Runner) UnmarshalJSON(data []byte) error { - type unmarshaler Runner +func (n *NamespacesRunnerConfigsGetResponse) UnmarshalJSON(data []byte) error { + type unmarshaler NamespacesRunnerConfigsGetResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *r = Runner(value) - r._rawJSON = json.RawMessage(data) + *n = NamespacesRunnerConfigsGetResponse(value) + n._rawJSON = json.RawMessage(data) return nil } -func (r *Runner) String() string { - if len(r._rawJSON) > 0 { - if value, err := core.StringifyJSON(r._rawJSON); err == nil { +func (n *NamespacesRunnerConfigsGetResponse) String() string { + if len(n._rawJSON) > 0 { + if value, err := core.StringifyJSON(n._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(r); err == nil { + if value, err := core.StringifyJSON(n); err == nil { return value } - return fmt.Sprintf("%#v", r) + return fmt.Sprintf("%#v", n) } -type RunnersGetResponse struct { - Runner *Runner `json:"runner,omitempty"` +type NamespacesRunnerConfigsListResponse struct { + Pagination *Pagination `json:"pagination,omitempty"` + RunnerConfigs map[string]*NamespacesRunnerConfig `json:"runner_configs,omitempty"` _rawJSON json.RawMessage } -func (r *RunnersGetResponse) UnmarshalJSON(data []byte) error { - type unmarshaler RunnersGetResponse +func (n *NamespacesRunnerConfigsListResponse) UnmarshalJSON(data []byte) error { + type unmarshaler NamespacesRunnerConfigsListResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *r = RunnersGetResponse(value) - r._rawJSON = json.RawMessage(data) + *n = NamespacesRunnerConfigsListResponse(value) + n._rawJSON = json.RawMessage(data) return nil } -func (r *RunnersGetResponse) String() string { - if len(r._rawJSON) > 0 { - if value, err := core.StringifyJSON(r._rawJSON); err == nil { +func (n *NamespacesRunnerConfigsListResponse) String() string { + if len(n._rawJSON) > 0 { + if value, err := core.StringifyJSON(n._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(r); err == nil { + if value, err := core.StringifyJSON(n); err == nil { return value } - return fmt.Sprintf("%#v", r) + return fmt.Sprintf("%#v", n) } -type RunnersListNamesResponse struct { - Names []string `json:"names,omitempty"` - Pagination *Pagination `json:"pagination,omitempty"` +type NamespacesRunnerConfigsUpsertRequest = *NamespacesRunnerConfig + +type NamespacesRunnerConfigsUpsertResponse = map[string]interface{} + +type Pagination struct { + Cursor *string `json:"cursor,omitempty"` _rawJSON json.RawMessage } -func (r *RunnersListNamesResponse) UnmarshalJSON(data []byte) error { - type unmarshaler RunnersListNamesResponse +func (p *Pagination) UnmarshalJSON(data []byte) error { + type unmarshaler Pagination var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *r = RunnersListNamesResponse(value) - r._rawJSON = json.RawMessage(data) + *p = Pagination(value) + p._rawJSON = json.RawMessage(data) return nil } -func (r *RunnersListNamesResponse) String() string { - if len(r._rawJSON) > 0 { - if value, err := core.StringifyJSON(r._rawJSON); err == nil { +func (p *Pagination) String() string { + if len(p._rawJSON) > 0 { + if value, err := core.StringifyJSON(p._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(r); err == nil { + if value, err := core.StringifyJSON(p); err == nil { return value } - return fmt.Sprintf("%#v", r) + return fmt.Sprintf("%#v", p) } -type RunnersListResponse struct { - Pagination *Pagination `json:"pagination,omitempty"` - Runners []*Runner `json:"runners,omitempty"` +type RivetId = string + +type Runner struct { + CreateTs int64 `json:"create_ts"` + Datacenter string `json:"datacenter"` + DrainTs *int64 `json:"drain_ts,omitempty"` + Key string `json:"key"` + LastConnectedTs *int64 `json:"last_connected_ts,omitempty"` + LastPingTs int64 `json:"last_ping_ts"` + LastRtt int `json:"last_rtt"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Name string `json:"name"` + NamespaceId RivetId `json:"namespace_id"` + RemainingSlots int `json:"remaining_slots"` + RunnerId RivetId `json:"runner_id"` + StopTs *int64 `json:"stop_ts,omitempty"` + TotalSlots int `json:"total_slots"` + Version int `json:"version"` _rawJSON json.RawMessage } -func (r *RunnersListResponse) UnmarshalJSON(data []byte) error { - type unmarshaler RunnersListResponse +func (r *Runner) UnmarshalJSON(data []byte) error { + type unmarshaler Runner var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *r = RunnersListResponse(value) + *r = Runner(value) r._rawJSON = json.RawMessage(data) return nil } -func (r *RunnersListResponse) String() string { +func (r *Runner) String() string { if len(r._rawJSON) > 0 { if value, err := core.StringifyJSON(r._rawJSON); err == nil { return value @@ -719,98 +757,91 @@ func (r *RunnersListResponse) String() string { return fmt.Sprintf("%#v", r) } -type StringHttpAddressHashableMap = map[string]*StringHttpAddressHashableMapValue - -type StringHttpAddressHashableMapValue struct { - Hostname string `json:"hostname"` - Port int `json:"port"` +type RunnersGetResponse struct { + Runner *Runner `json:"runner,omitempty"` _rawJSON json.RawMessage } -func (s *StringHttpAddressHashableMapValue) UnmarshalJSON(data []byte) error { - type unmarshaler StringHttpAddressHashableMapValue +func (r *RunnersGetResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RunnersGetResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = StringHttpAddressHashableMapValue(value) - s._rawJSON = json.RawMessage(data) + *r = RunnersGetResponse(value) + r._rawJSON = json.RawMessage(data) return nil } -func (s *StringHttpAddressHashableMapValue) String() string { - if len(s._rawJSON) > 0 { - if value, err := core.StringifyJSON(s._rawJSON); err == nil { +func (r *RunnersGetResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(s); err == nil { + if value, err := core.StringifyJSON(r); err == nil { return value } - return fmt.Sprintf("%#v", s) + return fmt.Sprintf("%#v", r) } -type StringTcpAddressHashableMap = map[string]*StringTcpAddressHashableMapValue - -type StringTcpAddressHashableMapValue struct { - Hostname string `json:"hostname"` - Port int `json:"port"` +type RunnersListNamesResponse struct { + Names []string `json:"names,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` _rawJSON json.RawMessage } -func (s *StringTcpAddressHashableMapValue) UnmarshalJSON(data []byte) error { - type unmarshaler StringTcpAddressHashableMapValue +func (r *RunnersListNamesResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RunnersListNamesResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = StringTcpAddressHashableMapValue(value) - s._rawJSON = json.RawMessage(data) + *r = RunnersListNamesResponse(value) + r._rawJSON = json.RawMessage(data) return nil } -func (s *StringTcpAddressHashableMapValue) String() string { - if len(s._rawJSON) > 0 { - if value, err := core.StringifyJSON(s._rawJSON); err == nil { +func (r *RunnersListNamesResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(s); err == nil { + if value, err := core.StringifyJSON(r); err == nil { return value } - return fmt.Sprintf("%#v", s) + return fmt.Sprintf("%#v", r) } -type StringUdpAddressHashableMap = map[string]*StringUdpAddressHashableMapValue - -type StringUdpAddressHashableMapValue struct { - Hostname string `json:"hostname"` - Port int `json:"port"` +type RunnersListResponse struct { + Pagination *Pagination `json:"pagination,omitempty"` + Runners []*Runner `json:"runners,omitempty"` _rawJSON json.RawMessage } -func (s *StringUdpAddressHashableMapValue) UnmarshalJSON(data []byte) error { - type unmarshaler StringUdpAddressHashableMapValue +func (r *RunnersListResponse) UnmarshalJSON(data []byte) error { + type unmarshaler RunnersListResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *s = StringUdpAddressHashableMapValue(value) - s._rawJSON = json.RawMessage(data) + *r = RunnersListResponse(value) + r._rawJSON = json.RawMessage(data) return nil } -func (s *StringUdpAddressHashableMapValue) String() string { - if len(s._rawJSON) > 0 { - if value, err := core.StringifyJSON(s._rawJSON); err == nil { +func (r *RunnersListResponse) String() string { + if len(r._rawJSON) > 0 { + if value, err := core.StringifyJSON(r._rawJSON); err == nil { return value } } - if value, err := core.StringifyJSON(s); err == nil { + if value, err := core.StringifyJSON(r); err == nil { return value } - return fmt.Sprintf("%#v", s) + return fmt.Sprintf("%#v", r) } diff --git a/sdks/rust/api-full/rust/.openapi-generator/FILES b/sdks/rust/api-full/rust/.openapi-generator/FILES index 3a261a6063..fa8bc99828 100644 --- a/sdks/rust/api-full/rust/.openapi-generator/FILES +++ b/sdks/rust/api-full/rust/.openapi-generator/FILES @@ -33,13 +33,18 @@ docs/NamespacesCreateRequest.md docs/NamespacesCreateResponse.md docs/NamespacesGetResponse.md docs/NamespacesListResponse.md +docs/NamespacesRunnerConfig.md +docs/NamespacesRunnerConfigServerless.md +docs/NamespacesRunnerConfigVariant.md +docs/NamespacesRunnerConfigsApi.md +docs/NamespacesRunnerConfigsGetResponse.md +docs/NamespacesRunnerConfigsListResponse.md docs/Pagination.md docs/Runner.md docs/RunnersApi.md docs/RunnersGetResponse.md docs/RunnersListNamesResponse.md docs/RunnersListResponse.md -docs/StringHttpAddressHashableMapValue.md git_push.sh src/apis/actors_create_api.rs src/apis/actors_delete_api.rs @@ -53,6 +58,7 @@ src/apis/configuration.rs src/apis/datacenters_api.rs src/apis/mod.rs src/apis/namespaces_api.rs +src/apis/namespaces_runner_configs_api.rs src/apis/runners_api.rs src/lib.rs src/models/actor.rs @@ -76,9 +82,13 @@ src/models/namespaces_create_request.rs src/models/namespaces_create_response.rs src/models/namespaces_get_response.rs src/models/namespaces_list_response.rs +src/models/namespaces_runner_config.rs +src/models/namespaces_runner_config_serverless.rs +src/models/namespaces_runner_config_variant.rs +src/models/namespaces_runner_configs_get_response.rs +src/models/namespaces_runner_configs_list_response.rs src/models/pagination.rs src/models/runner.rs src/models/runners_get_response.rs src/models/runners_list_names_response.rs src/models/runners_list_response.rs -src/models/string_http_address_hashable_map_value.rs diff --git a/sdks/rust/api-full/rust/README.md b/sdks/rust/api-full/rust/README.md index 549a85d057..afb001a3c7 100644 --- a/sdks/rust/api-full/rust/README.md +++ b/sdks/rust/api-full/rust/README.md @@ -38,6 +38,10 @@ Class | Method | HTTP request | Description *NamespacesApi* | [**namespaces_create**](docs/NamespacesApi.md#namespaces_create) | **POST** /namespaces | *NamespacesApi* | [**namespaces_get**](docs/NamespacesApi.md#namespaces_get) | **GET** /namespaces/{namespace_id} | *NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces | +*NamespacesRunnerConfigsApi* | [**namespaces_runner_configs_delete**](docs/NamespacesRunnerConfigsApi.md#namespaces_runner_configs_delete) | **DELETE** /namespaces/{namespace_id}/runner-configs/{runner_name} | +*NamespacesRunnerConfigsApi* | [**namespaces_runner_configs_get**](docs/NamespacesRunnerConfigsApi.md#namespaces_runner_configs_get) | **GET** /namespaces/{namespace_id}/runner-configs/{runner_name} | +*NamespacesRunnerConfigsApi* | [**namespaces_runner_configs_list**](docs/NamespacesRunnerConfigsApi.md#namespaces_runner_configs_list) | **GET** /namespaces/{namespace_id}/runner-configs | +*NamespacesRunnerConfigsApi* | [**namespaces_runner_configs_upsert**](docs/NamespacesRunnerConfigsApi.md#namespaces_runner_configs_upsert) | **PUT** /namespaces/{namespace_id}/runner-configs/{runner_name} | *RunnersApi* | [**runners_get**](docs/RunnersApi.md#runners_get) | **GET** /runners/{runner_id} | *RunnersApi* | [**runners_list**](docs/RunnersApi.md#runners_list) | **GET** /runners | *RunnersApi* | [**runners_list_names**](docs/RunnersApi.md#runners_list_names) | **GET** /runners/names | ## Datacenter Round Trips @@ -65,12 +69,16 @@ Class | Method | HTTP request | Description - [NamespacesCreateResponse](docs/NamespacesCreateResponse.md) - [NamespacesGetResponse](docs/NamespacesGetResponse.md) - [NamespacesListResponse](docs/NamespacesListResponse.md) + - [NamespacesRunnerConfig](docs/NamespacesRunnerConfig.md) + - [NamespacesRunnerConfigServerless](docs/NamespacesRunnerConfigServerless.md) + - [NamespacesRunnerConfigVariant](docs/NamespacesRunnerConfigVariant.md) + - [NamespacesRunnerConfigsGetResponse](docs/NamespacesRunnerConfigsGetResponse.md) + - [NamespacesRunnerConfigsListResponse](docs/NamespacesRunnerConfigsListResponse.md) - [Pagination](docs/Pagination.md) - [Runner](docs/Runner.md) - [RunnersGetResponse](docs/RunnersGetResponse.md) - [RunnersListNamesResponse](docs/RunnersListNamesResponse.md) - [RunnersListResponse](docs/RunnersListResponse.md) - - [StringHttpAddressHashableMapValue](docs/StringHttpAddressHashableMapValue.md) To get access to the crate's generated documentation, use: diff --git a/sdks/rust/api-full/rust/docs/Datacenter.md b/sdks/rust/api-full/rust/docs/Datacenter.md index a143c1275d..fd9f600f98 100644 --- a/sdks/rust/api-full/rust/docs/Datacenter.md +++ b/sdks/rust/api-full/rust/docs/Datacenter.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **datacenter_label** | **i32** | | **name** | **String** | | -**url** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/rust/api-full/rust/docs/NamespacesApi.md b/sdks/rust/api-full/rust/docs/NamespacesApi.md index 1a3e23e4c5..55bc5f804e 100644 --- a/sdks/rust/api-full/rust/docs/NamespacesApi.md +++ b/sdks/rust/api-full/rust/docs/NamespacesApi.md @@ -68,7 +68,7 @@ No authorization required ## namespaces_list -> models::NamespacesListResponse namespaces_list(limit, cursor, name) +> models::NamespacesListResponse namespaces_list(limit, cursor, name, namespace_id) ### Parameters @@ -79,6 +79,7 @@ Name | Type | Description | Required | Notes **limit** | Option<**i32**> | | | **cursor** | Option<**String**> | | | **name** | Option<**String**> | | | +**namespace_id** | Option<[**Vec**](String.md)> | | | ### Return type diff --git a/sdks/rust/api-full/rust/docs/NamespacesRunnerConfig.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfig.md new file mode 100644 index 0000000000..7db4ba904c --- /dev/null +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfig.md @@ -0,0 +1,11 @@ +# NamespacesRunnerConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**serverless** | [**models::NamespacesRunnerConfigServerless**](NamespacesRunnerConfig_serverless.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigServerless.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigServerless.md new file mode 100644 index 0000000000..57268226cb --- /dev/null +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigServerless.md @@ -0,0 +1,16 @@ +# NamespacesRunnerConfigServerless + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max_runners** | **i32** | | +**min_runners** | **i32** | | +**request_lifespan** | **i32** | Seconds. | +**runners_margin** | **i32** | | +**slots_per_runner** | **i32** | | +**url** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigVariant.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigVariant.md new file mode 100644 index 0000000000..f88e77ae77 --- /dev/null +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigVariant.md @@ -0,0 +1,12 @@ +# NamespacesRunnerConfigVariant + +## Enum Variants + +| Name | Value | +|---- | -----| +| Serverless | serverless | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsApi.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsApi.md new file mode 100644 index 0000000000..51593e3784 --- /dev/null +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsApi.md @@ -0,0 +1,131 @@ +# \NamespacesRunnerConfigsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**namespaces_runner_configs_delete**](NamespacesRunnerConfigsApi.md#namespaces_runner_configs_delete) | **DELETE** /namespaces/{namespace_id}/runner-configs/{runner_name} | +[**namespaces_runner_configs_get**](NamespacesRunnerConfigsApi.md#namespaces_runner_configs_get) | **GET** /namespaces/{namespace_id}/runner-configs/{runner_name} | +[**namespaces_runner_configs_list**](NamespacesRunnerConfigsApi.md#namespaces_runner_configs_list) | **GET** /namespaces/{namespace_id}/runner-configs | +[**namespaces_runner_configs_upsert**](NamespacesRunnerConfigsApi.md#namespaces_runner_configs_upsert) | **PUT** /namespaces/{namespace_id}/runner-configs/{runner_name} | + + + +## namespaces_runner_configs_delete + +> serde_json::Value namespaces_runner_configs_delete(namespace_id, runner_name) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**namespace_id** | **String** | | [required] | +**runner_name** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## namespaces_runner_configs_get + +> models::NamespacesRunnerConfigsGetResponse namespaces_runner_configs_get(namespace_id, runner_name) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**namespace_id** | **String** | | [required] | +**runner_name** | **String** | | [required] | + +### Return type + +[**models::NamespacesRunnerConfigsGetResponse**](NamespacesRunnerConfigsGetResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## namespaces_runner_configs_list + +> models::NamespacesRunnerConfigsListResponse namespaces_runner_configs_list(namespace_id, limit, cursor, variant) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**namespace_id** | **String** | | [required] | +**limit** | Option<**i32**> | | | +**cursor** | Option<**String**> | | | +**variant** | Option<[**NamespacesRunnerConfigVariant**](.md)> | | | + +### Return type + +[**models::NamespacesRunnerConfigsListResponse**](NamespacesRunnerConfigsListResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## namespaces_runner_configs_upsert + +> serde_json::Value namespaces_runner_configs_upsert(namespace_id, runner_name, body) + + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**namespace_id** | **String** | | [required] | +**runner_name** | **String** | | [required] | +**body** | **models::NamespacesRunnerConfig** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/sdks/rust/api-full/rust/docs/StringHttpAddressHashableMapValue.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsGetResponse.md similarity index 68% rename from sdks/rust/api-full/rust/docs/StringHttpAddressHashableMapValue.md rename to sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsGetResponse.md index 42f319c384..61a94ca2e5 100644 --- a/sdks/rust/api-full/rust/docs/StringHttpAddressHashableMapValue.md +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsGetResponse.md @@ -1,11 +1,10 @@ -# StringHttpAddressHashableMapValue +# NamespacesRunnerConfigsGetResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**hostname** | **String** | | -**port** | **i32** | | +**runner_config** | [**models::NamespacesRunnerConfig**](NamespacesRunnerConfig.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsListResponse.md b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsListResponse.md new file mode 100644 index 0000000000..75b755aa83 --- /dev/null +++ b/sdks/rust/api-full/rust/docs/NamespacesRunnerConfigsListResponse.md @@ -0,0 +1,12 @@ +# NamespacesRunnerConfigsListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**models::Pagination**](Pagination.md) | | +**runner_configs** | [**std::collections::HashMap**](NamespacesRunnerConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdks/rust/api-full/rust/docs/Runner.md b/sdks/rust/api-full/rust/docs/Runner.md index c5725e6f23..f8a55e9674 100644 --- a/sdks/rust/api-full/rust/docs/Runner.md +++ b/sdks/rust/api-full/rust/docs/Runner.md @@ -4,9 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**addresses_http** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | -**addresses_tcp** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | -**addresses_udp** | [**std::collections::HashMap**](StringHttpAddressHashableMap_value.md) | | **create_ts** | **i64** | | **datacenter** | **String** | | **drain_ts** | Option<**i64**> | | [optional] diff --git a/sdks/rust/api-full/rust/src/apis/mod.rs b/sdks/rust/api-full/rust/src/apis/mod.rs index 467e8078bc..cbd3ab7407 100644 --- a/sdks/rust/api-full/rust/src/apis/mod.rs +++ b/sdks/rust/api-full/rust/src/apis/mod.rs @@ -121,6 +121,7 @@ pub mod actors_list_api; pub mod actors_list_names_api; pub mod datacenters_api; pub mod namespaces_api; +pub mod namespaces_runner_configs_api; pub mod runners_api; pub mod configuration; diff --git a/sdks/rust/api-full/rust/src/apis/namespaces_api.rs b/sdks/rust/api-full/rust/src/apis/namespaces_api.rs index 0376c7f735..114f0147bd 100644 --- a/sdks/rust/api-full/rust/src/apis/namespaces_api.rs +++ b/sdks/rust/api-full/rust/src/apis/namespaces_api.rs @@ -110,11 +110,12 @@ pub async fn namespaces_get(configuration: &configuration::Configuration, namesp } } -pub async fn namespaces_list(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>, name: Option<&str>) -> Result> { +pub async fn namespaces_list(configuration: &configuration::Configuration, limit: Option, cursor: Option<&str>, name: Option<&str>, namespace_id: Option>) -> Result> { // add a prefix to parameters to efficiently prevent name collisions let p_limit = limit; let p_cursor = cursor; let p_name = name; + let p_namespace_id = namespace_id; let uri_str = format!("{}/namespaces", configuration.base_path); let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); @@ -128,6 +129,12 @@ pub async fn namespaces_list(configuration: &configuration::Configuration, limit if let Some(ref param_value) = p_name { req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_namespace_id { + req_builder = match "multi" { + "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("namespace_id".to_owned(), p.to_string())).collect::>()), + _ => req_builder.query(&[("namespace_id", ¶m_value.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/sdks/rust/api-full/rust/src/apis/namespaces_runner_configs_api.rs b/sdks/rust/api-full/rust/src/apis/namespaces_runner_configs_api.rs new file mode 100644 index 0000000000..76862b3008 --- /dev/null +++ b/sdks/rust/api-full/rust/src/apis/namespaces_runner_configs_api.rs @@ -0,0 +1,207 @@ +/* + * rivet-api-public + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Contact: developer@rivet.gg + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`namespaces_runner_configs_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NamespacesRunnerConfigsDeleteError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`namespaces_runner_configs_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NamespacesRunnerConfigsGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`namespaces_runner_configs_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NamespacesRunnerConfigsListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`namespaces_runner_configs_upsert`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NamespacesRunnerConfigsUpsertError { + UnknownValue(serde_json::Value), +} + + +pub async fn namespaces_runner_configs_delete(configuration: &configuration::Configuration, namespace_id: &str, runner_name: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_namespace_id = namespace_id; + let p_runner_name = runner_name; + + let uri_str = format!("{}/namespaces/{namespace_id}/runner-configs/{runner_name}", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id), runner_name=crate::apis::urlencode(p_runner_name)); + let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn namespaces_runner_configs_get(configuration: &configuration::Configuration, namespace_id: &str, runner_name: &str) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_namespace_id = namespace_id; + let p_runner_name = runner_name; + + let uri_str = format!("{}/namespaces/{namespace_id}/runner-configs/{runner_name}", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id), runner_name=crate::apis::urlencode(p_runner_name)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesRunnerConfigsGetResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesRunnerConfigsGetResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn namespaces_runner_configs_list(configuration: &configuration::Configuration, namespace_id: &str, limit: Option, cursor: Option<&str>, variant: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_namespace_id = namespace_id; + let p_limit = limit; + let p_cursor = cursor; + let p_variant = variant; + + let uri_str = format!("{}/namespaces/{namespace_id}/runner-configs", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_limit { + req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_cursor { + req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_variant { + req_builder = req_builder.query(&[("variant", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NamespacesRunnerConfigsListResponse`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NamespacesRunnerConfigsListResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +pub async fn namespaces_runner_configs_upsert(configuration: &configuration::Configuration, namespace_id: &str, runner_name: &str, body: models::NamespacesRunnerConfig) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_namespace_id = namespace_id; + let p_runner_name = runner_name; + let p_body = body; + + let uri_str = format!("{}/namespaces/{namespace_id}/runner-configs/{runner_name}", configuration.base_path, namespace_id=crate::apis::urlencode(p_namespace_id), runner_name=crate::apis::urlencode(p_runner_name)); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/sdks/rust/api-full/rust/src/models/datacenter.rs b/sdks/rust/api-full/rust/src/models/datacenter.rs index db3deafc15..844fc962d4 100644 --- a/sdks/rust/api-full/rust/src/models/datacenter.rs +++ b/sdks/rust/api-full/rust/src/models/datacenter.rs @@ -17,16 +17,13 @@ pub struct Datacenter { pub datacenter_label: i32, #[serde(rename = "name")] pub name: String, - #[serde(rename = "url")] - pub url: String, } impl Datacenter { - pub fn new(datacenter_label: i32, name: String, url: String) -> Datacenter { + pub fn new(datacenter_label: i32, name: String) -> Datacenter { Datacenter { datacenter_label, name, - url, } } } diff --git a/sdks/rust/api-full/rust/src/models/mod.rs b/sdks/rust/api-full/rust/src/models/mod.rs index fdf4c7a831..047d21e036 100644 --- a/sdks/rust/api-full/rust/src/models/mod.rs +++ b/sdks/rust/api-full/rust/src/models/mod.rs @@ -38,6 +38,16 @@ pub mod namespaces_get_response; pub use self::namespaces_get_response::NamespacesGetResponse; pub mod namespaces_list_response; pub use self::namespaces_list_response::NamespacesListResponse; +pub mod namespaces_runner_config; +pub use self::namespaces_runner_config::NamespacesRunnerConfig; +pub mod namespaces_runner_config_serverless; +pub use self::namespaces_runner_config_serverless::NamespacesRunnerConfigServerless; +pub mod namespaces_runner_config_variant; +pub use self::namespaces_runner_config_variant::NamespacesRunnerConfigVariant; +pub mod namespaces_runner_configs_get_response; +pub use self::namespaces_runner_configs_get_response::NamespacesRunnerConfigsGetResponse; +pub mod namespaces_runner_configs_list_response; +pub use self::namespaces_runner_configs_list_response::NamespacesRunnerConfigsListResponse; pub mod pagination; pub use self::pagination::Pagination; pub mod runner; @@ -48,5 +58,3 @@ pub mod runners_list_names_response; pub use self::runners_list_names_response::RunnersListNamesResponse; pub mod runners_list_response; pub use self::runners_list_response::RunnersListResponse; -pub mod string_http_address_hashable_map_value; -pub use self::string_http_address_hashable_map_value::StringHttpAddressHashableMapValue; diff --git a/sdks/rust/api-full/rust/src/models/string_http_address_hashable_map_value.rs b/sdks/rust/api-full/rust/src/models/namespaces_runner_config.rs similarity index 53% rename from sdks/rust/api-full/rust/src/models/string_http_address_hashable_map_value.rs rename to sdks/rust/api-full/rust/src/models/namespaces_runner_config.rs index 79458c2b02..34d56cbdd0 100644 --- a/sdks/rust/api-full/rust/src/models/string_http_address_hashable_map_value.rs +++ b/sdks/rust/api-full/rust/src/models/namespaces_runner_config.rs @@ -12,18 +12,15 @@ use crate::models; use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct StringHttpAddressHashableMapValue { - #[serde(rename = "hostname")] - pub hostname: String, - #[serde(rename = "port")] - pub port: i32, +pub struct NamespacesRunnerConfig { + #[serde(rename = "serverless")] + pub serverless: Box, } -impl StringHttpAddressHashableMapValue { - pub fn new(hostname: String, port: i32) -> StringHttpAddressHashableMapValue { - StringHttpAddressHashableMapValue { - hostname, - port, +impl NamespacesRunnerConfig { + pub fn new(serverless: models::NamespacesRunnerConfigServerless) -> NamespacesRunnerConfig { + NamespacesRunnerConfig { + serverless: Box::new(serverless), } } } diff --git a/sdks/rust/api-full/rust/src/models/namespaces_runner_config_serverless.rs b/sdks/rust/api-full/rust/src/models/namespaces_runner_config_serverless.rs new file mode 100644 index 0000000000..56ff2c27d9 --- /dev/null +++ b/sdks/rust/api-full/rust/src/models/namespaces_runner_config_serverless.rs @@ -0,0 +1,43 @@ +/* + * rivet-api-public + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Contact: developer@rivet.gg + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NamespacesRunnerConfigServerless { + #[serde(rename = "max_runners")] + pub max_runners: i32, + #[serde(rename = "min_runners")] + pub min_runners: i32, + /// Seconds. + #[serde(rename = "request_lifespan")] + pub request_lifespan: i32, + #[serde(rename = "runners_margin")] + pub runners_margin: i32, + #[serde(rename = "slots_per_runner")] + pub slots_per_runner: i32, + #[serde(rename = "url")] + pub url: String, +} + +impl NamespacesRunnerConfigServerless { + pub fn new(max_runners: i32, min_runners: i32, request_lifespan: i32, runners_margin: i32, slots_per_runner: i32, url: String) -> NamespacesRunnerConfigServerless { + NamespacesRunnerConfigServerless { + max_runners, + min_runners, + request_lifespan, + runners_margin, + slots_per_runner, + url, + } + } +} + diff --git a/sdks/rust/api-full/rust/src/models/namespaces_runner_config_variant.rs b/sdks/rust/api-full/rust/src/models/namespaces_runner_config_variant.rs new file mode 100644 index 0000000000..3901f36640 --- /dev/null +++ b/sdks/rust/api-full/rust/src/models/namespaces_runner_config_variant.rs @@ -0,0 +1,35 @@ +/* + * rivet-api-public + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Contact: developer@rivet.gg + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum NamespacesRunnerConfigVariant { + #[serde(rename = "serverless")] + Serverless, + +} + +impl std::fmt::Display for NamespacesRunnerConfigVariant { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Serverless => write!(f, "serverless"), + } + } +} + +impl Default for NamespacesRunnerConfigVariant { + fn default() -> NamespacesRunnerConfigVariant { + Self::Serverless + } +} + diff --git a/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_get_response.rs b/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_get_response.rs new file mode 100644 index 0000000000..04e5e3e1b0 --- /dev/null +++ b/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_get_response.rs @@ -0,0 +1,27 @@ +/* + * rivet-api-public + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Contact: developer@rivet.gg + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NamespacesRunnerConfigsGetResponse { + #[serde(rename = "runner_config")] + pub runner_config: Box, +} + +impl NamespacesRunnerConfigsGetResponse { + pub fn new(runner_config: models::NamespacesRunnerConfig) -> NamespacesRunnerConfigsGetResponse { + NamespacesRunnerConfigsGetResponse { + runner_config: Box::new(runner_config), + } + } +} + diff --git a/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_list_response.rs b/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_list_response.rs new file mode 100644 index 0000000000..b438cbf5fc --- /dev/null +++ b/sdks/rust/api-full/rust/src/models/namespaces_runner_configs_list_response.rs @@ -0,0 +1,30 @@ +/* + * rivet-api-public + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.0.1 + * Contact: developer@rivet.gg + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NamespacesRunnerConfigsListResponse { + #[serde(rename = "pagination")] + pub pagination: Box, + #[serde(rename = "runner_configs")] + pub runner_configs: std::collections::HashMap, +} + +impl NamespacesRunnerConfigsListResponse { + pub fn new(pagination: models::Pagination, runner_configs: std::collections::HashMap) -> NamespacesRunnerConfigsListResponse { + NamespacesRunnerConfigsListResponse { + pagination: Box::new(pagination), + runner_configs, + } + } +} + diff --git a/sdks/rust/api-full/rust/src/models/runner.rs b/sdks/rust/api-full/rust/src/models/runner.rs index 1912363420..af39c1570a 100644 --- a/sdks/rust/api-full/rust/src/models/runner.rs +++ b/sdks/rust/api-full/rust/src/models/runner.rs @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Runner { - #[serde(rename = "addresses_http")] - pub addresses_http: std::collections::HashMap, - #[serde(rename = "addresses_tcp")] - pub addresses_tcp: std::collections::HashMap, - #[serde(rename = "addresses_udp")] - pub addresses_udp: std::collections::HashMap, #[serde(rename = "create_ts")] pub create_ts: i64, #[serde(rename = "datacenter")] @@ -52,11 +46,8 @@ pub struct Runner { } impl Runner { - pub fn new(addresses_http: std::collections::HashMap, addresses_tcp: std::collections::HashMap, addresses_udp: std::collections::HashMap, create_ts: i64, datacenter: String, key: String, last_ping_ts: i64, last_rtt: i32, name: String, namespace_id: String, remaining_slots: i32, runner_id: String, total_slots: i32, version: i32) -> Runner { + pub fn new(create_ts: i64, datacenter: String, key: String, last_ping_ts: i64, last_rtt: i32, name: String, namespace_id: String, remaining_slots: i32, runner_id: String, total_slots: i32, version: i32) -> Runner { Runner { - addresses_http, - addresses_tcp, - addresses_udp, create_ts, datacenter, drain_ts: None, diff --git a/sdks/typescript/api-full/src/Client.ts b/sdks/typescript/api-full/src/Client.ts index ff8ff1eb1a..616809c65b 100644 --- a/sdks/typescript/api-full/src/Client.ts +++ b/sdks/typescript/api-full/src/Client.ts @@ -9,6 +9,7 @@ import * as serializers from "./serialization/index"; import * as errors from "./errors/index"; import { Datacenters } from "./api/resources/datacenters/client/Client"; import { Namespaces } from "./api/resources/namespaces/client/Client"; +import { NamespacesRunnerConfigs } from "./api/resources/namespacesRunnerConfigs/client/Client"; import { Runners } from "./api/resources/runners/client/Client"; export declare namespace RivetClient { @@ -34,6 +35,7 @@ export declare namespace RivetClient { export class RivetClient { protected _datacenters: Datacenters | undefined; protected _namespaces: Namespaces | undefined; + protected _namespacesRunnerConfigs: NamespacesRunnerConfigs | undefined; protected _runners: Runners | undefined; constructor(protected readonly _options: RivetClient.Options) {} @@ -46,6 +48,10 @@ export class RivetClient { return (this._namespaces ??= new Namespaces(this._options)); } + public get namespacesRunnerConfigs(): NamespacesRunnerConfigs { + return (this._namespacesRunnerConfigs ??= new NamespacesRunnerConfigs(this._options)); + } + public get runners(): Runners { return (this._runners ??= new Runners(this._options)); } diff --git a/sdks/typescript/api-full/src/api/resources/index.ts b/sdks/typescript/api-full/src/api/resources/index.ts index 532591af5a..3ffc95a6ee 100644 --- a/sdks/typescript/api-full/src/api/resources/index.ts +++ b/sdks/typescript/api-full/src/api/resources/index.ts @@ -1,5 +1,7 @@ export * as datacenters from "./datacenters"; export * as namespaces from "./namespaces"; +export * as namespacesRunnerConfigs from "./namespacesRunnerConfigs"; export * as runners from "./runners"; export * from "./namespaces/client/requests"; +export * from "./namespacesRunnerConfigs/client/requests"; export * from "./runners/client/requests"; diff --git a/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts b/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts index db2581790e..3a34d0314e 100644 --- a/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts +++ b/sdks/typescript/api-full/src/api/resources/namespaces/client/Client.ts @@ -4,8 +4,8 @@ import * as core from "../../../../core"; import * as Rivet from "../../../index"; -import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; import * as errors from "../../../../errors/index"; export declare namespace Namespaces { @@ -42,7 +42,7 @@ export class Namespaces { request: Rivet.NamespacesListRequest = {}, requestOptions?: Namespaces.RequestOptions, ): Promise { - const { limit, cursor, name } = request; + const { limit, cursor, name, namespaceId } = request; const _queryParams: Record = {}; if (limit != null) { _queryParams["limit"] = limit.toString(); @@ -56,6 +56,16 @@ export class Namespaces { _queryParams["name"] = name; } + if (namespaceId != null) { + if (Array.isArray(namespaceId)) { + _queryParams["namespace_id"] = namespaceId.map((item) => + serializers.RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ); + } else { + _queryParams["namespace_id"] = namespaceId; + } + } + const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? diff --git a/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts b/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts index 1ecd20862f..6f6cc6e9d9 100644 --- a/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts +++ b/sdks/typescript/api-full/src/api/resources/namespaces/client/requests/NamespacesListRequest.ts @@ -2,6 +2,8 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Rivet from "../../../../index"; + /** * @example * {} @@ -10,4 +12,5 @@ export interface NamespacesListRequest { limit?: number; cursor?: string; name?: string; + namespaceId?: Rivet.RivetId | Rivet.RivetId[]; } diff --git a/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/Client.ts b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/Client.ts new file mode 100644 index 0000000000..8bbb7cc27d --- /dev/null +++ b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/Client.ts @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as core from "../../../../core"; +import * as Rivet from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; + +export declare namespace NamespacesRunnerConfigs { + export interface Options { + environment: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record; + } +} + +export class NamespacesRunnerConfigs { + constructor(protected readonly _options: NamespacesRunnerConfigs.Options) {} + + /** + * @param {Rivet.RivetId} namespaceId + * @param {Rivet.NamespacesRunnerConfigsListRequest} request + * @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.namespacesRunnerConfigs.list("namespace_id") + */ + public async list( + namespaceId: Rivet.RivetId, + request: Rivet.NamespacesRunnerConfigsListRequest = {}, + requestOptions?: NamespacesRunnerConfigs.RequestOptions, + ): Promise { + const { limit, cursor, variant } = request; + const _queryParams: Record = {}; + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + + if (variant != null) { + _queryParams["variant"] = serializers.NamespacesRunnerConfigVariant.jsonOrThrow(variant, { + unrecognizedObjectKeys: "strip", + }); + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `namespaces/${encodeURIComponent(serializers.RivetId.jsonOrThrow(namespaceId))}/runner-configs`, + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.NamespacesRunnerConfigsListResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RivetTimeoutError( + "Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs.", + ); + case "unknown": + throw new errors.RivetError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Rivet.RivetId} namespaceId + * @param {string} runnerName + * @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.namespacesRunnerConfigs.get("namespace_id", "runner_name") + */ + public async get( + namespaceId: Rivet.RivetId, + runnerName: string, + requestOptions?: NamespacesRunnerConfigs.RequestOptions, + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `namespaces/${encodeURIComponent(serializers.RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`, + ), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.NamespacesRunnerConfigsGetResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RivetTimeoutError( + "Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs/{runner_name}.", + ); + case "unknown": + throw new errors.RivetError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Rivet.RivetId} namespaceId + * @param {string} runnerName + * @param {Rivet.NamespacesRunnerConfigsUpsertRequest} request + * @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.namespacesRunnerConfigs.upsert("namespace_id", "runner_name", { + * serverless: { + * maxRunners: 1, + * minRunners: 1, + * requestLifespan: 1, + * runnersMargin: 1, + * slotsPerRunner: 1, + * url: "url" + * } + * }) + */ + public async upsert( + namespaceId: Rivet.RivetId, + runnerName: string, + request: Rivet.NamespacesRunnerConfigsUpsertRequest, + requestOptions?: NamespacesRunnerConfigs.RequestOptions, + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `namespaces/${encodeURIComponent(serializers.RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`, + ), + method: "PUT", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.NamespacesRunnerConfigsUpsertRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.NamespacesRunnerConfigsUpsertResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RivetTimeoutError( + "Timeout exceeded when calling PUT /namespaces/{namespace_id}/runner-configs/{runner_name}.", + ); + case "unknown": + throw new errors.RivetError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * @param {Rivet.RivetId} namespaceId + * @param {string} runnerName + * @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.namespacesRunnerConfigs.delete("namespace_id", "runner_name") + */ + public async delete( + namespaceId: Rivet.RivetId, + runnerName: string, + requestOptions?: NamespacesRunnerConfigs.RequestOptions, + ): Promise { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: urlJoin( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `namespaces/${encodeURIComponent(serializers.RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`, + ), + method: "DELETE", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.NamespacesRunnerConfigsDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.RivetError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RivetTimeoutError( + "Timeout exceeded when calling DELETE /namespaces/{namespace_id}/runner-configs/{runner_name}.", + ); + case "unknown": + throw new errors.RivetError({ + message: _response.error.errorMessage, + }); + } + } +} diff --git a/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/index.ts b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/index.ts new file mode 100644 index 0000000000..415726b7fe --- /dev/null +++ b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/NamespacesRunnerConfigsListRequest.ts b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/NamespacesRunnerConfigsListRequest.ts new file mode 100644 index 0000000000..0036ae2809 --- /dev/null +++ b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/NamespacesRunnerConfigsListRequest.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Rivet from "../../../../index"; + +/** + * @example + * {} + */ +export interface NamespacesRunnerConfigsListRequest { + limit?: number; + cursor?: string; + variant?: Rivet.NamespacesRunnerConfigVariant; +} diff --git a/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/index.ts b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/index.ts new file mode 100644 index 0000000000..5c4c33a5b5 --- /dev/null +++ b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/client/requests/index.ts @@ -0,0 +1 @@ +export { type NamespacesRunnerConfigsListRequest } from "./NamespacesRunnerConfigsListRequest"; diff --git a/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/index.ts b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/index.ts new file mode 100644 index 0000000000..5ec76921e1 --- /dev/null +++ b/sdks/typescript/api-full/src/api/resources/namespacesRunnerConfigs/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/sdks/typescript/api-full/src/api/types/Datacenter.ts b/sdks/typescript/api-full/src/api/types/Datacenter.ts index 25e56e9375..20d24c2eac 100644 --- a/sdks/typescript/api-full/src/api/types/Datacenter.ts +++ b/sdks/typescript/api-full/src/api/types/Datacenter.ts @@ -5,5 +5,4 @@ export interface Datacenter { datacenterLabel: number; name: string; - url: string; } diff --git a/sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMap.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfig.ts similarity index 52% rename from sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMap.ts rename to sdks/typescript/api-full/src/api/types/NamespacesRunnerConfig.ts index 6dd54e10c7..538e19e4c9 100644 --- a/sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMap.ts +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfig.ts @@ -4,4 +4,6 @@ import * as Rivet from "../index"; -export type StringTcpAddressHashableMap = Record; +export interface NamespacesRunnerConfig { + serverless: Rivet.NamespacesRunnerConfigServerless; +} diff --git a/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigServerless.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigServerless.ts new file mode 100644 index 0000000000..692699acbc --- /dev/null +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigServerless.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface NamespacesRunnerConfigServerless { + maxRunners: number; + minRunners: number; + /** Seconds. */ + requestLifespan: number; + runnersMargin: number; + slotsPerRunner: number; + url: string; +} diff --git a/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigVariant.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigVariant.ts new file mode 100644 index 0000000000..8b73becdf1 --- /dev/null +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigVariant.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type NamespacesRunnerConfigVariant = "serverless"; diff --git a/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsDeleteResponse.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsDeleteResponse.ts new file mode 100644 index 0000000000..f5270b51ae --- /dev/null +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsDeleteResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type NamespacesRunnerConfigsDeleteResponse = Record; diff --git a/sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMap.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsGetResponse.ts similarity index 51% rename from sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMap.ts rename to sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsGetResponse.ts index 9b2dc7a105..9a7755f669 100644 --- a/sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMap.ts +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsGetResponse.ts @@ -4,4 +4,6 @@ import * as Rivet from "../index"; -export type StringHttpAddressHashableMap = Record; +export interface NamespacesRunnerConfigsGetResponse { + runnerConfig: Rivet.NamespacesRunnerConfig; +} diff --git a/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsListResponse.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsListResponse.ts new file mode 100644 index 0000000000..7140ec63c5 --- /dev/null +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsListResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Rivet from "../index"; + +export interface NamespacesRunnerConfigsListResponse { + pagination: Rivet.Pagination; + runnerConfigs: Record; +} diff --git a/sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMap.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertRequest.ts similarity index 52% rename from sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMap.ts rename to sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertRequest.ts index d5441dac79..72726205ed 100644 --- a/sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMap.ts +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertRequest.ts @@ -4,4 +4,4 @@ import * as Rivet from "../index"; -export type StringUdpAddressHashableMap = Record; +export type NamespacesRunnerConfigsUpsertRequest = Rivet.NamespacesRunnerConfig; diff --git a/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertResponse.ts b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertResponse.ts new file mode 100644 index 0000000000..5411ad11bd --- /dev/null +++ b/sdks/typescript/api-full/src/api/types/NamespacesRunnerConfigsUpsertResponse.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type NamespacesRunnerConfigsUpsertResponse = Record; diff --git a/sdks/typescript/api-full/src/api/types/Runner.ts b/sdks/typescript/api-full/src/api/types/Runner.ts index b59e5f4641..b2e3cd5229 100644 --- a/sdks/typescript/api-full/src/api/types/Runner.ts +++ b/sdks/typescript/api-full/src/api/types/Runner.ts @@ -5,9 +5,6 @@ import * as Rivet from "../index"; export interface Runner { - addressesHttp: Rivet.StringHttpAddressHashableMap; - addressesTcp: Rivet.StringTcpAddressHashableMap; - addressesUdp: Rivet.StringUdpAddressHashableMap; createTs: number; datacenter: string; drainTs?: number; diff --git a/sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMapValue.ts deleted file mode 100644 index 531c57f786..0000000000 --- a/sdks/typescript/api-full/src/api/types/StringHttpAddressHashableMapValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface StringHttpAddressHashableMapValue { - hostname: string; - port: number; -} diff --git a/sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMapValue.ts deleted file mode 100644 index 24fcc496b1..0000000000 --- a/sdks/typescript/api-full/src/api/types/StringTcpAddressHashableMapValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface StringTcpAddressHashableMapValue { - hostname: string; - port: number; -} diff --git a/sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMapValue.ts deleted file mode 100644 index 2cc4eb466d..0000000000 --- a/sdks/typescript/api-full/src/api/types/StringUdpAddressHashableMapValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface StringUdpAddressHashableMapValue { - hostname: string; - port: number; -} diff --git a/sdks/typescript/api-full/src/api/types/index.ts b/sdks/typescript/api-full/src/api/types/index.ts index 797f893a23..c2dbb33ae5 100644 --- a/sdks/typescript/api-full/src/api/types/index.ts +++ b/sdks/typescript/api-full/src/api/types/index.ts @@ -15,15 +15,17 @@ export * from "./Namespace"; export * from "./NamespacesCreateResponse"; export * from "./NamespacesGetResponse"; export * from "./NamespacesListResponse"; +export * from "./NamespacesRunnerConfigServerless"; +export * from "./NamespacesRunnerConfig"; +export * from "./NamespacesRunnerConfigVariant"; +export * from "./NamespacesRunnerConfigsDeleteResponse"; +export * from "./NamespacesRunnerConfigsGetResponse"; +export * from "./NamespacesRunnerConfigsListResponse"; +export * from "./NamespacesRunnerConfigsUpsertRequest"; +export * from "./NamespacesRunnerConfigsUpsertResponse"; export * from "./Pagination"; export * from "./RivetId"; export * from "./Runner"; export * from "./RunnersGetResponse"; export * from "./RunnersListNamesResponse"; export * from "./RunnersListResponse"; -export * from "./StringHttpAddressHashableMapValue"; -export * from "./StringHttpAddressHashableMap"; -export * from "./StringTcpAddressHashableMapValue"; -export * from "./StringTcpAddressHashableMap"; -export * from "./StringUdpAddressHashableMapValue"; -export * from "./StringUdpAddressHashableMap"; diff --git a/sdks/typescript/api-full/src/serialization/types/Datacenter.ts b/sdks/typescript/api-full/src/serialization/types/Datacenter.ts index 13b5443b3d..14d56a925e 100644 --- a/sdks/typescript/api-full/src/serialization/types/Datacenter.ts +++ b/sdks/typescript/api-full/src/serialization/types/Datacenter.ts @@ -10,13 +10,11 @@ export const Datacenter: core.serialization.ObjectSchema = core.serialization.object({ + serverless: NamespacesRunnerConfigServerless, +}); + +export declare namespace NamespacesRunnerConfig { + export interface Raw { + serverless: NamespacesRunnerConfigServerless.Raw; + } +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigServerless.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigServerless.ts new file mode 100644 index 0000000000..3a43d41636 --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigServerless.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; + +export const NamespacesRunnerConfigServerless: core.serialization.ObjectSchema< + serializers.NamespacesRunnerConfigServerless.Raw, + Rivet.NamespacesRunnerConfigServerless +> = core.serialization.object({ + maxRunners: core.serialization.property("max_runners", core.serialization.number()), + minRunners: core.serialization.property("min_runners", core.serialization.number()), + requestLifespan: core.serialization.property("request_lifespan", core.serialization.number()), + runnersMargin: core.serialization.property("runners_margin", core.serialization.number()), + slotsPerRunner: core.serialization.property("slots_per_runner", core.serialization.number()), + url: core.serialization.string(), +}); + +export declare namespace NamespacesRunnerConfigServerless { + export interface Raw { + max_runners: number; + min_runners: number; + request_lifespan: number; + runners_margin: number; + slots_per_runner: number; + url: string; + } +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigVariant.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigVariant.ts new file mode 100644 index 0000000000..bf81ed8234 --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigVariant.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; + +export const NamespacesRunnerConfigVariant: core.serialization.Schema< + serializers.NamespacesRunnerConfigVariant.Raw, + Rivet.NamespacesRunnerConfigVariant +> = core.serialization.stringLiteral("serverless"); + +export declare namespace NamespacesRunnerConfigVariant { + export type Raw = "serverless"; +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts new file mode 100644 index 0000000000..ad022d0a0a --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; + +export const NamespacesRunnerConfigsDeleteResponse: core.serialization.Schema< + serializers.NamespacesRunnerConfigsDeleteResponse.Raw, + Rivet.NamespacesRunnerConfigsDeleteResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace NamespacesRunnerConfigsDeleteResponse { + export type Raw = Record; +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsGetResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsGetResponse.ts new file mode 100644 index 0000000000..728f3def3c --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsGetResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; +import { NamespacesRunnerConfig } from "./NamespacesRunnerConfig"; + +export const NamespacesRunnerConfigsGetResponse: core.serialization.ObjectSchema< + serializers.NamespacesRunnerConfigsGetResponse.Raw, + Rivet.NamespacesRunnerConfigsGetResponse +> = core.serialization.object({ + runnerConfig: core.serialization.property("runner_config", NamespacesRunnerConfig), +}); + +export declare namespace NamespacesRunnerConfigsGetResponse { + export interface Raw { + runner_config: NamespacesRunnerConfig.Raw; + } +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsListResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsListResponse.ts new file mode 100644 index 0000000000..cdcd039091 --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsListResponse.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; +import { Pagination } from "./Pagination"; +import { NamespacesRunnerConfig } from "./NamespacesRunnerConfig"; + +export const NamespacesRunnerConfigsListResponse: core.serialization.ObjectSchema< + serializers.NamespacesRunnerConfigsListResponse.Raw, + Rivet.NamespacesRunnerConfigsListResponse +> = core.serialization.object({ + pagination: Pagination, + runnerConfigs: core.serialization.property( + "runner_configs", + core.serialization.record(core.serialization.string(), NamespacesRunnerConfig), + ), +}); + +export declare namespace NamespacesRunnerConfigsListResponse { + export interface Raw { + pagination: Pagination.Raw; + runner_configs: Record; + } +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts new file mode 100644 index 0000000000..899d4d009b --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; +import { NamespacesRunnerConfig } from "./NamespacesRunnerConfig"; + +export const NamespacesRunnerConfigsUpsertRequest: core.serialization.ObjectSchema< + serializers.NamespacesRunnerConfigsUpsertRequest.Raw, + Rivet.NamespacesRunnerConfigsUpsertRequest +> = NamespacesRunnerConfig; + +export declare namespace NamespacesRunnerConfigsUpsertRequest { + export type Raw = NamespacesRunnerConfig.Raw; +} diff --git a/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts new file mode 100644 index 0000000000..6732d0d6fd --- /dev/null +++ b/sdks/typescript/api-full/src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Rivet from "../../api/index"; +import * as core from "../../core"; + +export const NamespacesRunnerConfigsUpsertResponse: core.serialization.Schema< + serializers.NamespacesRunnerConfigsUpsertResponse.Raw, + Rivet.NamespacesRunnerConfigsUpsertResponse +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); + +export declare namespace NamespacesRunnerConfigsUpsertResponse { + export type Raw = Record; +} diff --git a/sdks/typescript/api-full/src/serialization/types/Runner.ts b/sdks/typescript/api-full/src/serialization/types/Runner.ts index 00bc3cbc47..d0d828d52f 100644 --- a/sdks/typescript/api-full/src/serialization/types/Runner.ts +++ b/sdks/typescript/api-full/src/serialization/types/Runner.ts @@ -5,18 +5,9 @@ import * as serializers from "../index"; import * as Rivet from "../../api/index"; import * as core from "../../core"; -import { StringHttpAddressHashableMap } from "./StringHttpAddressHashableMap"; -import { StringTcpAddressHashableMap } from "./StringTcpAddressHashableMap"; -import { StringUdpAddressHashableMap } from "./StringUdpAddressHashableMap"; import { RivetId } from "./RivetId"; -import { StringHttpAddressHashableMapValue } from "./StringHttpAddressHashableMapValue"; -import { StringTcpAddressHashableMapValue } from "./StringTcpAddressHashableMapValue"; -import { StringUdpAddressHashableMapValue } from "./StringUdpAddressHashableMapValue"; export const Runner: core.serialization.ObjectSchema = core.serialization.object({ - addressesHttp: core.serialization.property("addresses_http", StringHttpAddressHashableMap), - addressesTcp: core.serialization.property("addresses_tcp", StringTcpAddressHashableMap), - addressesUdp: core.serialization.property("addresses_udp", StringUdpAddressHashableMap), createTs: core.serialization.property("create_ts", core.serialization.number()), datacenter: core.serialization.string(), drainTs: core.serialization.property("drain_ts", core.serialization.number().optional()), @@ -36,9 +27,6 @@ export const Runner: core.serialization.ObjectSchema = core.serialization.record(core.serialization.string(), StringHttpAddressHashableMapValue); - -export declare namespace StringHttpAddressHashableMap { - export type Raw = Record; -} diff --git a/sdks/typescript/api-full/src/serialization/types/StringHttpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/serialization/types/StringHttpAddressHashableMapValue.ts deleted file mode 100644 index 5f2d193258..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/StringHttpAddressHashableMapValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; - -export const StringHttpAddressHashableMapValue: core.serialization.ObjectSchema< - serializers.StringHttpAddressHashableMapValue.Raw, - Rivet.StringHttpAddressHashableMapValue -> = core.serialization.object({ - hostname: core.serialization.string(), - port: core.serialization.number(), -}); - -export declare namespace StringHttpAddressHashableMapValue { - export interface Raw { - hostname: string; - port: number; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMap.ts b/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMap.ts deleted file mode 100644 index 4d49342085..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMap.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { StringTcpAddressHashableMapValue } from "./StringTcpAddressHashableMapValue"; - -export const StringTcpAddressHashableMap: core.serialization.Schema< - serializers.StringTcpAddressHashableMap.Raw, - Rivet.StringTcpAddressHashableMap -> = core.serialization.record(core.serialization.string(), StringTcpAddressHashableMapValue); - -export declare namespace StringTcpAddressHashableMap { - export type Raw = Record; -} diff --git a/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMapValue.ts deleted file mode 100644 index 6de8cafd7d..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/StringTcpAddressHashableMapValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; - -export const StringTcpAddressHashableMapValue: core.serialization.ObjectSchema< - serializers.StringTcpAddressHashableMapValue.Raw, - Rivet.StringTcpAddressHashableMapValue -> = core.serialization.object({ - hostname: core.serialization.string(), - port: core.serialization.number(), -}); - -export declare namespace StringTcpAddressHashableMapValue { - export interface Raw { - hostname: string; - port: number; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMap.ts b/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMap.ts deleted file mode 100644 index b64dc0ed04..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMap.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; -import { StringUdpAddressHashableMapValue } from "./StringUdpAddressHashableMapValue"; - -export const StringUdpAddressHashableMap: core.serialization.Schema< - serializers.StringUdpAddressHashableMap.Raw, - Rivet.StringUdpAddressHashableMap -> = core.serialization.record(core.serialization.string(), StringUdpAddressHashableMapValue); - -export declare namespace StringUdpAddressHashableMap { - export type Raw = Record; -} diff --git a/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMapValue.ts b/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMapValue.ts deleted file mode 100644 index c280fcb1f2..0000000000 --- a/sdks/typescript/api-full/src/serialization/types/StringUdpAddressHashableMapValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Rivet from "../../api/index"; -import * as core from "../../core"; - -export const StringUdpAddressHashableMapValue: core.serialization.ObjectSchema< - serializers.StringUdpAddressHashableMapValue.Raw, - Rivet.StringUdpAddressHashableMapValue -> = core.serialization.object({ - hostname: core.serialization.string(), - port: core.serialization.number(), -}); - -export declare namespace StringUdpAddressHashableMapValue { - export interface Raw { - hostname: string; - port: number; - } -} diff --git a/sdks/typescript/api-full/src/serialization/types/index.ts b/sdks/typescript/api-full/src/serialization/types/index.ts index 797f893a23..c2dbb33ae5 100644 --- a/sdks/typescript/api-full/src/serialization/types/index.ts +++ b/sdks/typescript/api-full/src/serialization/types/index.ts @@ -15,15 +15,17 @@ export * from "./Namespace"; export * from "./NamespacesCreateResponse"; export * from "./NamespacesGetResponse"; export * from "./NamespacesListResponse"; +export * from "./NamespacesRunnerConfigServerless"; +export * from "./NamespacesRunnerConfig"; +export * from "./NamespacesRunnerConfigVariant"; +export * from "./NamespacesRunnerConfigsDeleteResponse"; +export * from "./NamespacesRunnerConfigsGetResponse"; +export * from "./NamespacesRunnerConfigsListResponse"; +export * from "./NamespacesRunnerConfigsUpsertRequest"; +export * from "./NamespacesRunnerConfigsUpsertResponse"; export * from "./Pagination"; export * from "./RivetId"; export * from "./Runner"; export * from "./RunnersGetResponse"; export * from "./RunnersListNamesResponse"; export * from "./RunnersListResponse"; -export * from "./StringHttpAddressHashableMapValue"; -export * from "./StringHttpAddressHashableMap"; -export * from "./StringTcpAddressHashableMapValue"; -export * from "./StringTcpAddressHashableMap"; -export * from "./StringUdpAddressHashableMapValue"; -export * from "./StringUdpAddressHashableMap";