diff --git a/errors/builds/build-not-found.md b/errors/builds/build-not-found.md new file mode 100644 index 0000000000..b8031d9d51 --- /dev/null +++ b/errors/builds/build-not-found.md @@ -0,0 +1,9 @@ +--- +name = "BUILDS_BUILD_NOT_FOUND" +description = "Build not found." +http_status = 400 +--- + +# Build Not Found + +Build not found for given ID. diff --git a/fern/definition/servers/__package__.yml b/fern/definition/games/servers/__package__.yml similarity index 96% rename from fern/definition/servers/__package__.yml rename to fern/definition/games/servers/__package__.yml index 82a6b83435..2605356af9 100644 --- a/fern/definition/servers/__package__.yml +++ b/fern/definition/games/servers/__package__.yml @@ -5,7 +5,9 @@ imports: service: auth: true - base-path: /servers + base-path: /games/{game_id}/servers + path-parameters: + game_id: uuid endpoints: get: path: /{server_id} @@ -102,9 +104,7 @@ types: type: commons.Server DestroyServerResponse: - properties: - server_id: - type: uuid + properties: {} ListServersResponse: properties: diff --git a/fern/definition/servers/builds.yml b/fern/definition/games/servers/builds.yml similarity index 87% rename from fern/definition/servers/builds.yml rename to fern/definition/games/servers/builds.yml index 9de971745c..51d6621f3a 100644 --- a/fern/definition/servers/builds.yml +++ b/fern/definition/games/servers/builds.yml @@ -1,16 +1,18 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json imports: - commons: ../common.yml - uploadCommons: ../upload/common.yml - cloudCommons: ../cloud/common.yml + commons: ../../common.yml + uploadCommons: ../../upload/common.yml + cloudCommons: ../../cloud/common.yml service: auth: true - base-path: /servers + base-path: /games/{game_id}/builds + path-parameters: + game_id: uuid endpoints: listBuilds: - path: /builds + path: "" method: GET docs: >- Lists all builds of the game associated with the token used. Can be @@ -23,7 +25,7 @@ service: response: ListBuildsResponse prepareBuild: - path: /builds + path: /prepare method: POST docs: Creates a new game build for the given game. request: @@ -31,11 +33,11 @@ service: response: CreateBuildResponse completeBuild: - path: /uploads/{upload_id}/complete + path: /{build_id}/complete method: POST docs: Marks an upload as complete. path-parameters: - upload_id: + build_id: type: uuid types: diff --git a/fern/definition/servers/common.yml b/fern/definition/games/servers/common.yml similarity index 100% rename from fern/definition/servers/common.yml rename to fern/definition/games/servers/common.yml diff --git a/fern/definition/servers/logs.yml b/fern/definition/games/servers/logs.yml similarity index 88% rename from fern/definition/servers/logs.yml rename to fern/definition/games/servers/logs.yml index ba994de6a4..0724e2f2ac 100644 --- a/fern/definition/servers/logs.yml +++ b/fern/definition/games/servers/logs.yml @@ -1,13 +1,13 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json imports: - commons: ../common.yml - uploadCommons: ../upload/common.yml - cloudCommons: ../cloud/common.yml + commons: ../../common.yml service: auth: true - base-path: /servers + base-path: /games/{game_id}/servers + path-parameters: + game_id: uuid endpoints: getServerLogs: path: /{server_id}/logs diff --git a/lib/convert/src/impls/ds.rs b/lib/convert/src/impls/ds.rs index dd7de2d896..9b8fd50115 100644 --- a/lib/convert/src/impls/ds.rs +++ b/lib/convert/src/impls/ds.rs @@ -7,10 +7,10 @@ use rivet_operation::prelude::*; use crate::{ApiFrom, ApiInto, ApiTryFrom, ApiTryInto}; use serde_json::{json, to_value}; -impl ApiTryFrom for models::ServersServer { +impl ApiTryFrom for models::GamesServersServer { type Error = GlobalError; - fn api_try_from(value: backend::ds::Server) -> GlobalResult { - Ok(models::ServersServer { + fn api_try_from(value: backend::ds::Server) -> GlobalResult { + Ok(models::GamesServersServer { cluster_id: unwrap!(value.cluster_id).as_uuid(), create_ts: value.create_ts, start_ts: value.start_ts, @@ -24,7 +24,7 @@ impl ApiTryFrom for models::ServersServer { arguments: Some(value.args), environment: Some(value.environment), image_id: unwrap!(value.image_id).as_uuid(), - network: Box::new(models::ServersNetwork { + network: Box::new(models::GamesServersNetwork { mode: Some( unwrap!(backend::ds::NetworkMode::from_i32(value.network_mode)).api_into(), ), @@ -38,8 +38,8 @@ impl ApiTryFrom for models::ServersServer { } } -impl ApiFrom for backend::ds::ServerResources { - fn api_from(value: models::ServersResources) -> backend::ds::ServerResources { +impl ApiFrom for backend::ds::ServerResources { + fn api_from(value: models::GamesServersResources) -> backend::ds::ServerResources { backend::ds::ServerResources { cpu_millicores: value.cpu, memory_mib: value.memory, @@ -47,37 +47,37 @@ impl ApiFrom for backend::ds::ServerResources { } } -impl ApiFrom for models::ServersResources { - fn api_from(value: backend::ds::ServerResources) -> models::ServersResources { - models::ServersResources { +impl ApiFrom for models::GamesServersResources { + fn api_from(value: backend::ds::ServerResources) -> models::GamesServersResources { + models::GamesServersResources { cpu: value.cpu_millicores, memory: value.memory_mib, } } } -impl ApiFrom for backend::ds::NetworkMode { - fn api_from(value: models::ServersNetworkMode) -> backend::ds::NetworkMode { +impl ApiFrom for backend::ds::NetworkMode { + fn api_from(value: models::GamesServersNetworkMode) -> backend::ds::NetworkMode { match value { - models::ServersNetworkMode::Bridge => backend::ds::NetworkMode::Bridge, - models::ServersNetworkMode::Host => backend::ds::NetworkMode::Host, + models::GamesServersNetworkMode::Bridge => backend::ds::NetworkMode::Bridge, + models::GamesServersNetworkMode::Host => backend::ds::NetworkMode::Host, } } } -impl ApiFrom for models::ServersNetworkMode { - fn api_from(value: backend::ds::NetworkMode) -> models::ServersNetworkMode { +impl ApiFrom for models::GamesServersNetworkMode { + fn api_from(value: backend::ds::NetworkMode) -> models::GamesServersNetworkMode { match value { - backend::ds::NetworkMode::Bridge => models::ServersNetworkMode::Bridge, - backend::ds::NetworkMode::Host => models::ServersNetworkMode::Host, + backend::ds::NetworkMode::Bridge => models::GamesServersNetworkMode::Bridge, + backend::ds::NetworkMode::Host => models::GamesServersNetworkMode::Host, } } } -impl ApiTryFrom for models::ServersPort { +impl ApiTryFrom for models::GamesServersPort { type Error = GlobalError; - fn api_try_from(value: backend::ds::Port) -> GlobalResult { + fn api_try_from(value: backend::ds::Port) -> GlobalResult { let protocol = match unwrap!(&value.routing) { backend::ds::port::Routing::GameGuard(x) => { unwrap!(backend::ds::GameGuardProtocol::from_i32(x.protocol)).api_into() @@ -87,7 +87,7 @@ impl ApiTryFrom for models::ServersPort { } }; - let routing = models::ServersPortRouting { + let routing = models::GamesServersPortRouting { game_guard: if let Some(backend::ds::port::Routing::GameGuard(_)) = &value.routing { Some(json!({})) } else { @@ -100,7 +100,7 @@ impl ApiTryFrom for models::ServersPort { }, }; - Ok(models::ServersPort { + Ok(models::GamesServersPort { protocol, internal_port: value.internal_port, public_hostname: value.public_hostname, @@ -110,46 +110,48 @@ impl ApiTryFrom for models::ServersPort { } } -impl ApiFrom for backend::ds::GameGuardProtocol { - fn api_from(value: models::ServersPortProtocol) -> backend::ds::GameGuardProtocol { +impl ApiFrom for backend::ds::GameGuardProtocol { + fn api_from(value: models::GamesServersPortProtocol) -> backend::ds::GameGuardProtocol { match value { - models::ServersPortProtocol::Udp => backend::ds::GameGuardProtocol::Udp, - models::ServersPortProtocol::Tcp => backend::ds::GameGuardProtocol::Tcp, - models::ServersPortProtocol::Http => backend::ds::GameGuardProtocol::Http, - models::ServersPortProtocol::Https => backend::ds::GameGuardProtocol::Https, - models::ServersPortProtocol::TcpTls => backend::ds::GameGuardProtocol::TcpTls, + models::GamesServersPortProtocol::Udp => backend::ds::GameGuardProtocol::Udp, + models::GamesServersPortProtocol::Tcp => backend::ds::GameGuardProtocol::Tcp, + models::GamesServersPortProtocol::Http => backend::ds::GameGuardProtocol::Http, + models::GamesServersPortProtocol::Https => backend::ds::GameGuardProtocol::Https, + models::GamesServersPortProtocol::TcpTls => backend::ds::GameGuardProtocol::TcpTls, } } } -impl ApiFrom for models::ServersPortProtocol { - fn api_from(value: backend::ds::GameGuardProtocol) -> models::ServersPortProtocol { +impl ApiFrom for models::GamesServersPortProtocol { + fn api_from(value: backend::ds::GameGuardProtocol) -> models::GamesServersPortProtocol { match value { - backend::ds::GameGuardProtocol::Udp => models::ServersPortProtocol::Udp, - backend::ds::GameGuardProtocol::Tcp => models::ServersPortProtocol::Tcp, - backend::ds::GameGuardProtocol::Http => models::ServersPortProtocol::Http, - backend::ds::GameGuardProtocol::Https => models::ServersPortProtocol::Https, - backend::ds::GameGuardProtocol::TcpTls => models::ServersPortProtocol::TcpTls, + backend::ds::GameGuardProtocol::Udp => models::GamesServersPortProtocol::Udp, + backend::ds::GameGuardProtocol::Tcp => models::GamesServersPortProtocol::Tcp, + backend::ds::GameGuardProtocol::Http => models::GamesServersPortProtocol::Http, + backend::ds::GameGuardProtocol::Https => models::GamesServersPortProtocol::Https, + backend::ds::GameGuardProtocol::TcpTls => models::GamesServersPortProtocol::TcpTls, } } } -impl ApiTryFrom for backend::ds::HostProtocol { +impl ApiTryFrom for backend::ds::HostProtocol { type Error = GlobalError; - fn api_try_from(value: models::ServersPortProtocol) -> GlobalResult { + fn api_try_from( + value: models::GamesServersPortProtocol, + ) -> GlobalResult { Ok(match value { - models::ServersPortProtocol::Udp => backend::ds::HostProtocol::HostUdp, - models::ServersPortProtocol::Tcp => backend::ds::HostProtocol::HostTcp, + models::GamesServersPortProtocol::Udp => backend::ds::HostProtocol::HostUdp, + models::GamesServersPortProtocol::Tcp => backend::ds::HostProtocol::HostTcp, _ => bail_with!(SERVERS_UNSUPPORTED_HOST_PROTOCOL), }) } } -impl ApiFrom for models::ServersPortProtocol { - fn api_from(value: backend::ds::HostProtocol) -> models::ServersPortProtocol { +impl ApiFrom for models::GamesServersPortProtocol { + fn api_from(value: backend::ds::HostProtocol) -> models::GamesServersPortProtocol { match value { - backend::ds::HostProtocol::HostUdp => models::ServersPortProtocol::Udp, - backend::ds::HostProtocol::HostTcp => models::ServersPortProtocol::Tcp, + backend::ds::HostProtocol::HostUdp => models::GamesServersPortProtocol::Udp, + backend::ds::HostProtocol::HostTcp => models::GamesServersPortProtocol::Tcp, } } } diff --git a/scripts/openapi/gen_rust.sh b/scripts/openapi/gen_rust.sh index d0dfd3314b..764eba4a1a 100755 --- a/scripts/openapi/gen_rust.sh +++ b/scripts/openapi/gen_rust.sh @@ -21,7 +21,7 @@ docker run --rm \ if [ "$FERN_GROUP" == "full" ]; then # Fix OpenAPI bug (https://github.com/OpenAPITools/openapi-generator/issues/14171) sed -i 's/CloudGamesLogStream/crate::models::CloudGamesLogStream/' "$GEN_PATH_RUST/src/apis/cloud_games_matchmaker_api.rs" - sed -i 's/ServersLogStream/crate::models::ServersLogStream/' "$GEN_PATH_RUST/src/apis/servers_logs_api.rs" + sed -i 's/GamesServersLogStream/crate::models::GamesServersLogStream/' "$GEN_PATH_RUST/src/apis/games_servers_logs_api.rs" sed -i 's/AdminClustersPoolType/crate::models::AdminClustersPoolType/' "$GEN_PATH_RUST/src/apis/admin_clusters_servers_api.rs" # Create variant specifically for the CLI diff --git a/sdks/full/go/client/client.go b/sdks/full/go/client/client.go index b02b1e5203..ebe6f6dd05 100644 --- a/sdks/full/go/client/client.go +++ b/sdks/full/go/client/client.go @@ -8,6 +8,7 @@ import ( authclient "sdk/auth/client" cloudclient "sdk/cloud/client" core "sdk/core" + gamesclient "sdk/games/client" groupclient "sdk/group/client" identityclient "sdk/identity/client" jobclient "sdk/job/client" @@ -15,7 +16,6 @@ import ( matchmakerclient "sdk/matchmaker/client" portalclient "sdk/portal/client" provisionclient "sdk/provision/client" - serversclient "sdk/servers/client" ) type Client struct { @@ -25,11 +25,11 @@ type Client struct { Admin *adminclient.Client Cloud *cloudclient.Client + Games *gamesclient.Client Group *groupclient.Client Identity *identityclient.Client Kv *kvclient.Client Provision *provisionclient.Client - Servers *serversclient.Client Auth *authclient.Client Job *jobclient.Client Matchmaker *matchmakerclient.Client @@ -47,11 +47,11 @@ func NewClient(opts ...core.ClientOption) *Client { header: options.ToHeader(), Admin: adminclient.NewClient(opts...), Cloud: cloudclient.NewClient(opts...), + Games: gamesclient.NewClient(opts...), Group: groupclient.NewClient(opts...), Identity: identityclient.NewClient(opts...), Kv: kvclient.NewClient(opts...), Provision: provisionclient.NewClient(opts...), - Servers: serversclient.NewClient(opts...), Auth: authclient.NewClient(opts...), Job: jobclient.NewClient(opts...), Matchmaker: matchmakerclient.NewClient(opts...), diff --git a/sdks/full/go/games/client/client.go b/sdks/full/go/games/client/client.go new file mode 100644 index 0000000000..02e33752a3 --- /dev/null +++ b/sdks/full/go/games/client/client.go @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +package client + +import ( + http "net/http" + core "sdk/core" + serversclient "sdk/games/servers/client" +) + +type Client struct { + baseURL string + caller *core.Caller + header http.Header + + Servers *serversclient.Client +} + +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(), + Servers: serversclient.NewClient(opts...), + } +} diff --git a/sdks/full/go/servers/builds.go b/sdks/full/go/games/servers/builds.go similarity index 100% rename from sdks/full/go/servers/builds.go rename to sdks/full/go/games/servers/builds.go diff --git a/sdks/full/go/servers/builds/client.go b/sdks/full/go/games/servers/builds/client.go similarity index 90% rename from sdks/full/go/servers/builds/client.go rename to sdks/full/go/games/servers/builds/client.go index 6edd1df028..b0f861d555 100644 --- a/sdks/full/go/servers/builds/client.go +++ b/sdks/full/go/games/servers/builds/client.go @@ -14,7 +14,7 @@ import ( url "net/url" sdk "sdk" core "sdk/core" - servers "sdk/servers" + servers "sdk/games/servers" ) type Client struct { @@ -36,12 +36,12 @@ func NewClient(opts ...core.ClientOption) *Client { } // Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. -func (c *Client) ListBuilds(ctx context.Context, request *servers.GetBuildsRequest) (*servers.ListBuildsResponse, error) { +func (c *Client) ListBuilds(ctx context.Context, gameId uuid.UUID, request *servers.GetBuildsRequest) (*servers.ListBuildsResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := baseURL + "/" + "servers/builds" + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/builds", gameId) queryParams := make(url.Values) if request.Tags != nil { @@ -125,12 +125,12 @@ func (c *Client) ListBuilds(ctx context.Context, request *servers.GetBuildsReque } // Creates a new game build for the given game. -func (c *Client) PrepareBuild(ctx context.Context, request *servers.CreateBuildRequest) (*servers.CreateBuildResponse, error) { +func (c *Client) PrepareBuild(ctx context.Context, gameId uuid.UUID, request *servers.CreateBuildRequest) (*servers.CreateBuildResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := baseURL + "/" + "servers/builds" + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/builds/prepare", gameId) errorDecoder := func(statusCode int, body io.Reader) error { raw, err := io.ReadAll(body) @@ -204,12 +204,12 @@ func (c *Client) PrepareBuild(ctx context.Context, request *servers.CreateBuildR } // Marks an upload as complete. -func (c *Client) CompleteBuild(ctx context.Context, uploadId uuid.UUID) error { +func (c *Client) CompleteBuild(ctx context.Context, gameId uuid.UUID, buildId uuid.UUID) error { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := fmt.Sprintf(baseURL+"/"+"servers/uploads/%v/complete", uploadId) + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/builds/%v/complete", gameId, buildId) errorDecoder := func(statusCode int, body io.Reader) error { raw, err := io.ReadAll(body) diff --git a/sdks/full/go/servers/client/client.go b/sdks/full/go/games/servers/client/client.go similarity index 89% rename from sdks/full/go/servers/client/client.go rename to sdks/full/go/games/servers/client/client.go index 84db21a181..10fffaf3e4 100644 --- a/sdks/full/go/servers/client/client.go +++ b/sdks/full/go/games/servers/client/client.go @@ -14,9 +14,9 @@ import ( url "net/url" sdk "sdk" core "sdk/core" - servers "sdk/servers" - builds "sdk/servers/builds" - logs "sdk/servers/logs" + servers "sdk/games/servers" + builds "sdk/games/servers/builds" + logs "sdk/games/servers/logs" ) type Client struct { @@ -45,12 +45,12 @@ func NewClient(opts ...core.ClientOption) *Client { // Gets a dynamic server. // // The id of the server to destroy -func (c *Client) Get(ctx context.Context, serverId uuid.UUID) (*servers.GetServerResponse, error) { +func (c *Client) Get(ctx context.Context, gameId uuid.UUID, serverId uuid.UUID) (*servers.GetServerResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := fmt.Sprintf(baseURL+"/"+"servers/%v", serverId) + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/servers/%v", gameId, serverId) errorDecoder := func(statusCode int, body io.Reader) error { raw, err := io.ReadAll(body) @@ -123,12 +123,12 @@ func (c *Client) Get(ctx context.Context, serverId uuid.UUID) (*servers.GetServe } // Lists all servers associated with the token used. Can be filtered by tags in the query string. -func (c *Client) List(ctx context.Context, request *servers.GetServersRequest) (*servers.ListServersResponse, error) { +func (c *Client) List(ctx context.Context, gameId uuid.UUID, request *servers.GetServersRequest) (*servers.ListServersResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := baseURL + "/" + "servers" + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/servers", gameId) queryParams := make(url.Values) if request.Tags != nil { @@ -212,12 +212,12 @@ func (c *Client) List(ctx context.Context, request *servers.GetServersRequest) ( } // Create a new dynamic server. -func (c *Client) Create(ctx context.Context, request *servers.CreateServerRequest) (*servers.CreateServerResponse, error) { +func (c *Client) Create(ctx context.Context, gameId uuid.UUID, request *servers.CreateServerRequest) (*servers.CreateServerResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := baseURL + "/" + "servers" + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/servers", gameId) errorDecoder := func(statusCode int, body io.Reader) error { raw, err := io.ReadAll(body) @@ -293,12 +293,12 @@ func (c *Client) Create(ctx context.Context, request *servers.CreateServerReques // Destroy a dynamic server. // // The id of the server to destroy -func (c *Client) Destroy(ctx context.Context, serverId uuid.UUID, request *servers.DestroyServerRequest) (*servers.DestroyServerResponse, error) { +func (c *Client) Destroy(ctx context.Context, gameId uuid.UUID, serverId uuid.UUID, request *servers.DestroyServerRequest) (*servers.DestroyServerResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := fmt.Sprintf(baseURL+"/"+"servers/%v", serverId) + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/servers/%v", gameId, serverId) queryParams := make(url.Values) if request.OverrideKillTimeout != nil { diff --git a/sdks/full/go/servers/logs.go b/sdks/full/go/games/servers/logs.go similarity index 100% rename from sdks/full/go/servers/logs.go rename to sdks/full/go/games/servers/logs.go diff --git a/sdks/full/go/servers/logs/client.go b/sdks/full/go/games/servers/logs/client.go similarity index 90% rename from sdks/full/go/servers/logs/client.go rename to sdks/full/go/games/servers/logs/client.go index 0b1b903e1e..062ff8dcb9 100644 --- a/sdks/full/go/servers/logs/client.go +++ b/sdks/full/go/games/servers/logs/client.go @@ -14,7 +14,7 @@ import ( url "net/url" sdk "sdk" core "sdk/core" - servers "sdk/servers" + servers "sdk/games/servers" ) type Client struct { @@ -36,12 +36,12 @@ func NewClient(opts ...core.ClientOption) *Client { } // Returns the logs for a given server. -func (c *Client) GetServerLogs(ctx context.Context, serverId uuid.UUID, request *servers.GetServerLogsRequest) (*servers.GetServerLogsResponse, error) { +func (c *Client) GetServerLogs(ctx context.Context, gameId uuid.UUID, serverId uuid.UUID, request *servers.GetServerLogsRequest) (*servers.GetServerLogsResponse, error) { baseURL := "https://api.rivet.gg" if c.baseURL != "" { baseURL = c.baseURL } - endpointURL := fmt.Sprintf(baseURL+"/"+"servers/%v/logs", serverId) + endpointURL := fmt.Sprintf(baseURL+"/"+"games/%v/servers/%v/logs", gameId, serverId) queryParams := make(url.Values) queryParams.Add("stream", fmt.Sprintf("%v", request.Stream)) diff --git a/sdks/full/go/servers/servers.go b/sdks/full/go/games/servers/servers.go similarity index 99% rename from sdks/full/go/servers/servers.go rename to sdks/full/go/games/servers/servers.go index 4c840d3c86..90f9d9d1ea 100644 --- a/sdks/full/go/servers/servers.go +++ b/sdks/full/go/games/servers/servers.go @@ -80,8 +80,6 @@ func (c *CreateServerResponse) String() string { } type DestroyServerResponse struct { - ServerId uuid.UUID `json:"server_id"` - _rawJSON json.RawMessage } diff --git a/sdks/full/go/servers/types.go b/sdks/full/go/games/servers/types.go similarity index 100% rename from sdks/full/go/servers/types.go rename to sdks/full/go/games/servers/types.go diff --git a/sdks/full/openapi/openapi.yml b/sdks/full/openapi/openapi.yml index 30a4c4d78b..71fad52a1f 100644 --- a/sdks/full/openapi/openapi.yml +++ b/sdks/full/openapi/openapi.yml @@ -1780,6 +1780,275 @@ paths: schema: $ref: >- #/components/schemas/CloudGamesNamespacesUpdateGameNamespaceVersionRequest + /games/{game_id}/servers/{server_id}: + get: + description: Gets a dynamic server. + operationId: games_servers_get + tags: + - GamesServers + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + - name: server_id + in: path + description: The id of the server to destroy + required: true + schema: + type: string + format: uuid + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersGetServerResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + delete: + description: Destroy a dynamic server. + operationId: games_servers_destroy + tags: + - GamesServers + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + - name: server_id + in: path + description: The id of the server to destroy + required: true + schema: + type: string + format: uuid + - name: override_kill_timeout + in: query + description: >- + The duration to wait for in milliseconds before killing the server. + This should be used to override the default kill timeout if a faster + time is needed, say for ignoring a graceful shutdown. + required: false + schema: + type: integer + format: int64 + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersDestroyServerResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + /games/{game_id}/servers: + get: + description: >- + Lists all servers associated with the token used. Can be filtered by + tags in the query string. + operationId: games_servers_list + tags: + - GamesServers + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + - name: tags + in: query + required: false + schema: + type: string + - name: game_id + in: query + required: false + schema: + type: string + format: uuid + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersListServersResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + post: + description: Create a new dynamic server. + operationId: games_servers_create + tags: + - GamesServers + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersCreateServerResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersCreateServerRequest' /group/groups: get: description: Returns a list of suggested groups. @@ -4874,252 +5143,7 @@ paths: schema: $ref: '#/components/schemas/ErrorBody' security: *ref_0 - /servers/{server_id}: - get: - description: Gets a dynamic server. - operationId: servers_get - tags: - - Servers - parameters: - - name: server_id - in: path - description: The id of the server to destroy - required: true - schema: - type: string - format: uuid - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersGetServerResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - delete: - description: Destroy a dynamic server. - operationId: servers_destroy - tags: - - Servers - parameters: - - name: server_id - in: path - description: The id of the server to destroy - required: true - schema: - type: string - format: uuid - - name: override_kill_timeout - in: query - description: >- - The duration to wait for in milliseconds before killing the server. - This should be used to override the default kill timeout if a faster - time is needed, say for ignoring a graceful shutdown. - required: false - schema: - type: integer - format: int64 - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersDestroyServerResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - /servers: - get: - description: >- - Lists all servers associated with the token used. Can be filtered by - tags in the query string. - operationId: servers_list - tags: - - Servers - parameters: - - name: tags - in: query - required: false - schema: - type: string - - name: game_id - in: query - required: false - schema: - type: string - format: uuid - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersListServersResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - post: - description: Create a new dynamic server. - operationId: servers_create - tags: - - Servers - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateServerResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateServerRequest' - /admin/clusters/{cluster_id}/datacenters: + /admin/clusters/{cluster_id}/datacenters: get: description: Get datacenters of a cluster operationId: admin_clusters_datacenters_list @@ -7436,28 +7460,39 @@ paths: schema: $ref: '#/components/schemas/ErrorBody' security: *ref_0 - /group/invites/{group_invite_code}: + /games/{game_id}/builds: get: description: >- - Inspects a group invite returning information about the team that - created it. - operationId: group_invites_getInvite + Lists all builds of the game associated with the token used. Can be + filtered by tags in the query string. + operationId: games_servers_builds_listBuilds tags: - - GroupInvites + - GamesServersBuilds parameters: - - name: group_invite_code + - name: game_id in: path - description: Provided by `rivet.api.group#CreateInviteResponse$code`. required: true schema: type: string + format: uuid + - name: tags + in: query + required: false + schema: + type: string + - name: game_id + in: query + required: false + schema: + type: string + format: uuid responses: '200': description: '' content: application/json: schema: - $ref: '#/components/schemas/GroupGetInviteResponse' + $ref: '#/components/schemas/GamesServersListBuildsResponse' '400': description: '' content: @@ -7495,10 +7530,271 @@ paths: schema: $ref: '#/components/schemas/ErrorBody' security: *ref_0 - /group/invites/{group_invite_code}/consume: + /games/{game_id}/builds/prepare: post: - description: Consumes a group invite to join a group. - operationId: group_invites_consumeInvite + description: Creates a new game build for the given game. + operationId: games_servers_builds_prepareBuild + tags: + - GamesServersBuilds + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersCreateBuildResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersCreateBuildRequest' + /games/{game_id}/builds/{build_id}/complete: + post: + description: Marks an upload as complete. + operationId: games_servers_builds_completeBuild + tags: + - GamesServersBuilds + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + - name: build_id + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: '' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + /games/{game_id}/servers/{server_id}/logs: + get: + description: Returns the logs for a given server. + operationId: games_servers_logs_getServerLogs + tags: + - GamesServersLogs + parameters: + - name: game_id + in: path + required: true + schema: + type: string + format: uuid + - name: server_id + in: path + required: true + schema: + type: string + format: uuid + - name: stream + in: query + required: true + schema: + $ref: '#/components/schemas/GamesServersLogStream' + - name: game_id + in: query + required: false + schema: + type: string + format: uuid + - name: watch_index + in: query + description: A query parameter denoting the requests watch index. + required: false + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersGetServerLogsResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + /group/invites/{group_invite_code}: + get: + description: >- + Inspects a group invite returning information about the team that + created it. + operationId: group_invites_getInvite + tags: + - GroupInvites + parameters: + - name: group_invite_code + in: path + description: Provided by `rivet.api.group#CreateInviteResponse$code`. + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/GroupGetInviteResponse' + '400': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '403': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '408': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '429': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '500': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + security: *ref_0 + /group/invites/{group_invite_code}/consume: + post: + description: Consumes a group invite to join a group. + operationId: group_invites_consumeInvite tags: - GroupInvites parameters: @@ -9150,253 +9446,6 @@ paths: schema: $ref: '#/components/schemas/ErrorBody' security: *ref_0 - /servers/builds: - get: - description: >- - Lists all builds of the game associated with the token used. Can be - filtered by tags in the query string. - operationId: servers_builds_listBuilds - tags: - - ServersBuilds - parameters: - - name: tags - in: query - required: false - schema: - type: string - - name: game_id - in: query - required: false - schema: - type: string - format: uuid - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersListBuildsResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - post: - description: Creates a new game build for the given game. - operationId: servers_builds_prepareBuild - tags: - - ServersBuilds - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateBuildResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateBuildRequest' - /servers/uploads/{upload_id}/complete: - post: - description: Marks an upload as complete. - operationId: servers_builds_completeBuild - tags: - - ServersBuilds - parameters: - - name: upload_id - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: '' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 - /servers/{server_id}/logs: - get: - description: Returns the logs for a given server. - operationId: servers_logs_getServerLogs - tags: - - ServersLogs - parameters: - - name: server_id - in: path - required: true - schema: - type: string - format: uuid - - name: stream - in: query - required: true - schema: - $ref: '#/components/schemas/ServersLogStream' - - name: game_id - in: query - required: false - schema: - type: string - format: uuid - - name: watch_index - in: query - description: A query parameter denoting the requests watch index. - required: false - schema: - type: string - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ServersGetServerLogsResponse' - '400': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '403': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '404': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '408': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '429': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - '500': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorBody' - security: *ref_0 components: schemas: AdminLoginRequest: @@ -10084,10 +10133,98 @@ components: lobby_groups: type: array items: - $ref: '#/components/schemas/CloudVersionMatchmakerLobbyGroup' - description: |- - **Deprecated: use `game_modes` instead** - A list of game modes. + $ref: '#/components/schemas/CloudVersionMatchmakerLobbyGroup' + description: |- + **Deprecated: use `game_modes` instead** + A list of game modes. + GamesServersGetServerResponse: + type: object + properties: + server: + $ref: '#/components/schemas/GamesServersServer' + required: + - server + GamesServersCreateServerRequest: + type: object + properties: + datacenter: + type: string + description: The name ID of the datacenter + tags: {} + image_id: + type: string + format: uuid + arguments: + type: array + items: + type: string + environment: + type: object + additionalProperties: + type: string + network: + $ref: '#/components/schemas/GamesServersCreateServerNetworkRequest' + resources: + $ref: '#/components/schemas/GamesServersResources' + kill_timeout: + type: integer + format: int64 + description: >- + The duration to wait for in milliseconds before killing the server. + This should be set to a safe default, and can be overridden during a + DELETE request if needed. + webhook_url: + type: string + description: A url to send to which events from the server running will be sent + required: + - datacenter + - tags + - image_id + - network + - resources + GamesServersCreateServerNetworkRequest: + type: object + properties: + mode: + $ref: '#/components/schemas/GamesServersNetworkMode' + ports: + type: object + additionalProperties: + $ref: '#/components/schemas/GamesServersCreateServerPortRequest' + required: + - ports + GamesServersCreateServerPortRequest: + type: object + properties: + protocol: + $ref: '#/components/schemas/GamesServersPortProtocol' + internal_port: + type: integer + routing: + $ref: '#/components/schemas/GamesServersPortRouting' + required: + - protocol + GamesServersCreateServerResponse: + type: object + properties: + server: + $ref: '#/components/schemas/GamesServersServer' + description: The server that was created + required: + - server + GamesServersDestroyServerResponse: + type: object + properties: {} + GamesServersListServersResponse: + type: object + properties: + servers: + type: array + items: + $ref: '#/components/schemas/GamesServersServer' + description: A list of servers for the game associated with the token. + required: + - servers GroupListSuggestedResponse: type: object properties: @@ -10524,99 +10661,6 @@ components: - datacenter_id - cluster_id - vlan_ip - ServersGetServerResponse: - type: object - properties: - server: - $ref: '#/components/schemas/ServersServer' - required: - - server - ServersCreateServerRequest: - type: object - properties: - datacenter: - type: string - description: The name ID of the datacenter - tags: {} - image_id: - type: string - format: uuid - arguments: - type: array - items: - type: string - environment: - type: object - additionalProperties: - type: string - network: - $ref: '#/components/schemas/ServersCreateServerNetworkRequest' - resources: - $ref: '#/components/schemas/ServersResources' - kill_timeout: - type: integer - format: int64 - description: >- - The duration to wait for in milliseconds before killing the server. - This should be set to a safe default, and can be overridden during a - DELETE request if needed. - webhook_url: - type: string - description: A url to send to which events from the server running will be sent - required: - - datacenter - - tags - - image_id - - network - - resources - ServersCreateServerNetworkRequest: - type: object - properties: - mode: - $ref: '#/components/schemas/ServersNetworkMode' - ports: - type: object - additionalProperties: - $ref: '#/components/schemas/ServersCreateServerPortRequest' - required: - - ports - ServersCreateServerPortRequest: - type: object - properties: - protocol: - $ref: '#/components/schemas/ServersPortProtocol' - internal_port: - type: integer - routing: - $ref: '#/components/schemas/ServersPortRouting' - required: - - protocol - ServersCreateServerResponse: - type: object - properties: - server: - $ref: '#/components/schemas/ServersServer' - description: The server that was created - required: - - server - ServersDestroyServerResponse: - type: object - properties: - server_id: - type: string - format: uuid - required: - - server_id - ServersListServersResponse: - type: object - properties: - servers: - type: array - items: - $ref: '#/components/schemas/ServersServer' - description: A list of servers for the game associated with the token. - required: - - servers AdminClustersPoolType: type: string enum: @@ -12964,28 +13008,240 @@ components: GameStatFormatMethod: type: string enum: - - integer - - float_1 - - float_2 - - float_3 - - duration_minute - - duration_second - - duration_hundredth_second - description: A value denoting the format method of a game statistic. - GameStatAggregationMethod: + - integer + - float_1 + - float_2 + - float_3 + - duration_minute + - duration_second + - duration_hundredth_second + description: A value denoting the format method of a game statistic. + GameStatAggregationMethod: + type: string + enum: + - sum + - average + - min + - max + description: A value denoting the aggregation method of a game statistic. + GameStatSortingMethod: + type: string + enum: + - desc + - asc + description: A value denoting the sorting method of a game statistic. + GamesServersListBuildsResponse: + type: object + properties: + builds: + type: array + items: + $ref: '#/components/schemas/CloudBuildSummary' + description: A list of builds for the game associated with the token. + required: + - builds + GamesServersCreateBuildRequest: + type: object + properties: + display_name: + $ref: '#/components/schemas/DisplayName' + tags: {} + image_tag: + type: string + description: A tag given to the game build. + image_file: + $ref: '#/components/schemas/UploadPrepareFile' + multipart_upload: + type: boolean + kind: + $ref: '#/components/schemas/GamesServersBuildKind' + compression: + $ref: '#/components/schemas/GamesServersBuildCompression' + required: + - display_name + - tags + - image_tag + - image_file + GamesServersCreateBuildResponse: + type: object + properties: + build_id: + type: string + format: uuid + upload_id: + type: string + format: uuid + image_presigned_request: + $ref: '#/components/schemas/UploadPresignedRequest' + image_presigned_requests: + type: array + items: + $ref: '#/components/schemas/UploadPresignedRequest' + required: + - build_id + - upload_id + GamesServersBuildKind: + type: string + enum: + - docker_image + - oci_bundle + GamesServersBuildCompression: + type: string + enum: + - none + - lz4 + GamesServersServer: + type: object + properties: + server_id: + type: string + format: uuid + game_id: + type: string + format: uuid + datacenter_id: + type: string + format: uuid + cluster_id: + type: string + format: uuid + tags: {} + image_id: + type: string + format: uuid + arguments: + type: array + items: + type: string + environment: + type: object + additionalProperties: + type: string + network: + $ref: '#/components/schemas/GamesServersNetwork' + resources: + $ref: '#/components/schemas/GamesServersResources' + kill_timeout: + type: integer + format: int64 + description: >- + The duration to wait for in milliseconds before killing the server. + This should be set to a safe default, and can be overridden during a + DELETE request if needed. + create_ts: + type: integer + format: int64 + start_ts: + type: integer + format: int64 + destroy_ts: + type: integer + format: int64 + required: + - server_id + - game_id + - datacenter_id + - cluster_id + - tags + - image_id + - network + - resources + - create_ts + GamesServersResources: + type: object + properties: + cpu: + type: integer + description: >- + The number of CPU cores in millicores, or 1/1000 of a core. For + example, + + 1/8 of a core would be 125 millicores, and 1 core would be 1000 + + millicores. + memory: + type: integer + description: The amount of memory in megabytes + required: + - cpu + - memory + GamesServersNetwork: + type: object + properties: + mode: + $ref: '#/components/schemas/GamesServersNetworkMode' + ports: + type: object + additionalProperties: + $ref: '#/components/schemas/GamesServersPort' + required: + - ports + GamesServersNetworkMode: + type: string + enum: + - bridge + - host + GamesServersPort: + type: object + properties: + protocol: + $ref: '#/components/schemas/GamesServersPortProtocol' + internal_port: + type: integer + public_hostname: + type: string + public_port: + type: integer + routing: + $ref: '#/components/schemas/GamesServersPortRouting' + required: + - protocol + - routing + GamesServersPortProtocol: type: string enum: - - sum - - average - - min - - max - description: A value denoting the aggregation method of a game statistic. - GameStatSortingMethod: + - http + - https + - tcp + - tcp_tls + - udp + GamesServersPortRouting: + type: object + properties: + game_guard: + $ref: '#/components/schemas/GamesServersGameGuardRouting' + host: + $ref: '#/components/schemas/GamesServersHostRouting' + GamesServersGameGuardRouting: + type: object + properties: {} + GamesServersHostRouting: + type: object + properties: {} + GamesServersGetServerLogsResponse: + type: object + properties: + lines: + type: array + items: + type: string + description: Sorted old to new. + timestamps: + type: array + items: + type: string + description: Sorted old to new. + watch: + $ref: '#/components/schemas/WatchResponse' + required: + - lines + - timestamps + - watch + GamesServersLogStream: type: string enum: - - desc - - asc - description: A value denoting the sorting method of a game statistic. + - std_out + - std_err GeoCoord: type: object description: Geographical coordinates for a location on Planet Earth. @@ -14018,218 +14274,6 @@ components: required: - game - watch - ServersListBuildsResponse: - type: object - properties: - builds: - type: array - items: - $ref: '#/components/schemas/CloudBuildSummary' - description: A list of builds for the game associated with the token. - required: - - builds - ServersCreateBuildRequest: - type: object - properties: - display_name: - $ref: '#/components/schemas/DisplayName' - tags: {} - image_tag: - type: string - description: A tag given to the game build. - image_file: - $ref: '#/components/schemas/UploadPrepareFile' - multipart_upload: - type: boolean - kind: - $ref: '#/components/schemas/ServersBuildKind' - compression: - $ref: '#/components/schemas/ServersBuildCompression' - required: - - display_name - - tags - - image_tag - - image_file - ServersCreateBuildResponse: - type: object - properties: - build_id: - type: string - format: uuid - upload_id: - type: string - format: uuid - image_presigned_request: - $ref: '#/components/schemas/UploadPresignedRequest' - image_presigned_requests: - type: array - items: - $ref: '#/components/schemas/UploadPresignedRequest' - required: - - build_id - - upload_id - ServersBuildKind: - type: string - enum: - - docker_image - - oci_bundle - ServersBuildCompression: - type: string - enum: - - none - - lz4 - ServersServer: - type: object - properties: - server_id: - type: string - format: uuid - game_id: - type: string - format: uuid - datacenter_id: - type: string - format: uuid - cluster_id: - type: string - format: uuid - tags: {} - image_id: - type: string - format: uuid - arguments: - type: array - items: - type: string - environment: - type: object - additionalProperties: - type: string - network: - $ref: '#/components/schemas/ServersNetwork' - resources: - $ref: '#/components/schemas/ServersResources' - kill_timeout: - type: integer - format: int64 - description: >- - The duration to wait for in milliseconds before killing the server. - This should be set to a safe default, and can be overridden during a - DELETE request if needed. - create_ts: - type: integer - format: int64 - start_ts: - type: integer - format: int64 - destroy_ts: - type: integer - format: int64 - required: - - server_id - - game_id - - datacenter_id - - cluster_id - - tags - - image_id - - network - - resources - - create_ts - ServersResources: - type: object - properties: - cpu: - type: integer - description: >- - The number of CPU cores in millicores, or 1/1000 of a core. For - example, - - 1/8 of a core would be 125 millicores, and 1 core would be 1000 - - millicores. - memory: - type: integer - description: The amount of memory in megabytes - required: - - cpu - - memory - ServersNetwork: - type: object - properties: - mode: - $ref: '#/components/schemas/ServersNetworkMode' - ports: - type: object - additionalProperties: - $ref: '#/components/schemas/ServersPort' - required: - - ports - ServersNetworkMode: - type: string - enum: - - bridge - - host - ServersPort: - type: object - properties: - protocol: - $ref: '#/components/schemas/ServersPortProtocol' - internal_port: - type: integer - public_hostname: - type: string - public_port: - type: integer - routing: - $ref: '#/components/schemas/ServersPortRouting' - required: - - protocol - - routing - ServersPortProtocol: - type: string - enum: - - http - - https - - tcp - - tcp_tls - - udp - ServersPortRouting: - type: object - properties: - game_guard: - $ref: '#/components/schemas/ServersGameGuardRouting' - host: - $ref: '#/components/schemas/ServersHostRouting' - ServersGameGuardRouting: - type: object - properties: {} - ServersHostRouting: - type: object - properties: {} - ServersGetServerLogsResponse: - type: object - properties: - lines: - type: array - items: - type: string - description: Sorted old to new. - timestamps: - type: array - items: - type: string - description: Sorted old to new. - watch: - $ref: '#/components/schemas/WatchResponse' - required: - - lines - - timestamps - - watch - ServersLogStream: - type: string - enum: - - std_out - - std_err UploadPresignedRequest: type: object description: >- diff --git a/sdks/full/openapi_compat/openapi.yml b/sdks/full/openapi_compat/openapi.yml index 51eb399137..7725b281c8 100644 --- a/sdks/full/openapi_compat/openapi.yml +++ b/sdks/full/openapi_compat/openapi.yml @@ -2928,6 +2928,304 @@ components: - developer - total_player_count type: object + GamesServersBuildCompression: + enum: + - none + - lz4 + type: string + GamesServersBuildKind: + enum: + - docker_image + - oci_bundle + type: string + GamesServersCreateBuildRequest: + properties: + compression: + $ref: '#/components/schemas/GamesServersBuildCompression' + display_name: + $ref: '#/components/schemas/DisplayName' + image_file: + $ref: '#/components/schemas/UploadPrepareFile' + image_tag: + description: A tag given to the game build. + type: string + kind: + $ref: '#/components/schemas/GamesServersBuildKind' + multipart_upload: + type: boolean + tags: {} + required: + - display_name + - tags + - image_tag + - image_file + type: object + GamesServersCreateBuildResponse: + properties: + build_id: + format: uuid + type: string + image_presigned_request: + $ref: '#/components/schemas/UploadPresignedRequest' + image_presigned_requests: + items: + $ref: '#/components/schemas/UploadPresignedRequest' + type: array + upload_id: + format: uuid + type: string + required: + - build_id + - upload_id + type: object + GamesServersCreateServerNetworkRequest: + properties: + mode: + $ref: '#/components/schemas/GamesServersNetworkMode' + ports: + additionalProperties: + $ref: '#/components/schemas/GamesServersCreateServerPortRequest' + type: object + required: + - ports + type: object + GamesServersCreateServerPortRequest: + properties: + internal_port: + type: integer + protocol: + $ref: '#/components/schemas/GamesServersPortProtocol' + routing: + $ref: '#/components/schemas/GamesServersPortRouting' + required: + - protocol + type: object + GamesServersCreateServerRequest: + properties: + arguments: + items: + type: string + type: array + datacenter: + description: The name ID of the datacenter + type: string + environment: + additionalProperties: + type: string + type: object + image_id: + format: uuid + type: string + kill_timeout: + description: The duration to wait for in milliseconds before killing the + server. This should be set to a safe default, and can be overridden during + a DELETE request if needed. + format: int64 + type: integer + network: + $ref: '#/components/schemas/GamesServersCreateServerNetworkRequest' + resources: + $ref: '#/components/schemas/GamesServersResources' + tags: {} + webhook_url: + description: A url to send to which events from the server running will + be sent + type: string + required: + - datacenter + - tags + - image_id + - network + - resources + type: object + GamesServersCreateServerResponse: + properties: + server: + $ref: '#/components/schemas/GamesServersServer' + description: The server that was created + required: + - server + type: object + GamesServersDestroyServerResponse: + properties: {} + type: object + GamesServersGameGuardRouting: + properties: {} + type: object + GamesServersGetServerLogsResponse: + properties: + lines: + description: Sorted old to new. + items: + type: string + type: array + timestamps: + description: Sorted old to new. + items: + type: string + type: array + watch: + $ref: '#/components/schemas/WatchResponse' + required: + - lines + - timestamps + - watch + type: object + GamesServersGetServerResponse: + properties: + server: + $ref: '#/components/schemas/GamesServersServer' + required: + - server + type: object + GamesServersHostRouting: + properties: {} + type: object + GamesServersListBuildsResponse: + properties: + builds: + description: A list of builds for the game associated with the token. + items: + $ref: '#/components/schemas/CloudBuildSummary' + type: array + required: + - builds + type: object + GamesServersListServersResponse: + properties: + servers: + description: A list of servers for the game associated with the token. + items: + $ref: '#/components/schemas/GamesServersServer' + type: array + required: + - servers + type: object + GamesServersLogStream: + enum: + - std_out + - std_err + type: string + GamesServersNetwork: + properties: + mode: + $ref: '#/components/schemas/GamesServersNetworkMode' + ports: + additionalProperties: + $ref: '#/components/schemas/GamesServersPort' + type: object + required: + - ports + type: object + GamesServersNetworkMode: + enum: + - bridge + - host + type: string + GamesServersPort: + properties: + internal_port: + type: integer + protocol: + $ref: '#/components/schemas/GamesServersPortProtocol' + public_hostname: + type: string + public_port: + type: integer + routing: + $ref: '#/components/schemas/GamesServersPortRouting' + required: + - protocol + - routing + type: object + GamesServersPortProtocol: + enum: + - http + - https + - tcp + - tcp_tls + - udp + type: string + GamesServersPortRouting: + properties: + game_guard: + $ref: '#/components/schemas/GamesServersGameGuardRouting' + host: + $ref: '#/components/schemas/GamesServersHostRouting' + type: object + GamesServersResources: + properties: + cpu: + description: 'The number of CPU cores in millicores, or 1/1000 of a core. + For example, + + 1/8 of a core would be 125 millicores, and 1 core would be 1000 + + millicores.' + type: integer + memory: + description: The amount of memory in megabytes + type: integer + required: + - cpu + - memory + type: object + GamesServersServer: + properties: + arguments: + items: + type: string + type: array + cluster_id: + format: uuid + type: string + create_ts: + format: int64 + type: integer + datacenter_id: + format: uuid + type: string + destroy_ts: + format: int64 + type: integer + environment: + additionalProperties: + type: string + type: object + game_id: + format: uuid + type: string + image_id: + format: uuid + type: string + kill_timeout: + description: The duration to wait for in milliseconds before killing the + server. This should be set to a safe default, and can be overridden during + a DELETE request if needed. + format: int64 + type: integer + network: + $ref: '#/components/schemas/GamesServersNetwork' + resources: + $ref: '#/components/schemas/GamesServersResources' + server_id: + format: uuid + type: string + start_ts: + format: int64 + type: integer + tags: {} + required: + - server_id + - game_id + - datacenter_id + - cluster_id + - tags + - image_id + - network + - resources + - create_ts + type: object GeoCoord: description: Geographical coordinates for a location on Planet Earth. properties: @@ -4402,309 +4700,6 @@ components: - cluster_id - vlan_ip type: object - ServersBuildCompression: - enum: - - none - - lz4 - type: string - ServersBuildKind: - enum: - - docker_image - - oci_bundle - type: string - ServersCreateBuildRequest: - properties: - compression: - $ref: '#/components/schemas/ServersBuildCompression' - display_name: - $ref: '#/components/schemas/DisplayName' - image_file: - $ref: '#/components/schemas/UploadPrepareFile' - image_tag: - description: A tag given to the game build. - type: string - kind: - $ref: '#/components/schemas/ServersBuildKind' - multipart_upload: - type: boolean - tags: {} - required: - - display_name - - tags - - image_tag - - image_file - type: object - ServersCreateBuildResponse: - properties: - build_id: - format: uuid - type: string - image_presigned_request: - $ref: '#/components/schemas/UploadPresignedRequest' - image_presigned_requests: - items: - $ref: '#/components/schemas/UploadPresignedRequest' - type: array - upload_id: - format: uuid - type: string - required: - - build_id - - upload_id - type: object - ServersCreateServerNetworkRequest: - properties: - mode: - $ref: '#/components/schemas/ServersNetworkMode' - ports: - additionalProperties: - $ref: '#/components/schemas/ServersCreateServerPortRequest' - type: object - required: - - ports - type: object - ServersCreateServerPortRequest: - properties: - internal_port: - type: integer - protocol: - $ref: '#/components/schemas/ServersPortProtocol' - routing: - $ref: '#/components/schemas/ServersPortRouting' - required: - - protocol - type: object - ServersCreateServerRequest: - properties: - arguments: - items: - type: string - type: array - datacenter: - description: The name ID of the datacenter - type: string - environment: - additionalProperties: - type: string - type: object - image_id: - format: uuid - type: string - kill_timeout: - description: The duration to wait for in milliseconds before killing the - server. This should be set to a safe default, and can be overridden during - a DELETE request if needed. - format: int64 - type: integer - network: - $ref: '#/components/schemas/ServersCreateServerNetworkRequest' - resources: - $ref: '#/components/schemas/ServersResources' - tags: {} - webhook_url: - description: A url to send to which events from the server running will - be sent - type: string - required: - - datacenter - - tags - - image_id - - network - - resources - type: object - ServersCreateServerResponse: - properties: - server: - $ref: '#/components/schemas/ServersServer' - description: The server that was created - required: - - server - type: object - ServersDestroyServerResponse: - properties: - server_id: - format: uuid - type: string - required: - - server_id - type: object - ServersGameGuardRouting: - properties: {} - type: object - ServersGetServerLogsResponse: - properties: - lines: - description: Sorted old to new. - items: - type: string - type: array - timestamps: - description: Sorted old to new. - items: - type: string - type: array - watch: - $ref: '#/components/schemas/WatchResponse' - required: - - lines - - timestamps - - watch - type: object - ServersGetServerResponse: - properties: - server: - $ref: '#/components/schemas/ServersServer' - required: - - server - type: object - ServersHostRouting: - properties: {} - type: object - ServersListBuildsResponse: - properties: - builds: - description: A list of builds for the game associated with the token. - items: - $ref: '#/components/schemas/CloudBuildSummary' - type: array - required: - - builds - type: object - ServersListServersResponse: - properties: - servers: - description: A list of servers for the game associated with the token. - items: - $ref: '#/components/schemas/ServersServer' - type: array - required: - - servers - type: object - ServersLogStream: - enum: - - std_out - - std_err - type: string - ServersNetwork: - properties: - mode: - $ref: '#/components/schemas/ServersNetworkMode' - ports: - additionalProperties: - $ref: '#/components/schemas/ServersPort' - type: object - required: - - ports - type: object - ServersNetworkMode: - enum: - - bridge - - host - type: string - ServersPort: - properties: - internal_port: - type: integer - protocol: - $ref: '#/components/schemas/ServersPortProtocol' - public_hostname: - type: string - public_port: - type: integer - routing: - $ref: '#/components/schemas/ServersPortRouting' - required: - - protocol - - routing - type: object - ServersPortProtocol: - enum: - - http - - https - - tcp - - tcp_tls - - udp - type: string - ServersPortRouting: - properties: - game_guard: - $ref: '#/components/schemas/ServersGameGuardRouting' - host: - $ref: '#/components/schemas/ServersHostRouting' - type: object - ServersResources: - properties: - cpu: - description: 'The number of CPU cores in millicores, or 1/1000 of a core. - For example, - - 1/8 of a core would be 125 millicores, and 1 core would be 1000 - - millicores.' - type: integer - memory: - description: The amount of memory in megabytes - type: integer - required: - - cpu - - memory - type: object - ServersServer: - properties: - arguments: - items: - type: string - type: array - cluster_id: - format: uuid - type: string - create_ts: - format: int64 - type: integer - datacenter_id: - format: uuid - type: string - destroy_ts: - format: int64 - type: integer - environment: - additionalProperties: - type: string - type: object - game_id: - format: uuid - type: string - image_id: - format: uuid - type: string - kill_timeout: - description: The duration to wait for in milliseconds before killing the - server. This should be set to a safe default, and can be overridden during - a DELETE request if needed. - format: int64 - type: integer - network: - $ref: '#/components/schemas/ServersNetwork' - resources: - $ref: '#/components/schemas/ServersResources' - server_id: - format: uuid - type: string - start_ts: - format: int64 - type: integer - tags: {} - required: - - server_id - - game_id - - datacenter_id - - cluster_id - - tags - - image_id - - network - - resources - - create_ts - type: object Timestamp: description: RFC3339 timestamp format: date-time @@ -8901,23 +8896,35 @@ paths: security: *id001 tags: - ProvisionDatacenters - /group/groups: + /games/{game_id}/builds: get: - description: Returns a list of suggested groups. - operationId: group_listSuggested + description: Lists all builds of the game associated with the token used. Can + be filtered by tags in the query string. + operationId: games_servers_builds_listBuilds parameters: - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index + - in: path + name: game_id + required: true + schema: + format: uuid + type: string + - in: query + name: tags required: false schema: type: string + - in: query + name: game_id + required: false + schema: + format: uuid + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupListSuggestedResponse' + $ref: '#/components/schemas/GamesServersListBuildsResponse' description: '' '400': content: @@ -8957,23 +8964,30 @@ paths: description: '' security: *id001 tags: - - Group + - GamesServersBuilds + /games/{game_id}/builds/prepare: post: - description: Creates a new group. - operationId: group_create - parameters: [] + description: Creates a new game build for the given game. + operationId: games_servers_builds_prepareBuild + parameters: + - in: path + name: game_id + required: true + schema: + format: uuid + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupCreateRequest' + $ref: '#/components/schemas/GamesServersCreateBuildRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupCreateResponse' + $ref: '#/components/schemas/GamesServersCreateBuildResponse' description: '' '400': content: @@ -9013,26 +9027,26 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/avatar-upload/prepare: + - GamesServersBuilds + /games/{game_id}/builds/{build_id}/complete: post: - description: 'Prepares an avatar image upload. - - Complete upload with `rivet.api.group#CompleteAvatarUpload`.' - operationId: group_prepareAvatarUpload - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GroupPrepareAvatarUploadRequest' + description: Marks an upload as complete. + operationId: games_servers_builds_completeBuild + parameters: + - in: path + name: game_id + required: true + schema: + format: uuid + type: string + - in: path + name: build_id required: true + schema: + format: uuid + type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GroupPrepareAvatarUploadResponse' + '204': description: '' '400': content: @@ -9072,25 +9086,36 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/profile/validate: - post: - description: Validate contents of group profile. Use to provide immediate feedback - on profile changes before committing them. - operationId: group_validateProfile - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GroupValidateProfileRequest' + - GamesServersBuilds + /games/{game_id}/servers: + get: + description: Lists all servers associated with the token used. Can be filtered + by tags in the query string. + operationId: games_servers_list + parameters: + - in: path + name: game_id required: true + schema: + format: uuid + type: string + - in: query + name: tags + required: false + schema: + type: string + - in: query + name: game_id + required: false + schema: + format: uuid + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupValidateProfileResponse' + $ref: '#/components/schemas/GamesServersListServersResponse' description: '' '400': content: @@ -9130,36 +9155,29 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/search: - get: - description: Fuzzy search for groups. - operationId: group_search + - GamesServers + post: + description: Create a new dynamic server. + operationId: games_servers_create parameters: - - description: The query to match group display names against. - in: query - name: query + - in: path + name: game_id required: true schema: + format: uuid type: string - - in: query - name: anchor - required: false - schema: - type: string - - description: Unsigned 32 bit integer. - in: query - name: limit - required: false - schema: - format: double - type: number + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersCreateServerRequest' + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupSearchResponse' + $ref: '#/components/schemas/GamesServersCreateServerResponse' description: '' '400': content: @@ -9199,31 +9217,40 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/{group_id}/avatar-upload/{upload_id}/complete: - post: - description: 'Completes an avatar image upload. Must be called after the file - upload - - process completes. - - Call `rivet.api.group#PrepareAvatarUpload` first.' - operationId: group_completeAvatarUpload + - GamesServers + /games/{game_id}/servers/{server_id}: + delete: + description: Destroy a dynamic server. + operationId: games_servers_destroy parameters: - in: path - name: group_id + name: game_id required: true schema: format: uuid type: string - - in: path - name: upload_id + - description: The id of the server to destroy + in: path + name: server_id required: true schema: format: uuid type: string + - description: The duration to wait for in milliseconds before killing the server. + This should be used to override the default kill timeout if a faster time + is needed, say for ignoring a graceful shutdown. + in: query + name: override_kill_timeout + required: false + schema: + format: int64 + type: integer responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersDestroyServerResponse' description: '' '400': content: @@ -9263,44 +9290,30 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/{group_id}/bans: + - GamesServers get: - description: Returns a group's bans. Must have valid permissions to view. - operationId: group_getBans + description: Gets a dynamic server. + operationId: games_servers_get parameters: - in: path - name: group_id + name: game_id required: true schema: format: uuid type: string - - description: The pagination anchor. Set to the returned anchor of this endpoint - to receive the next set of items. - in: query - name: anchor - required: false - schema: - type: string - - description: Amount of bans to return. - in: query - name: count - required: false - schema: - format: double - type: number - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false + - description: The id of the server to destroy + in: path + name: server_id + required: true schema: + format: uuid type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupGetBansResponse' + $ref: '#/components/schemas/GamesServersGetServerResponse' description: '' '400': content: @@ -9340,27 +9353,47 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/{group_id}/bans/{identity_id}: - delete: - description: Unbans an identity from a group. Must be the owner of the group - to perform this action. - operationId: group_unbanIdentity + - GamesServers + /games/{game_id}/servers/{server_id}/logs: + get: + description: Returns the logs for a given server. + operationId: games_servers_logs_getServerLogs parameters: - in: path - name: group_id + name: game_id required: true schema: format: uuid type: string - in: path - name: identity_id + name: server_id + required: true + schema: + format: uuid + type: string + - in: query + name: stream required: true + schema: + $ref: '#/components/schemas/GamesServersLogStream' + - in: query + name: game_id + required: false schema: format: uuid type: string + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false + schema: + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GamesServersGetServerLogsResponse' description: '' '400': content: @@ -9400,27 +9433,24 @@ paths: description: '' security: *id001 tags: - - Group - post: - description: Bans an identity from a group. Must be the owner of the group to - perform this action. The banned identity will no longer be able to create - a join request or use a group invite. - operationId: group_banIdentity + - GamesServersLogs + /group/groups: + get: + description: Returns a list of suggested groups. + operationId: group_listSuggested parameters: - - in: path - name: group_id - required: true - schema: - format: uuid - type: string - - in: path - name: identity_id - required: true + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false schema: - format: uuid type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListSuggestedResponse' description: '' '400': content: @@ -9461,30 +9491,22 @@ paths: security: *id001 tags: - Group - /group/groups/{group_id}/invites: post: - description: Creates a group invite. Can be shared with other identities to - let them join this group. - operationId: group_invites_createInvite - parameters: - - in: path - name: group_id - required: true - schema: - format: uuid - type: string + description: Creates a new group. + operationId: group_create + parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupCreateInviteRequest' + $ref: '#/components/schemas/GroupCreateRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupCreateInviteResponse' + $ref: '#/components/schemas/GroupCreateResponse' description: '' '400': content: @@ -9524,20 +9546,26 @@ paths: description: '' security: *id001 tags: - - GroupInvites - /group/groups/{group_id}/join-request: + - Group + /group/groups/avatar-upload/prepare: post: - description: Requests to join a group. - operationId: group_joinRequests_createJoinRequest - parameters: - - in: path - name: group_id + description: 'Prepares an avatar image upload. + + Complete upload with `rivet.api.group#CompleteAvatarUpload`.' + operationId: group_prepareAvatarUpload + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupPrepareAvatarUploadRequest' required: true - schema: - format: uuid - type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupPrepareAvatarUploadResponse' description: '' '400': content: @@ -9577,32 +9605,25 @@ paths: description: '' security: *id001 tags: - - GroupJoinRequests - /group/groups/{group_id}/join-request/{identity_id}: + - Group + /group/groups/profile/validate: post: - description: Resolves a join request for a given group. - operationId: group_joinRequests_resolveJoinRequest - parameters: - - in: path - name: group_id - required: true - schema: - format: uuid - type: string - - in: path - name: identity_id - required: true - schema: - format: uuid - type: string + description: Validate contents of group profile. Use to provide immediate feedback + on profile changes before committing them. + operationId: group_validateProfile + parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupResolveJoinRequestRequest' + $ref: '#/components/schemas/GroupValidateProfileRequest' required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupValidateProfileResponse' description: '' '400': content: @@ -9642,45 +9663,36 @@ paths: description: '' security: *id001 tags: - - GroupJoinRequests - /group/groups/{group_id}/join-requests: + - Group + /group/groups/search: get: - description: Returns a group's join requests. Must have valid permissions to - view. - operationId: group_getJoinRequests - parameters: - - in: path - name: group_id + description: Fuzzy search for groups. + operationId: group_search + parameters: + - description: The query to match group display names against. + in: query + name: query required: true schema: - format: uuid type: string - - description: The pagination anchor. Set to the returned anchor of this endpoint - to receive the next set of items. - in: query + - in: query name: anchor required: false schema: type: string - - description: Amount of join requests to return. + - description: Unsigned 32 bit integer. in: query - name: count + name: limit required: false schema: format: double type: number - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false - schema: - type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/GroupGetJoinRequestsResponse' + $ref: '#/components/schemas/GroupSearchResponse' description: '' '400': content: @@ -9721,11 +9733,15 @@ paths: security: *id001 tags: - Group - /group/groups/{group_id}/kick/{identity_id}: + /group/groups/{group_id}/avatar-upload/{upload_id}/complete: post: - description: Kicks an identity from a group. Must be the owner of the group - to perform this action. - operationId: group_kickMember + description: 'Completes an avatar image upload. Must be called after the file + upload + + process completes. + + Call `rivet.api.group#PrepareAvatarUpload` first.' + operationId: group_completeAvatarUpload parameters: - in: path name: group_id @@ -9734,7 +9750,7 @@ paths: format: uuid type: string - in: path - name: identity_id + name: upload_id required: true schema: format: uuid @@ -9781,10 +9797,10 @@ paths: security: *id001 tags: - Group - /group/groups/{group_id}/leave: - post: - description: Leaves a group. - operationId: group_leave + /group/groups/{group_id}/bans: + get: + description: Returns a group's bans. Must have valid permissions to view. + operationId: group_getBans parameters: - in: path name: group_id @@ -9792,8 +9808,32 @@ paths: schema: format: uuid type: string + - description: The pagination anchor. Set to the returned anchor of this endpoint + to receive the next set of items. + in: query + name: anchor + required: false + schema: + type: string + - description: Amount of bans to return. + in: query + name: count + required: false + schema: + format: double + type: number + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false + schema: + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupGetBansResponse' description: '' '400': content: @@ -9834,10 +9874,11 @@ paths: security: *id001 tags: - Group - /group/groups/{group_id}/members: - get: - description: Returns a group's members. - operationId: group_getMembers + /group/groups/{group_id}/bans/{identity_id}: + delete: + description: Unbans an identity from a group. Must be the owner of the group + to perform this action. + operationId: group_unbanIdentity parameters: - in: path name: group_id @@ -9845,32 +9886,14 @@ paths: schema: format: uuid type: string - - description: The pagination anchor. Set to the returned anchor of this endpoint - to receive the next set of items. - in: query - name: anchor - required: false - schema: - type: string - - description: Amount of members to return. - in: query - name: count - required: false - schema: - format: double - type: number - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false + - in: path + name: identity_id + required: true schema: + format: uuid type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GroupGetMembersResponse' + '204': description: '' '400': content: @@ -9911,10 +9934,11 @@ paths: security: *id001 tags: - Group - /group/groups/{group_id}/profile: - get: - description: Returns a group profile. - operationId: group_getProfile + post: + description: Bans an identity from a group. Must be the owner of the group to + perform this action. The banned identity will no longer be able to create + a join request or use a group invite. + operationId: group_banIdentity parameters: - in: path name: group_id @@ -9922,18 +9946,14 @@ paths: schema: format: uuid type: string - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false + - in: path + name: identity_id + required: true schema: + format: uuid type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GroupGetProfileResponse' + '204': description: '' '400': content: @@ -9974,8 +9994,11 @@ paths: security: *id001 tags: - Group + /group/groups/{group_id}/invites: post: - operationId: group_updateProfile + description: Creates a group invite. Can be shared with other identities to + let them join this group. + operationId: group_invites_createInvite parameters: - in: path name: group_id @@ -9987,10 +10010,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GroupUpdateProfileRequest' + $ref: '#/components/schemas/GroupCreateInviteRequest' required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupCreateInviteResponse' description: '' '400': content: @@ -10030,10 +10057,11 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/{group_id}/summary: - get: - operationId: group_getSummary + - GroupInvites + /group/groups/{group_id}/join-request: + post: + description: Requests to join a group. + operationId: group_joinRequests_createJoinRequest parameters: - in: path name: group_id @@ -10042,11 +10070,7 @@ paths: format: uuid type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GroupGetSummaryResponse' + '204': description: '' '400': content: @@ -10086,11 +10110,11 @@ paths: description: '' security: *id001 tags: - - Group - /group/groups/{group_id}/transfer-owner: + - GroupJoinRequests + /group/groups/{group_id}/join-request/{identity_id}: post: - description: Transfers ownership of a group to another identity. - operationId: group_transferOwnership + description: Resolves a join request for a given group. + operationId: group_joinRequests_resolveJoinRequest parameters: - in: path name: group_id @@ -10098,11 +10122,17 @@ paths: schema: format: uuid type: string + - in: path + name: identity_id + required: true + schema: + format: uuid + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupTransferOwnershipRequest' + $ref: '#/components/schemas/GroupResolveJoinRequestRequest' required: true responses: '204': @@ -10145,17 +10175,37 @@ paths: description: '' security: *id001 tags: - - Group - /group/invites/{group_invite_code}: + - GroupJoinRequests + /group/groups/{group_id}/join-requests: get: - description: Inspects a group invite returning information about the team that - created it. - operationId: group_invites_getInvite + description: Returns a group's join requests. Must have valid permissions to + view. + operationId: group_getJoinRequests parameters: - - description: Provided by `rivet.api.group#CreateInviteResponse$code`. - in: path - name: group_invite_code + - in: path + name: group_id required: true + schema: + format: uuid + type: string + - description: The pagination anchor. Set to the returned anchor of this endpoint + to receive the next set of items. + in: query + name: anchor + required: false + schema: + type: string + - description: Amount of join requests to return. + in: query + name: count + required: false + schema: + format: double + type: number + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false schema: type: string responses: @@ -10163,7 +10213,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GroupGetInviteResponse' + $ref: '#/components/schemas/GroupGetJoinRequestsResponse' description: '' '400': content: @@ -10203,24 +10253,27 @@ paths: description: '' security: *id001 tags: - - GroupInvites - /group/invites/{group_invite_code}/consume: + - Group + /group/groups/{group_id}/kick/{identity_id}: post: - description: Consumes a group invite to join a group. - operationId: group_invites_consumeInvite + description: Kicks an identity from a group. Must be the owner of the group + to perform this action. + operationId: group_kickMember parameters: - - description: Provided by `rivet.api.group#CreateInviteResponse$code`. - in: path - name: group_invite_code + - in: path + name: group_id + required: true + schema: + format: uuid + type: string + - in: path + name: identity_id required: true schema: + format: uuid type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GroupConsumeInviteResponse' + '204': description: '' '400': content: @@ -10260,23 +10313,20 @@ paths: description: '' security: *id001 tags: - - GroupInvites - /identity/activities: - get: - description: Returns an overview of all players currently online or in game. - operationId: identity_activities_list + - Group + /group/groups/{group_id}/leave: + post: + description: Leaves a group. + operationId: group_leave parameters: - - in: query - name: watch_index - required: false + - in: path + name: group_id + required: true schema: - $ref: '#/components/schemas/WatchQuery' + format: uuid + type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityListActivitiesResponse' + '204': description: '' '400': content: @@ -10316,23 +10366,44 @@ paths: description: '' security: *id001 tags: - - IdentityActivities - /identity/events/live: + - Group + /group/groups/{group_id}/members: get: - description: Returns all events relative to the current identity. - operationId: identity_events_watch + description: Returns a group's members. + operationId: group_getMembers parameters: - - in: query + - in: path + name: group_id + required: true + schema: + format: uuid + type: string + - description: The pagination anchor. Set to the returned anchor of this endpoint + to receive the next set of items. + in: query + name: anchor + required: false + schema: + type: string + - description: Amount of members to return. + in: query + name: count + required: false + schema: + format: double + type: number + - description: A query parameter denoting the requests watch index. + in: query name: watch_index required: false schema: - $ref: '#/components/schemas/WatchQuery' + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityWatchEventsResponse' + $ref: '#/components/schemas/GroupGetMembersResponse' description: '' '400': content: @@ -10372,30 +10443,30 @@ paths: description: '' security: *id001 tags: - - IdentityEvents - /identity/game-links: + - Group + /group/groups/{group_id}/profile: get: - description: Returns the current status of a linking process. Once `status` - is `complete`, the identity's profile should be fetched again since they may - have switched accounts. - operationId: identity_links_get + description: Returns a group profile. + operationId: group_getProfile parameters: - - in: query - name: identity_link_token + - in: path + name: group_id required: true schema: - $ref: '#/components/schemas/Jwt' - - in: query + format: uuid + type: string + - description: A query parameter denoting the requests watch index. + in: query name: watch_index required: false schema: - $ref: '#/components/schemas/WatchQuery' + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityGetGameLinkResponse' + $ref: '#/components/schemas/GroupGetProfileResponse' description: '' '400': content: @@ -10435,47 +10506,24 @@ paths: description: '' security: *id001 tags: - - IdentityLinks + - Group post: - description: 'Begins the process for linking an identity with the Rivet Hub. - - - # Importance of Linking Identities - - - When an identity is created via `rivet.api.identity#SetupIdentity`, the identity - is temporary - - and is not shared with other games the user plays. - - In order to make the identity permanent and synchronize the identity with - - other games, the identity must be linked with the hub. - - - # Linking Process - - - The linking process works by opening `identity_link_url` in a browser then - polling - - `rivet.api.identity#GetGameLink` to wait for it to complete. - - This is designed to be as flexible as possible so `identity_link_url` can - be opened - - on any device. For example, when playing a console game, the user can scan - a - - QR code for `identity_link_url` to authenticate on their phone.' - operationId: identity_links_prepare - parameters: [] + operationId: group_updateProfile + parameters: + - in: path + name: group_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupUpdateProfileRequest' + required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityPrepareGameLinkResponse' + '204': description: '' '400': content: @@ -10515,20 +10563,23 @@ paths: description: '' security: *id001 tags: - - IdentityLinks - /identity/game-links/cancel: - post: - description: Cancels a game link. It can no longer be used to link after cancellation. - operationId: identity_links_cancel - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityCancelGameLinkRequest' + - Group + /group/groups/{group_id}/summary: + get: + operationId: group_getSummary + parameters: + - in: path + name: group_id required: true + schema: + format: uuid + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GroupGetSummaryResponse' description: '' '400': content: @@ -10568,18 +10619,23 @@ paths: description: '' security: *id001 tags: - - IdentityLinks - /identity/game-links/complete: + - Group + /group/groups/{group_id}/transfer-owner: post: - description: Completes a game link process and returns whether or not the link - is valid. - operationId: identity_links_complete - parameters: [] + description: Transfers ownership of a group to another identity. + operationId: group_transferOwnership + parameters: + - in: path + name: group_id + required: true + schema: + format: uuid + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/IdentityCompleteGameLinkRequest' + $ref: '#/components/schemas/GroupTransferOwnershipRequest' required: true responses: '204': @@ -10622,44 +10678,25 @@ paths: description: '' security: *id001 tags: - - IdentityLinks - /identity/identities: - post: - description: 'Gets or creates an identity. - - Passing an existing identity token in the body refreshes the token. - - Temporary Accounts - - Until the identity is linked with the Rivet Hub (see `PrepareGameLink`), this - identity will be temporary but still behave like all other identities. - - This is intended to allow users to play the game without signing up while - still having the benefits of having an account. When they are ready to save - their account, they should be instructed to link their account (see `PrepareGameLink`). - - Storing Token - - `identity_token` should be stored in some form of persistent storage. The - token should be read from storage and passed to `Setup` every time the client - starts.' - operationId: identity_setup - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - existing_identity_token: - $ref: '#/components/schemas/Jwt' - type: object + - Group + /group/invites/{group_invite_code}: + get: + description: Inspects a group invite returning information about the team that + created it. + operationId: group_invites_getInvite + parameters: + - description: Provided by `rivet.api.group#CreateInviteResponse$code`. + in: path + name: group_invite_code required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentitySetupResponse' + $ref: '#/components/schemas/GroupGetInviteResponse' description: '' '400': content: @@ -10699,37 +10736,24 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/avatar-upload/prepare: + - GroupInvites + /group/invites/{group_invite_code}/consume: post: - description: Prepares an avatar image upload. Complete upload with `CompleteIdentityAvatarUpload`. - operationId: identity_prepareAvatarUpload - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - content_length: - format: int64 - type: integer - mime: - description: See https://www.iana.org/assignments/media-types/media-types.xhtml - type: string - path: - type: string - required: - - path - - mime - - content_length - type: object + description: Consumes a group invite to join a group. + operationId: group_invites_consumeInvite + parameters: + - description: Provided by `rivet.api.group#CreateInviteResponse$code`. + in: path + name: group_invite_code required: true + schema: + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityPrepareAvatarUploadResponse' + $ref: '#/components/schemas/GroupConsumeInviteResponse' description: '' '400': content: @@ -10766,24 +10790,26 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorBody' - description: '' - security: *id001 - tags: - - Identity - /identity/identities/avatar-upload/{upload_id}/complete: - post: - description: Completes an avatar image upload. Must be called after the file - upload process completes. - operationId: identity_completeAvatarUpload + description: '' + security: *id001 + tags: + - GroupInvites + /identity/activities: + get: + description: Returns an overview of all players currently online or in game. + operationId: identity_activities_list parameters: - - in: path - name: upload_id - required: true + - in: query + name: watch_index + required: false schema: - format: uuid - type: string + $ref: '#/components/schemas/WatchQuery' responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityListActivitiesResponse' description: '' '400': content: @@ -10823,23 +10849,23 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/batch/handle: + - IdentityActivities + /identity/events/live: get: - description: Fetches a list of identity handles. - operationId: identity_getHandles + description: Returns all events relative to the current identity. + operationId: identity_events_watch parameters: - in: query - name: identity_ids - required: true + name: watch_index + required: false schema: - type: string + $ref: '#/components/schemas/WatchQuery' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityGetHandlesResponse' + $ref: '#/components/schemas/IdentityWatchEventsResponse' description: '' '400': content: @@ -10879,23 +10905,30 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/batch/summary: + - IdentityEvents + /identity/game-links: get: - description: Fetches a list of identity summaries. - operationId: identity_getSummaries + description: Returns the current status of a linking process. Once `status` + is `complete`, the identity's profile should be fetched again since they may + have switched accounts. + operationId: identity_links_get parameters: - in: query - name: identity_ids + name: identity_link_token required: true schema: - type: string + $ref: '#/components/schemas/Jwt' + - in: query + name: watch_index + required: false + schema: + $ref: '#/components/schemas/WatchQuery' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityGetSummariesResponse' + $ref: '#/components/schemas/IdentityGetGameLinkResponse' description: '' '400': content: @@ -10935,25 +10968,47 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/identities/self/status: + - IdentityLinks post: - description: Updates the current identity's status. - operationId: identity_updateStatus + description: 'Begins the process for linking an identity with the Rivet Hub. + + + # Importance of Linking Identities + + + When an identity is created via `rivet.api.identity#SetupIdentity`, the identity + is temporary + + and is not shared with other games the user plays. + + In order to make the identity permanent and synchronize the identity with + + other games, the identity must be linked with the hub. + + + # Linking Process + + + The linking process works by opening `identity_link_url` in a browser then + polling + + `rivet.api.identity#GetGameLink` to wait for it to complete. + + This is designed to be as flexible as possible so `identity_link_url` can + be opened + + on any device. For example, when playing a console game, the user can scan + a + + QR code for `identity_link_url` to authenticate on their phone.' + operationId: identity_links_prepare parameters: [] - requestBody: - content: - application/json: - schema: - properties: - status: - $ref: '#/components/schemas/IdentityStatus' - required: - - status - type: object - required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityPrepareGameLinkResponse' description: '' '400': content: @@ -10993,37 +11048,20 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/search: - get: - description: Fuzzy search for identities. - operationId: identity_search - parameters: - - description: The query to match identity display names and account numbers - against. - in: query - name: query + - IdentityLinks + /identity/game-links/cancel: + post: + description: Cancels a game link. It can no longer be used to link after cancellation. + operationId: identity_links_cancel + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityCancelGameLinkRequest' required: true - schema: - type: string - - description: How many identities to offset the search by. - in: query - name: anchor - required: false - schema: - type: string - - description: Amount of identities to return. Must be between 1 and 32 inclusive. - in: query - name: limit - required: false - schema: - type: integer responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentitySearchResponse' + '204': description: '' '400': content: @@ -11063,12 +11101,19 @@ paths: description: '' security: *id001 tags: - - Identity - /identity/identities/self/activity: - delete: - description: Removes the current identity's game activity. - operationId: identity_removeGameActivity + - IdentityLinks + /identity/game-links/complete: + post: + description: Completes a game link process and returns whether or not the link + is valid. + operationId: identity_links_complete parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityCompleteGameLinkRequest' + required: true responses: '204': description: '' @@ -11110,25 +11155,44 @@ paths: description: '' security: *id001 tags: - - Identity + - IdentityLinks + /identity/identities: post: - description: Sets the current identity's game activity. This activity will automatically - be removed when the identity goes offline. - operationId: identity_setGameActivity + description: 'Gets or creates an identity. + + Passing an existing identity token in the body refreshes the token. + + Temporary Accounts + + Until the identity is linked with the Rivet Hub (see `PrepareGameLink`), this + identity will be temporary but still behave like all other identities. + + This is intended to allow users to play the game without signing up while + still having the benefits of having an account. When they are ready to save + their account, they should be instructed to link their account (see `PrepareGameLink`). + + Storing Token + + `identity_token` should be stored in some form of persistent storage. The + token should be read from storage and passed to `Setup` every time the client + starts.' + operationId: identity_setup parameters: [] requestBody: content: application/json: schema: properties: - game_activity: - $ref: '#/components/schemas/IdentityUpdateGameActivity' - required: - - game_activity + existing_identity_token: + $ref: '#/components/schemas/Jwt' type: object required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentitySetupResponse' description: '' '400': content: @@ -11169,36 +11233,36 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/beta-signup: + /identity/identities/avatar-upload/prepare: post: - description: Completes an avatar image upload. Must be called after the file - upload process completes. - operationId: identity_signupForBeta + description: Prepares an avatar image upload. Complete upload with `CompleteIdentityAvatarUpload`. + operationId: identity_prepareAvatarUpload parameters: [] requestBody: content: application/json: schema: properties: - company_name: - type: string - company_size: - type: string - goals: - type: string - name: + content_length: + format: int64 + type: integer + mime: + description: See https://www.iana.org/assignments/media-types/media-types.xhtml type: string - preferred_tools: + path: type: string required: - - name - - company_size - - preferred_tools - - goals + - path + - mime + - content_length type: object required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityPrepareAvatarUploadResponse' description: '' '400': content: @@ -11239,10 +11303,18 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/delete-request: - delete: - operationId: identity_unmarkDeletion - parameters: [] + /identity/identities/avatar-upload/{upload_id}/complete: + post: + description: Completes an avatar image upload. Must be called after the file + upload process completes. + operationId: identity_completeAvatarUpload + parameters: + - in: path + name: upload_id + required: true + schema: + format: uuid + type: string responses: '204': description: '' @@ -11285,11 +11357,22 @@ paths: security: *id001 tags: - Identity - post: - operationId: identity_markDeletion - parameters: [] + /identity/identities/batch/handle: + get: + description: Fetches a list of identity handles. + operationId: identity_getHandles + parameters: + - in: query + name: identity_ids + required: true + schema: + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityGetHandlesResponse' description: '' '400': content: @@ -11330,19 +11413,14 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/friends: + /identity/identities/batch/summary: get: - operationId: identity_listFriends + description: Fetches a list of identity summaries. + operationId: identity_getSummaries parameters: - in: query - name: anchor - required: false - schema: - type: string - - description: Range is between 1 and 32 (inclusive). - in: query - name: limit - required: false + name: identity_ids + required: true schema: type: string responses: @@ -11350,7 +11428,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/IdentityListFriendsResponse' + $ref: '#/components/schemas/IdentityGetSummariesResponse' description: '' '400': content: @@ -11391,22 +11469,24 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/profile: - get: - description: Fetches the current identity's profile. - operationId: identity_getSelfProfile - parameters: - - in: query - name: watch_index - required: false - schema: - $ref: '#/components/schemas/WatchQuery' + /identity/identities/identities/self/status: + post: + description: Updates the current identity's status. + operationId: identity_updateStatus + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + status: + $ref: '#/components/schemas/IdentityStatus' + required: + - status + type: object + required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityGetProfileResponse' + '204': description: '' '400': content: @@ -11447,25 +11527,36 @@ paths: security: *id001 tags: - Identity - post: - description: Updates profile of the current identity. - operationId: identity_updateProfile - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - account_number: - $ref: '#/components/schemas/AccountNumber' - bio: - $ref: '#/components/schemas/Bio' - display_name: - $ref: '#/components/schemas/DisplayName' - type: object + /identity/identities/search: + get: + description: Fuzzy search for identities. + operationId: identity_search + parameters: + - description: The query to match identity display names and account numbers + against. + in: query + name: query required: true + schema: + type: string + - description: How many identities to offset the search by. + in: query + name: anchor + required: false + schema: + type: string + - description: Amount of identities to return. Must be between 1 and 32 inclusive. + in: query + name: limit + required: false + schema: + type: integer responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentitySearchResponse' description: '' '400': content: @@ -11506,25 +11597,11 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/profile/validate: - post: - description: Validate contents of identity profile. Use to provide immediate - feedback on profile changes before committing them. - operationId: identity_validateProfile + /identity/identities/self/activity: + delete: + description: Removes the current identity's game activity. + operationId: identity_removeGameActivity parameters: [] - requestBody: - content: - application/json: - schema: - properties: - account_number: - $ref: '#/components/schemas/AccountNumber' - bio: - $ref: '#/components/schemas/Bio' - display_name: - $ref: '#/components/schemas/DisplayName' - type: object - required: true responses: '204': description: '' @@ -11567,26 +11644,24 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/recent-followers: - get: - operationId: identity_listRecentFollowers - parameters: - - in: query - name: count - required: false - schema: - type: integer - - in: query - name: watch_index - required: false - schema: - $ref: '#/components/schemas/WatchQuery' + post: + description: Sets the current identity's game activity. This activity will automatically + be removed when the identity goes offline. + operationId: identity_setGameActivity + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + game_activity: + $ref: '#/components/schemas/IdentityUpdateGameActivity' + required: + - game_activity + type: object + required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityListRecentFollowersResponse' + '204': description: '' '400': content: @@ -11627,16 +11702,34 @@ paths: security: *id001 tags: - Identity - /identity/identities/self/recent-followers/{identity_id}/ignore: + /identity/identities/self/beta-signup: post: - operationId: identity_ignoreRecentFollower - parameters: - - in: path - name: identity_id + description: Completes an avatar image upload. Must be called after the file + upload process completes. + operationId: identity_signupForBeta + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + company_name: + type: string + company_size: + type: string + goals: + type: string + name: + type: string + preferred_tools: + type: string + required: + - name + - company_size + - preferred_tools + - goals + type: object required: true - schema: - format: uuid - type: string responses: '204': description: '' @@ -11679,17 +11772,10 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/follow: + /identity/identities/self/delete-request: delete: - description: Unfollows the given identity. - operationId: identity_unfollow - parameters: - - in: path - name: identity_id - required: true - schema: - format: uuid - type: string + operationId: identity_unmarkDeletion + parameters: [] responses: '204': description: '' @@ -11733,16 +11819,8 @@ paths: tags: - Identity post: - description: Follows the given identity. In order for identities to be "friends", - the other identity has to also follow this identity. - operationId: identity_follow - parameters: - - in: path - name: identity_id - required: true - schema: - format: uuid - type: string + operationId: identity_markDeletion + parameters: [] responses: '204': description: '' @@ -11785,16 +11863,10 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/followers: + /identity/identities/self/friends: get: - operationId: identity_listFollowers + operationId: identity_listFriends parameters: - - in: path - name: identity_id - required: true - schema: - format: uuid - type: string - in: query name: anchor required: false @@ -11811,7 +11883,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/IdentityListFollowersResponse' + $ref: '#/components/schemas/IdentityListFriendsResponse' description: '' '400': content: @@ -11852,33 +11924,22 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/following: + /identity/identities/self/profile: get: - operationId: identity_listFollowing - parameters: - - in: path - name: identity_id - required: true - schema: - format: uuid - type: string + description: Fetches the current identity's profile. + operationId: identity_getSelfProfile + parameters: - in: query - name: anchor - required: false - schema: - type: string - - description: Range is between 1 and 32 (inclusive). - in: query - name: limit + name: watch_index required: false schema: - type: string + $ref: '#/components/schemas/WatchQuery' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IdentityListFollowingResponse' + $ref: '#/components/schemas/IdentityGetProfileResponse' description: '' '400': content: @@ -11919,33 +11980,25 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/mutual-friends: - get: - operationId: identity_listMutualFriends - parameters: - - in: path - name: identity_id + post: + description: Updates profile of the current identity. + operationId: identity_updateProfile + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + account_number: + $ref: '#/components/schemas/AccountNumber' + bio: + $ref: '#/components/schemas/Bio' + display_name: + $ref: '#/components/schemas/DisplayName' + type: object required: true - schema: - format: uuid - type: string - - in: query - name: anchor - required: false - schema: - type: string - - description: Range is between 1 and 32 (inclusive). - in: query - name: limit - required: false - schema: - type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityListMutualFriendsResponse' + '204': description: '' '400': content: @@ -11986,28 +12039,27 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/profile: - get: - description: Fetches an identity profile. - operationId: identity_getProfile - parameters: - - in: path - name: identity_id + /identity/identities/self/profile/validate: + post: + description: Validate contents of identity profile. Use to provide immediate + feedback on profile changes before committing them. + operationId: identity_validateProfile + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + account_number: + $ref: '#/components/schemas/AccountNumber' + bio: + $ref: '#/components/schemas/Bio' + display_name: + $ref: '#/components/schemas/DisplayName' + type: object required: true - schema: - format: uuid - type: string - - in: query - name: watch_index - required: false - schema: - $ref: '#/components/schemas/WatchQuery' responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IdentityGetProfileResponse' + '204': description: '' '400': content: @@ -12048,28 +12100,26 @@ paths: security: *id001 tags: - Identity - /identity/identities/{identity_id}/report: - post: - description: Creates an abuse report for an identity. - operationId: identity_report + /identity/identities/self/recent-followers: + get: + operationId: identity_listRecentFollowers parameters: - - in: path - name: identity_id - required: true + - in: query + name: count + required: false schema: - format: uuid - type: string - requestBody: - content: - application/json: - schema: - properties: - reason: - type: string - type: object - required: true + type: integer + - in: query + name: watch_index + required: false + schema: + $ref: '#/components/schemas/WatchQuery' responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityListRecentFollowersResponse' description: '' '400': content: @@ -12110,10 +12160,16 @@ paths: security: *id001 tags: - Identity - /job/runs/cleanup: + /identity/identities/self/recent-followers/{identity_id}/ignore: post: - operationId: job_run_cleanup - parameters: [] + operationId: identity_ignoreRecentFollower + parameters: + - in: path + name: identity_id + required: true + schema: + format: uuid + type: string responses: '204': description: '' @@ -12155,20 +12211,15 @@ paths: description: '' security: *id001 tags: - - JobRun - /kv/entries: + - Identity + /identity/identities/{identity_id}/follow: delete: - description: Deletes a key-value entry by key. - operationId: kv_delete + description: Unfollows the given identity. + operationId: identity_unfollow parameters: - - in: query - name: key + - in: path + name: identity_id required: true - schema: - $ref: '#/components/schemas/KvKey' - - in: query - name: namespace_id - required: false schema: format: uuid type: string @@ -12213,34 +12264,20 @@ paths: description: '' security: *id001 tags: - - Kv - get: - description: Returns a specific key-value entry by key. - operationId: kv_get + - Identity + post: + description: Follows the given identity. In order for identities to be "friends", + the other identity has to also follow this identity. + operationId: identity_follow parameters: - - in: query - name: key + - in: path + name: identity_id required: true - schema: - $ref: '#/components/schemas/KvKey' - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false - schema: - type: string - - in: query - name: namespace_id - required: false schema: format: uuid type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KvGetResponse' + '204': description: '' '400': content: @@ -12280,19 +12317,34 @@ paths: description: '' security: *id001 tags: - - Kv - put: - description: Puts (sets or overwrites) a key-value entry by key. - operationId: kv_put - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KvPutRequest' + - Identity + /identity/identities/{identity_id}/followers: + get: + operationId: identity_listFollowers + parameters: + - in: path + name: identity_id required: true + schema: + format: uuid + type: string + - in: query + name: anchor + required: false + schema: + type: string + - description: Range is between 1 and 32 (inclusive). + in: query + name: limit + required: false + schema: + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityListFollowersResponse' description: '' '400': content: @@ -12332,25 +12384,34 @@ paths: description: '' security: *id001 tags: - - Kv - /kv/entries/batch: - delete: - description: Deletes multiple key-value entries by key(s). - operationId: kv_deleteBatch + - Identity + /identity/identities/{identity_id}/following: + get: + operationId: identity_listFollowing parameters: - - in: query - name: keys + - in: path + name: identity_id required: true schema: - $ref: '#/components/schemas/KvKey' + format: uuid + type: string - in: query - name: namespace_id + name: anchor + required: false + schema: + type: string + - description: Range is between 1 and 32 (inclusive). + in: query + name: limit required: false schema: - format: uuid type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityListFollowingResponse' description: '' '400': content: @@ -12390,34 +12451,34 @@ paths: description: '' security: *id001 tags: - - Kv + - Identity + /identity/identities/{identity_id}/mutual-friends: get: - description: Gets multiple key-value entries by key(s). - operationId: kv_getBatch + operationId: identity_listMutualFriends parameters: - - in: query - name: keys + - in: path + name: identity_id required: true schema: - $ref: '#/components/schemas/KvKey' - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index + format: uuid + type: string + - in: query + name: anchor required: false schema: type: string - - in: query - name: namespace_id + - description: Range is between 1 and 32 (inclusive). + in: query + name: limit required: false schema: - format: uuid type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/KvGetBatchResponse' + $ref: '#/components/schemas/IdentityListMutualFriendsResponse' description: '' '400': content: @@ -12457,19 +12518,29 @@ paths: description: '' security: *id001 tags: - - Kv - put: - description: Puts (sets or overwrites) multiple key-value entries by key(s). - operationId: kv_putBatch - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KvPutBatchRequest' + - Identity + /identity/identities/{identity_id}/profile: + get: + description: Fetches an identity profile. + operationId: identity_getProfile + parameters: + - in: path + name: identity_id required: true + schema: + format: uuid + type: string + - in: query + name: watch_index + required: false + schema: + $ref: '#/components/schemas/WatchQuery' responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityGetProfileResponse' description: '' '400': content: @@ -12509,29 +12580,29 @@ paths: description: '' security: *id001 tags: - - Kv - /kv/entries/list: - get: - description: Lists all keys in a directory. - operationId: kv_list + - Identity + /identity/identities/{identity_id}/report: + post: + description: Creates an abuse report for an identity. + operationId: identity_report parameters: - - in: query - name: directory - required: true - schema: - $ref: '#/components/schemas/KvDirectory' - - in: query - name: namespace_id + - in: path + name: identity_id required: true schema: format: uuid type: string + requestBody: + content: + application/json: + schema: + properties: + reason: + type: string + type: object + required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/KvListResponse' + '204': description: '' '400': content: @@ -12571,42 +12642,11 @@ paths: description: '' security: *id001 tags: - - Kv - /matchmaker/lobbies/closed: - put: - description: 'If `is_closed` is `true`, the matchmaker will no longer route - players to the lobby. Players can still - - join using the /join endpoint (this can be disabled by the developer by rejecting - all new connections - - after setting the lobby to closed). - - Does not shutdown the lobby. - - - This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) - for - - authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) - - for mock responses. When running on Rivet servers, you can access the given - lobby token from the - - [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' - operationId: matchmaker_lobbies_setClosed + - Identity + /job/runs/cleanup: + post: + operationId: job_run_cleanup parameters: [] - requestBody: - content: - application/json: - schema: - properties: - is_closed: - type: boolean - required: - - is_closed - type: object - required: true responses: '204': description: '' @@ -12648,57 +12688,25 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/create: - post: - description: 'Creates a custom lobby. - - - When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) - is enabled in - - your game namespace, this endpoint does not require a token to authenticate. - Otherwise, a - - [development namespace token](/docs/general/concepts/token-types#namespace-development) - can be used - - for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) - - can be used for general authentication.' - operationId: matchmaker_lobbies_create - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - captcha: - $ref: '#/components/schemas/CaptchaConfig' - game_mode: - type: string - lobby_config: {} - max_players: - type: integer - publicity: - $ref: '#/components/schemas/MatchmakerCustomLobbyPublicity' - region: - type: string - tags: - additionalProperties: - type: string - type: object - verification_data: {} - required: - - game_mode - type: object + - JobRun + /kv/entries: + delete: + description: Deletes a key-value entry by key. + operationId: kv_delete + parameters: + - in: query + name: key required: true + schema: + $ref: '#/components/schemas/KvKey' + - in: query + name: namespace_id + required: false + schema: + format: uuid + type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MatchmakerCreateLobbyResponse' + '204': description: '' '400': content: @@ -12738,69 +12746,34 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/find: - post: - description: 'Finds a lobby based on the given criteria. - - If a lobby is not found and `prevent_auto_create_lobby` is `false`, - - a new lobby will be created. - - - When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) - is enabled in - - your game namespace, this endpoint does not require a token to authenticate. - Otherwise, a - - [development namespace token](/docs/general/concepts/token-types#namespace-development) - can be used - - for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) - - can be used for general authentication.' - operationId: matchmaker_lobbies_find - parameters: - - in: header - name: origin - required: false - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - captcha: - $ref: '#/components/schemas/CaptchaConfig' - game_modes: - items: - type: string - type: array - max_players: - type: integer - prevent_auto_create_lobby: - type: boolean - regions: - items: - type: string - type: array - tags: - additionalProperties: - type: string - type: object - verification_data: {} - required: - - game_modes - type: object + - Kv + get: + description: Returns a specific key-value entry by key. + operationId: kv_get + parameters: + - in: query + name: key required: true + schema: + $ref: '#/components/schemas/KvKey' + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false + schema: + type: string + - in: query + name: namespace_id + required: false + schema: + format: uuid + type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MatchmakerFindLobbyResponse' + $ref: '#/components/schemas/KvGetResponse' description: '' '400': content: @@ -12840,50 +12813,19 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/join: - post: - description: 'Joins a specific lobby. - - This request will use the direct player count configured for the - - lobby group. - - - When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) - is enabled in - - your game namespace, this endpoint does not require a token to authenticate. - Otherwise, a - - [development namespace token](/docs/general/concepts/token-types#namespace-development) - can be used - - for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) - - can be used for general authentication.' - operationId: matchmaker_lobbies_join + - Kv + put: + description: Puts (sets or overwrites) a key-value entry by key. + operationId: kv_put parameters: [] requestBody: content: application/json: schema: - properties: - captcha: - $ref: '#/components/schemas/CaptchaConfig' - lobby_id: - type: string - verification_data: {} - required: - - lobby_id - type: object + $ref: '#/components/schemas/KvPutRequest' required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MatchmakerJoinLobbyResponse' + '204': description: '' '400': content: @@ -12923,37 +12865,25 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/list: - get: - description: 'Lists all open lobbies. - - - When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) - is enabled in - - your game namespace, this endpoint does not require a token to authenticate. - Otherwise, a - - [development namespace token](/docs/general/concepts/token-types#namespace-development) - can be used - - for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) - - can be used for general authentication.' - operationId: matchmaker_lobbies_list + - Kv + /kv/entries/batch: + delete: + description: Deletes multiple key-value entries by key(s). + operationId: kv_deleteBatch parameters: - in: query - name: include_state + name: keys + required: true + schema: + $ref: '#/components/schemas/KvKey' + - in: query + name: namespace_id required: false schema: - type: boolean + format: uuid + type: string responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MatchmakerListLobbiesResponse' + '204': description: '' '400': content: @@ -12993,21 +12923,34 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/ready: - post: - description: 'Marks the current lobby as ready to accept connections. Players - will not be able to connect to this lobby until the lobby is flagged as ready. - - This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) - for authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) - for mock responses. When running on Rivet servers, you can access the given - lobby token from the [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) - environment variable.' - operationId: matchmaker_lobbies_ready - parameters: [] + - Kv + get: + description: Gets multiple key-value entries by key(s). + operationId: kv_getBatch + parameters: + - in: query + name: keys + required: true + schema: + $ref: '#/components/schemas/KvKey' + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false + schema: + type: string + - in: query + name: namespace_id + required: false + schema: + format: uuid + type: string responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/KvGetBatchResponse' description: '' '400': content: @@ -13047,28 +12990,17 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/state: + - Kv put: - description: 'Sets the state JSON of the current lobby. - - - This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) - for - - authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) - - for mock responses. When running on Rivet servers, you can access the given - lobby token from the - - [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' - operationId: matchmaker_lobbies_setState + description: Puts (sets or overwrites) multiple key-value entries by key(s). + operationId: kv_putBatch parameters: [] requestBody: content: application/json: - schema: {} - required: false + schema: + $ref: '#/components/schemas/KvPutBatchRequest' + required: true responses: '204': description: '' @@ -13110,25 +13042,19 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/lobbies/{lobby_id}/state: + - Kv + /kv/entries/list: get: - description: 'Get the state of any lobby. - - - This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) - for - - authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) - - for mock responses. When running on Rivet servers, you can access the given - lobby token from the - - [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' - operationId: matchmaker_lobbies_getState + description: Lists all keys in a directory. + operationId: kv_list parameters: - - in: path - name: lobby_id + - in: query + name: directory + required: true + schema: + $ref: '#/components/schemas/KvDirectory' + - in: query + name: namespace_id required: true schema: format: uuid @@ -13137,7 +13063,8 @@ paths: '200': content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/KvListResponse' description: '' '400': content: @@ -13177,85 +13104,40 @@ paths: description: '' security: *id001 tags: - - MatchmakerLobbies - /matchmaker/players/connected: - post: - description: 'Validates the player token is valid and has not already been consumed - then - - marks the player as connected. - - - # Player Tokens and Reserved Slots - - - Player tokens reserve a spot in the lobby until they expire. This allows for - - precise matchmaking up to exactly the lobby''s player limit, which is - - important for games with small lobbies and a high influx of players. - - By calling this endpoint with the player token, the player''s spot is marked - - as connected and will not expire. If this endpoint is never called, the - - player''s token will expire and this spot will be filled by another player. - - - # Anti-Botting - - - Player tokens are only issued by caling `lobbies.join`, calling `lobbies.find`, - or - - from the `GlobalEventMatchmakerLobbyJoin` event. - - These endpoints have anti-botting measures (i.e. enforcing max player - - limits, captchas, and detecting bots), so valid player tokens provide some - - confidence that the player is not a bot. - - Therefore, it''s important to make sure the token is valid by waiting for - - this endpoint to return OK before allowing the connected socket to do - - anything else. If this endpoint returns an error, the socket should be - - disconnected immediately. - - - # How to Transmit the Player Token - - - The client is responsible for acquiring the player token by caling + - Kv + /matchmaker/lobbies/closed: + put: + description: 'If `is_closed` is `true`, the matchmaker will no longer route + players to the lobby. Players can still - `lobbies.join`, calling `lobbies.find`, or from the `GlobalEventMatchmakerLobbyJoin` + join using the /join endpoint (this can be disabled by the developer by rejecting + all new connections - event. Beyond that, it''s up to the developer how the player token is + after setting the lobby to closed). - transmitted to the lobby. + Does not shutdown the lobby. - If using WebSockets, the player token can be transmitted as a query - parameter. + This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) + for - Otherwise, the player token will likely be automatically sent by the client + authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) - once the socket opens. As mentioned above, nothing else should happen until + for mock responses. When running on Rivet servers, you can access the given + lobby token from the - the player token is validated.' - operationId: matchmaker_players_connected + [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' + operationId: matchmaker_lobbies_setClosed parameters: [] requestBody: content: application/json: schema: properties: - player_token: - type: string + is_closed: + type: boolean required: - - player_token + - is_closed type: object required: true responses: @@ -13299,27 +13181,57 @@ paths: description: '' security: *id001 tags: - - MatchmakerPlayers - /matchmaker/players/disconnected: + - MatchmakerLobbies + /matchmaker/lobbies/create: post: - description: 'Marks a player as disconnected. # Ghost Players If players are - not marked as disconnected, lobbies will result with "ghost players" that - the matchmaker thinks exist but are no longer connected to the lobby.' - operationId: matchmaker_players_disconnected + description: 'Creates a custom lobby. + + + When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) + is enabled in + + your game namespace, this endpoint does not require a token to authenticate. + Otherwise, a + + [development namespace token](/docs/general/concepts/token-types#namespace-development) + can be used + + for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) + + can be used for general authentication.' + operationId: matchmaker_lobbies_create parameters: [] requestBody: content: application/json: schema: properties: - player_token: + captcha: + $ref: '#/components/schemas/CaptchaConfig' + game_mode: + type: string + lobby_config: {} + max_players: + type: integer + publicity: + $ref: '#/components/schemas/MatchmakerCustomLobbyPublicity' + region: type: string + tags: + additionalProperties: + type: string + type: object + verification_data: {} required: - - player_token + - game_mode type: object required: true responses: - '204': + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MatchmakerCreateLobbyResponse' description: '' '400': content: @@ -13359,18 +13271,69 @@ paths: description: '' security: *id001 tags: - - MatchmakerPlayers - /matchmaker/players/statistics: - get: - description: Gives matchmaker statistics about the players in game. - operationId: matchmaker_players_getStatistics - parameters: [] + - MatchmakerLobbies + /matchmaker/lobbies/find: + post: + description: 'Finds a lobby based on the given criteria. + + If a lobby is not found and `prevent_auto_create_lobby` is `false`, + + a new lobby will be created. + + + When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) + is enabled in + + your game namespace, this endpoint does not require a token to authenticate. + Otherwise, a + + [development namespace token](/docs/general/concepts/token-types#namespace-development) + can be used + + for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) + + can be used for general authentication.' + operationId: matchmaker_lobbies_find + parameters: + - in: header + name: origin + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + captcha: + $ref: '#/components/schemas/CaptchaConfig' + game_modes: + items: + type: string + type: array + max_players: + type: integer + prevent_auto_create_lobby: + type: boolean + regions: + items: + type: string + type: array + tags: + additionalProperties: + type: string + type: object + verification_data: {} + required: + - game_modes + type: object + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MatchmakerGetStatisticsResponse' + $ref: '#/components/schemas/MatchmakerFindLobbyResponse' description: '' '400': content: @@ -13410,22 +13373,50 @@ paths: description: '' security: *id001 tags: - - MatchmakerPlayers - /matchmaker/regions: - get: - description: 'Returns a list of regions available to this namespace. + - MatchmakerLobbies + /matchmaker/lobbies/join: + post: + description: 'Joins a specific lobby. - Regions are sorted by most optimal to least optimal. The player''s IP address + This request will use the direct player count configured for the - is used to calculate the regions'' optimality.' - operationId: matchmaker_regions_list + lobby group. + + + When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) + is enabled in + + your game namespace, this endpoint does not require a token to authenticate. + Otherwise, a + + [development namespace token](/docs/general/concepts/token-types#namespace-development) + can be used + + for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) + + can be used for general authentication.' + operationId: matchmaker_lobbies_join parameters: [] + requestBody: + content: + application/json: + schema: + properties: + captcha: + $ref: '#/components/schemas/CaptchaConfig' + lobby_id: + type: string + verification_data: {} + required: + - lobby_id + type: object + required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/MatchmakerListRegionsResponse' + $ref: '#/components/schemas/MatchmakerJoinLobbyResponse' description: '' '400': content: @@ -13465,33 +13456,37 @@ paths: description: '' security: *id001 tags: - - MatchmakerRegions - /portal/games/{game_name_id}/profile: + - MatchmakerLobbies + /matchmaker/lobbies/list: get: - description: Returns a game profile. - operationId: portal_games_getGameProfile + description: 'Lists all open lobbies. + + + When [tokenless authentication](/docs/general/concepts/tokenless-authentication/web) + is enabled in + + your game namespace, this endpoint does not require a token to authenticate. + Otherwise, a + + [development namespace token](/docs/general/concepts/token-types#namespace-development) + can be used + + for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) + + can be used for general authentication.' + operationId: matchmaker_lobbies_list parameters: - - description: A human readable short identifier used to references resources. - Different than a `rivet.common#Uuid` because this is intended to be human - readable. Different than `rivet.common#DisplayName` because this should - not include special characters and be short. - in: path - name: game_name_id - required: true - schema: - type: string - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index + - in: query + name: include_state required: false schema: - type: string + type: boolean responses: '200': content: application/json: schema: - $ref: '#/components/schemas/PortalGetGameProfileResponse' + $ref: '#/components/schemas/MatchmakerListLobbiesResponse' description: '' '400': content: @@ -13531,30 +13526,21 @@ paths: description: '' security: *id001 tags: - - PortalGames - /servers: - get: - description: Lists all servers associated with the token used. Can be filtered - by tags in the query string. - operationId: servers_list - parameters: - - in: query - name: tags - required: false - schema: - type: string - - in: query - name: game_id - required: false - schema: - format: uuid - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ServersListServersResponse' + - MatchmakerLobbies + /matchmaker/lobbies/ready: + post: + description: 'Marks the current lobby as ready to accept connections. Players + will not be able to connect to this lobby until the lobby is flagged as ready. + + This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) + for authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) + for mock responses. When running on Rivet servers, you can access the given + lobby token from the [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) + environment variable.' + operationId: matchmaker_lobbies_ready + parameters: [] + responses: + '204': description: '' '400': content: @@ -13594,23 +13580,30 @@ paths: description: '' security: *id001 tags: - - Servers - post: - description: Create a new dynamic server. - operationId: servers_create + - MatchmakerLobbies + /matchmaker/lobbies/state: + put: + description: 'Sets the state JSON of the current lobby. + + + This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) + for + + authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) + + for mock responses. When running on Rivet servers, you can access the given + lobby token from the + + [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' + operationId: matchmaker_lobbies_setState parameters: [] requestBody: content: application/json: - schema: - $ref: '#/components/schemas/ServersCreateServerRequest' - required: true + schema: {} + required: false responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateServerResponse' + '204': description: '' '400': content: @@ -13650,21 +13643,26 @@ paths: description: '' security: *id001 tags: - - Servers - /servers/builds: + - MatchmakerLobbies + /matchmaker/lobbies/{lobby_id}/state: get: - description: Lists all builds of the game associated with the token used. Can - be filtered by tags in the query string. - operationId: servers_builds_listBuilds + description: 'Get the state of any lobby. + + + This endpoint requires a [lobby token](/docs/general/concepts/token-types#matchmaker-lobby) + for + + authentication, or a [development namespace token](/docs/general/concepts/token-types#namespace-development) + + for mock responses. When running on Rivet servers, you can access the given + lobby token from the + + [`RIVET_TOKEN`](/docs/matchmaker/concepts/lobby-env) environment variable.' + operationId: matchmaker_lobbies_getState parameters: - - in: query - name: tags - required: false - schema: - type: string - - in: query - name: game_id - required: false + - in: path + name: lobby_id + required: true schema: format: uuid type: string @@ -13672,8 +13670,7 @@ paths: '200': content: application/json: - schema: - $ref: '#/components/schemas/ServersListBuildsResponse' + schema: {} description: '' '400': content: @@ -13713,23 +13710,89 @@ paths: description: '' security: *id001 tags: - - ServersBuilds + - MatchmakerLobbies + /matchmaker/players/connected: post: - description: Creates a new game build for the given game. - operationId: servers_builds_prepareBuild + description: 'Validates the player token is valid and has not already been consumed + then + + marks the player as connected. + + + # Player Tokens and Reserved Slots + + + Player tokens reserve a spot in the lobby until they expire. This allows for + + precise matchmaking up to exactly the lobby''s player limit, which is + + important for games with small lobbies and a high influx of players. + + By calling this endpoint with the player token, the player''s spot is marked + + as connected and will not expire. If this endpoint is never called, the + + player''s token will expire and this spot will be filled by another player. + + + # Anti-Botting + + + Player tokens are only issued by caling `lobbies.join`, calling `lobbies.find`, + or + + from the `GlobalEventMatchmakerLobbyJoin` event. + + These endpoints have anti-botting measures (i.e. enforcing max player + + limits, captchas, and detecting bots), so valid player tokens provide some + + confidence that the player is not a bot. + + Therefore, it''s important to make sure the token is valid by waiting for + + this endpoint to return OK before allowing the connected socket to do + + anything else. If this endpoint returns an error, the socket should be + + disconnected immediately. + + + # How to Transmit the Player Token + + + The client is responsible for acquiring the player token by caling + + `lobbies.join`, calling `lobbies.find`, or from the `GlobalEventMatchmakerLobbyJoin` + + event. Beyond that, it''s up to the developer how the player token is + + transmitted to the lobby. + + If using WebSockets, the player token can be transmitted as a query + + parameter. + + Otherwise, the player token will likely be automatically sent by the client + + once the socket opens. As mentioned above, nothing else should happen until + + the player token is validated.' + operationId: matchmaker_players_connected parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/ServersCreateBuildRequest' + properties: + player_token: + type: string + required: + - player_token + type: object required: true responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ServersCreateBuildResponse' + '204': description: '' '400': content: @@ -13769,18 +13832,25 @@ paths: description: '' security: *id001 tags: - - ServersBuilds - /servers/uploads/{upload_id}/complete: + - MatchmakerPlayers + /matchmaker/players/disconnected: post: - description: Marks an upload as complete. - operationId: servers_builds_completeBuild - parameters: - - in: path - name: upload_id + description: 'Marks a player as disconnected. # Ghost Players If players are + not marked as disconnected, lobbies will result with "ghost players" that + the matchmaker thinks exist but are no longer connected to the lobby.' + operationId: matchmaker_players_disconnected + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + player_token: + type: string + required: + - player_token + type: object required: true - schema: - format: uuid - type: string responses: '204': description: '' @@ -13822,22 +13892,18 @@ paths: description: '' security: *id001 tags: - - ServersBuilds - /servers/{ip}: + - MatchmakerPlayers + /matchmaker/players/statistics: get: - operationId: provision_servers_getInfo - parameters: - - in: path - name: ip - required: true - schema: - type: string + description: Gives matchmaker statistics about the players in game. + operationId: matchmaker_players_getStatistics + parameters: [] responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ProvisionServersGetInfoResponse' + $ref: '#/components/schemas/MatchmakerGetStatisticsResponse' description: '' '400': content: @@ -13877,34 +13943,22 @@ paths: description: '' security: *id001 tags: - - ProvisionServers - /servers/{server_id}: - delete: - description: Destroy a dynamic server. - operationId: servers_destroy - parameters: - - description: The id of the server to destroy - in: path - name: server_id - required: true - schema: - format: uuid - type: string - - description: The duration to wait for in milliseconds before killing the server. - This should be used to override the default kill timeout if a faster time - is needed, say for ignoring a graceful shutdown. - in: query - name: override_kill_timeout - required: false - schema: - format: int64 - type: integer + - MatchmakerPlayers + /matchmaker/regions: + get: + description: 'Returns a list of regions available to this namespace. + + Regions are sorted by most optimal to least optimal. The player''s IP address + + is used to calculate the regions'' optimality.' + operationId: matchmaker_regions_list + parameters: [] responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServersDestroyServerResponse' + $ref: '#/components/schemas/MatchmakerListRegionsResponse' description: '' '400': content: @@ -13944,24 +13998,33 @@ paths: description: '' security: *id001 tags: - - Servers + - MatchmakerRegions + /portal/games/{game_name_id}/profile: get: - description: Gets a dynamic server. - operationId: servers_get + description: Returns a game profile. + operationId: portal_games_getGameProfile parameters: - - description: The id of the server to destroy + - description: A human readable short identifier used to references resources. + Different than a `rivet.common#Uuid` because this is intended to be human + readable. Different than `rivet.common#DisplayName` because this should + not include special characters and be short. in: path - name: server_id + name: game_name_id required: true schema: - format: uuid + type: string + - description: A query parameter denoting the requests watch index. + in: query + name: watch_index + required: false + schema: type: string responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ServersGetServerResponse' + $ref: '#/components/schemas/PortalGetGameProfileResponse' description: '' '400': content: @@ -14001,33 +14064,14 @@ paths: description: '' security: *id001 tags: - - Servers - /servers/{server_id}/logs: + - PortalGames + /servers/{ip}: get: - description: Returns the logs for a given server. - operationId: servers_logs_getServerLogs + operationId: provision_servers_getInfo parameters: - in: path - name: server_id - required: true - schema: - format: uuid - type: string - - in: query - name: stream + name: ip required: true - schema: - $ref: '#/components/schemas/ServersLogStream' - - in: query - name: game_id - required: false - schema: - format: uuid - type: string - - description: A query parameter denoting the requests watch index. - in: query - name: watch_index - required: false schema: type: string responses: @@ -14035,7 +14079,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServersGetServerLogsResponse' + $ref: '#/components/schemas/ProvisionServersGetInfoResponse' description: '' '400': content: @@ -14075,7 +14119,7 @@ paths: description: '' security: *id001 tags: - - ServersLogs + - ProvisionServers servers: - description: Production url: https://api.rivet.gg diff --git a/sdks/full/rust-cli/.openapi-generator/FILES b/sdks/full/rust-cli/.openapi-generator/FILES index 499eb1b382..77f166cf0c 100644 --- a/sdks/full/rust-cli/.openapi-generator/FILES +++ b/sdks/full/rust-cli/.openapi-generator/FILES @@ -219,6 +219,29 @@ docs/GameStatFormatMethod.md docs/GameStatSortingMethod.md docs/GameStatSummary.md docs/GameSummary.md +docs/GamesServersApi.md +docs/GamesServersBuildCompression.md +docs/GamesServersBuildKind.md +docs/GamesServersBuildsApi.md +docs/GamesServersCreateBuildRequest.md +docs/GamesServersCreateBuildResponse.md +docs/GamesServersCreateServerNetworkRequest.md +docs/GamesServersCreateServerPortRequest.md +docs/GamesServersCreateServerRequest.md +docs/GamesServersCreateServerResponse.md +docs/GamesServersGetServerLogsResponse.md +docs/GamesServersGetServerResponse.md +docs/GamesServersListBuildsResponse.md +docs/GamesServersListServersResponse.md +docs/GamesServersLogStream.md +docs/GamesServersLogsApi.md +docs/GamesServersNetwork.md +docs/GamesServersNetworkMode.md +docs/GamesServersPort.md +docs/GamesServersPortProtocol.md +docs/GamesServersPortRouting.md +docs/GamesServersResources.md +docs/GamesServersServer.md docs/GeoCoord.md docs/GeoDistance.md docs/GlobalEventNotification.md @@ -346,30 +369,6 @@ docs/ProvisionDatacentersApi.md docs/ProvisionDatacentersGetTlsResponse.md docs/ProvisionServersApi.md docs/ProvisionServersGetInfoResponse.md -docs/ServersApi.md -docs/ServersBuildCompression.md -docs/ServersBuildKind.md -docs/ServersBuildsApi.md -docs/ServersCreateBuildRequest.md -docs/ServersCreateBuildResponse.md -docs/ServersCreateServerNetworkRequest.md -docs/ServersCreateServerPortRequest.md -docs/ServersCreateServerRequest.md -docs/ServersCreateServerResponse.md -docs/ServersDestroyServerResponse.md -docs/ServersGetServerLogsResponse.md -docs/ServersGetServerResponse.md -docs/ServersListBuildsResponse.md -docs/ServersListServersResponse.md -docs/ServersLogStream.md -docs/ServersLogsApi.md -docs/ServersNetwork.md -docs/ServersNetworkMode.md -docs/ServersPort.md -docs/ServersPortProtocol.md -docs/ServersPortRouting.md -docs/ServersResources.md -docs/ServersServer.md docs/UploadPrepareFile.md docs/UploadPresignedRequest.md docs/ValidationError.md @@ -400,6 +399,9 @@ src/apis/cloud_logs_api.rs src/apis/cloud_tiers_api.rs src/apis/cloud_uploads_api.rs src/apis/configuration.rs +src/apis/games_servers_api.rs +src/apis/games_servers_builds_api.rs +src/apis/games_servers_logs_api.rs src/apis/group_api.rs src/apis/group_invites_api.rs src/apis/group_join_requests_api.rs @@ -416,9 +418,6 @@ src/apis/mod.rs src/apis/portal_games_api.rs src/apis/provision_datacenters_api.rs src/apis/provision_servers_api.rs -src/apis/servers_api.rs -src/apis/servers_builds_api.rs -src/apis/servers_logs_api.rs src/lib.rs src/models/admin_clusters_build_delivery_method.rs src/models/admin_clusters_cluster.rs @@ -612,6 +611,26 @@ src/models/game_stat_format_method.rs src/models/game_stat_sorting_method.rs src/models/game_stat_summary.rs src/models/game_summary.rs +src/models/games_servers_build_compression.rs +src/models/games_servers_build_kind.rs +src/models/games_servers_create_build_request.rs +src/models/games_servers_create_build_response.rs +src/models/games_servers_create_server_network_request.rs +src/models/games_servers_create_server_port_request.rs +src/models/games_servers_create_server_request.rs +src/models/games_servers_create_server_response.rs +src/models/games_servers_get_server_logs_response.rs +src/models/games_servers_get_server_response.rs +src/models/games_servers_list_builds_response.rs +src/models/games_servers_list_servers_response.rs +src/models/games_servers_log_stream.rs +src/models/games_servers_network.rs +src/models/games_servers_network_mode.rs +src/models/games_servers_port.rs +src/models/games_servers_port_protocol.rs +src/models/games_servers_port_routing.rs +src/models/games_servers_resources.rs +src/models/games_servers_server.rs src/models/geo_coord.rs src/models/geo_distance.rs src/models/global_event_notification.rs @@ -725,27 +744,6 @@ src/models/portal_notification_register_service.rs src/models/portal_notification_unregister_service.rs src/models/provision_datacenters_get_tls_response.rs src/models/provision_servers_get_info_response.rs -src/models/servers_build_compression.rs -src/models/servers_build_kind.rs -src/models/servers_create_build_request.rs -src/models/servers_create_build_response.rs -src/models/servers_create_server_network_request.rs -src/models/servers_create_server_port_request.rs -src/models/servers_create_server_request.rs -src/models/servers_create_server_response.rs -src/models/servers_destroy_server_response.rs -src/models/servers_get_server_logs_response.rs -src/models/servers_get_server_response.rs -src/models/servers_list_builds_response.rs -src/models/servers_list_servers_response.rs -src/models/servers_log_stream.rs -src/models/servers_network.rs -src/models/servers_network_mode.rs -src/models/servers_port.rs -src/models/servers_port_protocol.rs -src/models/servers_port_routing.rs -src/models/servers_resources.rs -src/models/servers_server.rs src/models/upload_prepare_file.rs src/models/upload_presigned_request.rs src/models/validation_error.rs diff --git a/sdks/full/rust-cli/README.md b/sdks/full/rust-cli/README.md index 1d982febf3..82989b805a 100644 --- a/sdks/full/rust-cli/README.md +++ b/sdks/full/rust-cli/README.md @@ -91,6 +91,14 @@ Class | Method | HTTP request | Description *CloudLogsApi* | [**cloud_logs_get_ray_perf_logs**](docs/CloudLogsApi.md#cloud_logs_get_ray_perf_logs) | **GET** /cloud/rays/{ray_id}/perf | *CloudTiersApi* | [**cloud_tiers_get_region_tiers**](docs/CloudTiersApi.md#cloud_tiers_get_region_tiers) | **GET** /cloud/region-tiers | *CloudUploadsApi* | [**cloud_uploads_complete_upload**](docs/CloudUploadsApi.md#cloud_uploads_complete_upload) | **POST** /cloud/uploads/{upload_id}/complete | +*GamesServersApi* | [**games_servers_create**](docs/GamesServersApi.md#games_servers_create) | **POST** /games/{game_id}/servers | +*GamesServersApi* | [**games_servers_destroy**](docs/GamesServersApi.md#games_servers_destroy) | **DELETE** /games/{game_id}/servers/{server_id} | +*GamesServersApi* | [**games_servers_get**](docs/GamesServersApi.md#games_servers_get) | **GET** /games/{game_id}/servers/{server_id} | +*GamesServersApi* | [**games_servers_list**](docs/GamesServersApi.md#games_servers_list) | **GET** /games/{game_id}/servers | +*GamesServersBuildsApi* | [**games_servers_builds_complete_build**](docs/GamesServersBuildsApi.md#games_servers_builds_complete_build) | **POST** /games/{game_id}/builds/{build_id}/complete | +*GamesServersBuildsApi* | [**games_servers_builds_list_builds**](docs/GamesServersBuildsApi.md#games_servers_builds_list_builds) | **GET** /games/{game_id}/builds | +*GamesServersBuildsApi* | [**games_servers_builds_prepare_build**](docs/GamesServersBuildsApi.md#games_servers_builds_prepare_build) | **POST** /games/{game_id}/builds/prepare | +*GamesServersLogsApi* | [**games_servers_logs_get_server_logs**](docs/GamesServersLogsApi.md#games_servers_logs_get_server_logs) | **GET** /games/{game_id}/servers/{server_id}/logs | *GroupApi* | [**group_ban_identity**](docs/GroupApi.md#group_ban_identity) | **POST** /group/groups/{group_id}/bans/{identity_id} | *GroupApi* | [**group_complete_avatar_upload**](docs/GroupApi.md#group_complete_avatar_upload) | **POST** /group/groups/{group_id}/avatar-upload/{upload_id}/complete | *GroupApi* | [**group_create**](docs/GroupApi.md#group_create) | **POST** /group/groups | @@ -167,14 +175,6 @@ Class | Method | HTTP request | Description *PortalGamesApi* | [**portal_games_get_game_profile**](docs/PortalGamesApi.md#portal_games_get_game_profile) | **GET** /portal/games/{game_name_id}/profile | *ProvisionDatacentersApi* | [**provision_datacenters_get_tls**](docs/ProvisionDatacentersApi.md#provision_datacenters_get_tls) | **GET** /datacenters/{datacenter_id}/tls | *ProvisionServersApi* | [**provision_servers_get_info**](docs/ProvisionServersApi.md#provision_servers_get_info) | **GET** /servers/{ip} | -*ServersApi* | [**servers_create**](docs/ServersApi.md#servers_create) | **POST** /servers | -*ServersApi* | [**servers_destroy**](docs/ServersApi.md#servers_destroy) | **DELETE** /servers/{server_id} | -*ServersApi* | [**servers_get**](docs/ServersApi.md#servers_get) | **GET** /servers/{server_id} | -*ServersApi* | [**servers_list**](docs/ServersApi.md#servers_list) | **GET** /servers | -*ServersBuildsApi* | [**servers_builds_complete_build**](docs/ServersBuildsApi.md#servers_builds_complete_build) | **POST** /servers/uploads/{upload_id}/complete | -*ServersBuildsApi* | [**servers_builds_list_builds**](docs/ServersBuildsApi.md#servers_builds_list_builds) | **GET** /servers/builds | -*ServersBuildsApi* | [**servers_builds_prepare_build**](docs/ServersBuildsApi.md#servers_builds_prepare_build) | **POST** /servers/builds | -*ServersLogsApi* | [**servers_logs_get_server_logs**](docs/ServersLogsApi.md#servers_logs_get_server_logs) | **GET** /servers/{server_id}/logs | ## Documentation For Models @@ -371,6 +371,26 @@ Class | Method | HTTP request | Description - [GameStatSortingMethod](docs/GameStatSortingMethod.md) - [GameStatSummary](docs/GameStatSummary.md) - [GameSummary](docs/GameSummary.md) + - [GamesServersBuildCompression](docs/GamesServersBuildCompression.md) + - [GamesServersBuildKind](docs/GamesServersBuildKind.md) + - [GamesServersCreateBuildRequest](docs/GamesServersCreateBuildRequest.md) + - [GamesServersCreateBuildResponse](docs/GamesServersCreateBuildResponse.md) + - [GamesServersCreateServerNetworkRequest](docs/GamesServersCreateServerNetworkRequest.md) + - [GamesServersCreateServerPortRequest](docs/GamesServersCreateServerPortRequest.md) + - [GamesServersCreateServerRequest](docs/GamesServersCreateServerRequest.md) + - [GamesServersCreateServerResponse](docs/GamesServersCreateServerResponse.md) + - [GamesServersGetServerLogsResponse](docs/GamesServersGetServerLogsResponse.md) + - [GamesServersGetServerResponse](docs/GamesServersGetServerResponse.md) + - [GamesServersListBuildsResponse](docs/GamesServersListBuildsResponse.md) + - [GamesServersListServersResponse](docs/GamesServersListServersResponse.md) + - [GamesServersLogStream](docs/GamesServersLogStream.md) + - [GamesServersNetwork](docs/GamesServersNetwork.md) + - [GamesServersNetworkMode](docs/GamesServersNetworkMode.md) + - [GamesServersPort](docs/GamesServersPort.md) + - [GamesServersPortProtocol](docs/GamesServersPortProtocol.md) + - [GamesServersPortRouting](docs/GamesServersPortRouting.md) + - [GamesServersResources](docs/GamesServersResources.md) + - [GamesServersServer](docs/GamesServersServer.md) - [GeoCoord](docs/GeoCoord.md) - [GeoDistance](docs/GeoDistance.md) - [GlobalEventNotification](docs/GlobalEventNotification.md) @@ -483,27 +503,6 @@ Class | Method | HTTP request | Description - [PortalNotificationUnregisterService](docs/PortalNotificationUnregisterService.md) - [ProvisionDatacentersGetTlsResponse](docs/ProvisionDatacentersGetTlsResponse.md) - [ProvisionServersGetInfoResponse](docs/ProvisionServersGetInfoResponse.md) - - [ServersBuildCompression](docs/ServersBuildCompression.md) - - [ServersBuildKind](docs/ServersBuildKind.md) - - [ServersCreateBuildRequest](docs/ServersCreateBuildRequest.md) - - [ServersCreateBuildResponse](docs/ServersCreateBuildResponse.md) - - [ServersCreateServerNetworkRequest](docs/ServersCreateServerNetworkRequest.md) - - [ServersCreateServerPortRequest](docs/ServersCreateServerPortRequest.md) - - [ServersCreateServerRequest](docs/ServersCreateServerRequest.md) - - [ServersCreateServerResponse](docs/ServersCreateServerResponse.md) - - [ServersDestroyServerResponse](docs/ServersDestroyServerResponse.md) - - [ServersGetServerLogsResponse](docs/ServersGetServerLogsResponse.md) - - [ServersGetServerResponse](docs/ServersGetServerResponse.md) - - [ServersListBuildsResponse](docs/ServersListBuildsResponse.md) - - [ServersListServersResponse](docs/ServersListServersResponse.md) - - [ServersLogStream](docs/ServersLogStream.md) - - [ServersNetwork](docs/ServersNetwork.md) - - [ServersNetworkMode](docs/ServersNetworkMode.md) - - [ServersPort](docs/ServersPort.md) - - [ServersPortProtocol](docs/ServersPortProtocol.md) - - [ServersPortRouting](docs/ServersPortRouting.md) - - [ServersResources](docs/ServersResources.md) - - [ServersServer](docs/ServersServer.md) - [UploadPrepareFile](docs/UploadPrepareFile.md) - [UploadPresignedRequest](docs/UploadPresignedRequest.md) - [ValidationError](docs/ValidationError.md) diff --git a/sdks/full/rust/docs/ServersApi.md b/sdks/full/rust-cli/docs/GamesServersApi.md similarity index 62% rename from sdks/full/rust/docs/ServersApi.md rename to sdks/full/rust-cli/docs/GamesServersApi.md index 708f96bcf2..f07830f717 100644 --- a/sdks/full/rust/docs/ServersApi.md +++ b/sdks/full/rust-cli/docs/GamesServersApi.md @@ -1,19 +1,19 @@ -# \ServersApi +# \GamesServersApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_create**](ServersApi.md#servers_create) | **POST** /servers | -[**servers_destroy**](ServersApi.md#servers_destroy) | **DELETE** /servers/{server_id} | -[**servers_get**](ServersApi.md#servers_get) | **GET** /servers/{server_id} | -[**servers_list**](ServersApi.md#servers_list) | **GET** /servers | +[**games_servers_create**](GamesServersApi.md#games_servers_create) | **POST** /games/{game_id}/servers | +[**games_servers_destroy**](GamesServersApi.md#games_servers_destroy) | **DELETE** /games/{game_id}/servers/{server_id} | +[**games_servers_get**](GamesServersApi.md#games_servers_get) | **GET** /games/{game_id}/servers/{server_id} | +[**games_servers_list**](GamesServersApi.md#games_servers_list) | **GET** /games/{game_id}/servers | -## servers_create +## games_servers_create -> crate::models::ServersCreateServerResponse servers_create(servers_create_server_request) +> crate::models::GamesServersCreateServerResponse games_servers_create(game_id, games_servers_create_server_request) Create a new dynamic server. @@ -23,11 +23,12 @@ Create a new dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**servers_create_server_request** | [**ServersCreateServerRequest**](ServersCreateServerRequest.md) | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**games_servers_create_server_request** | [**GamesServersCreateServerRequest**](GamesServersCreateServerRequest.md) | | [required] | ### Return type -[**crate::models::ServersCreateServerResponse**](ServersCreateServerResponse.md) +[**crate::models::GamesServersCreateServerResponse**](GamesServersCreateServerResponse.md) ### Authorization @@ -41,9 +42,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_destroy +## games_servers_destroy -> crate::models::ServersDestroyServerResponse servers_destroy(server_id, override_kill_timeout) +> serde_json::Value games_servers_destroy(game_id, server_id, override_kill_timeout) Destroy a dynamic server. @@ -53,12 +54,13 @@ Destroy a dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | The id of the server to destroy | [required] | **override_kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be used to override the default kill timeout if a faster time is needed, say for ignoring a graceful shutdown. | | ### Return type -[**crate::models::ServersDestroyServerResponse**](ServersDestroyServerResponse.md) +[**serde_json::Value**](serde_json::Value.md) ### Authorization @@ -72,9 +74,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_get +## games_servers_get -> crate::models::ServersGetServerResponse servers_get(server_id) +> crate::models::GamesServersGetServerResponse games_servers_get(game_id, server_id) Gets a dynamic server. @@ -84,11 +86,12 @@ Gets a dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | The id of the server to destroy | [required] | ### Return type -[**crate::models::ServersGetServerResponse**](ServersGetServerResponse.md) +[**crate::models::GamesServersGetServerResponse**](GamesServersGetServerResponse.md) ### Authorization @@ -102,9 +105,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_list +## games_servers_list -> crate::models::ServersListServersResponse servers_list(tags, game_id) +> crate::models::GamesServersListServersResponse games_servers_list(game_id, tags, game_id2) Lists all servers associated with the token used. Can be filtered by tags in the query string. @@ -114,12 +117,13 @@ Lists all servers associated with the token used. Can be filtered by tags in the Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **tags** | Option<**String**> | | | -**game_id** | Option<**uuid::Uuid**> | | | +**game_id2** | Option<**uuid::Uuid**> | | | ### Return type -[**crate::models::ServersListServersResponse**](ServersListServersResponse.md) +[**crate::models::GamesServersListServersResponse**](GamesServersListServersResponse.md) ### Authorization diff --git a/sdks/full/rust-cli/docs/GamesServersBuildCompression.md b/sdks/full/rust-cli/docs/GamesServersBuildCompression.md new file mode 100644 index 0000000000..a6e61f4f03 --- /dev/null +++ b/sdks/full/rust-cli/docs/GamesServersBuildCompression.md @@ -0,0 +1,10 @@ +# GamesServersBuildCompression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/full/rust-cli/docs/ServersPortProtocol.md b/sdks/full/rust-cli/docs/GamesServersBuildKind.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersPortProtocol.md rename to sdks/full/rust-cli/docs/GamesServersBuildKind.md index 595d11df8f..b6f5a36981 100644 --- a/sdks/full/rust-cli/docs/ServersPortProtocol.md +++ b/sdks/full/rust-cli/docs/GamesServersBuildKind.md @@ -1,4 +1,4 @@ -# ServersPortProtocol +# GamesServersBuildKind ## Properties diff --git a/sdks/full/rust-cli/docs/ServersBuildsApi.md b/sdks/full/rust-cli/docs/GamesServersBuildsApi.md similarity index 56% rename from sdks/full/rust-cli/docs/ServersBuildsApi.md rename to sdks/full/rust-cli/docs/GamesServersBuildsApi.md index 579cfc8c42..aa3ddc3f13 100644 --- a/sdks/full/rust-cli/docs/ServersBuildsApi.md +++ b/sdks/full/rust-cli/docs/GamesServersBuildsApi.md @@ -1,18 +1,18 @@ -# \ServersBuildsApi +# \GamesServersBuildsApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_builds_complete_build**](ServersBuildsApi.md#servers_builds_complete_build) | **POST** /servers/uploads/{upload_id}/complete | -[**servers_builds_list_builds**](ServersBuildsApi.md#servers_builds_list_builds) | **GET** /servers/builds | -[**servers_builds_prepare_build**](ServersBuildsApi.md#servers_builds_prepare_build) | **POST** /servers/builds | +[**games_servers_builds_complete_build**](GamesServersBuildsApi.md#games_servers_builds_complete_build) | **POST** /games/{game_id}/builds/{build_id}/complete | +[**games_servers_builds_list_builds**](GamesServersBuildsApi.md#games_servers_builds_list_builds) | **GET** /games/{game_id}/builds | +[**games_servers_builds_prepare_build**](GamesServersBuildsApi.md#games_servers_builds_prepare_build) | **POST** /games/{game_id}/builds/prepare | -## servers_builds_complete_build +## games_servers_builds_complete_build -> servers_builds_complete_build(upload_id) +> games_servers_builds_complete_build(game_id, build_id) Marks an upload as complete. @@ -22,7 +22,8 @@ Marks an upload as complete. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**upload_id** | **uuid::Uuid** | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**build_id** | **uuid::Uuid** | | [required] | ### Return type @@ -40,9 +41,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_builds_list_builds +## games_servers_builds_list_builds -> crate::models::ServersListBuildsResponse servers_builds_list_builds(tags, game_id) +> crate::models::GamesServersListBuildsResponse games_servers_builds_list_builds(game_id, tags, game_id2) Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. @@ -52,12 +53,13 @@ Lists all builds of the game associated with the token used. Can be filtered by Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **tags** | Option<**String**> | | | -**game_id** | Option<**uuid::Uuid**> | | | +**game_id2** | Option<**uuid::Uuid**> | | | ### Return type -[**crate::models::ServersListBuildsResponse**](ServersListBuildsResponse.md) +[**crate::models::GamesServersListBuildsResponse**](GamesServersListBuildsResponse.md) ### Authorization @@ -71,9 +73,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_builds_prepare_build +## games_servers_builds_prepare_build -> crate::models::ServersCreateBuildResponse servers_builds_prepare_build(servers_create_build_request) +> crate::models::GamesServersCreateBuildResponse games_servers_builds_prepare_build(game_id, games_servers_create_build_request) Creates a new game build for the given game. @@ -83,11 +85,12 @@ Creates a new game build for the given game. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**servers_create_build_request** | [**ServersCreateBuildRequest**](ServersCreateBuildRequest.md) | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**games_servers_create_build_request** | [**GamesServersCreateBuildRequest**](GamesServersCreateBuildRequest.md) | | [required] | ### Return type -[**crate::models::ServersCreateBuildResponse**](ServersCreateBuildResponse.md) +[**crate::models::GamesServersCreateBuildResponse**](GamesServersCreateBuildResponse.md) ### Authorization diff --git a/sdks/full/rust-cli/docs/ServersCreateBuildRequest.md b/sdks/full/rust-cli/docs/GamesServersCreateBuildRequest.md similarity index 70% rename from sdks/full/rust-cli/docs/ServersCreateBuildRequest.md rename to sdks/full/rust-cli/docs/GamesServersCreateBuildRequest.md index 1c96d10698..28704e2c42 100644 --- a/sdks/full/rust-cli/docs/ServersCreateBuildRequest.md +++ b/sdks/full/rust-cli/docs/GamesServersCreateBuildRequest.md @@ -1,14 +1,14 @@ -# ServersCreateBuildRequest +# GamesServersCreateBuildRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**compression** | Option<[**crate::models::ServersBuildCompression**](ServersBuildCompression.md)> | | [optional] +**compression** | Option<[**crate::models::GamesServersBuildCompression**](GamesServersBuildCompression.md)> | | [optional] **display_name** | **String** | Represent a resource's readable display name. | **image_file** | [**crate::models::UploadPrepareFile**](UploadPrepareFile.md) | | **image_tag** | **String** | A tag given to the game build. | -**kind** | Option<[**crate::models::ServersBuildKind**](ServersBuildKind.md)> | | [optional] +**kind** | Option<[**crate::models::GamesServersBuildKind**](GamesServersBuildKind.md)> | | [optional] **multipart_upload** | Option<**bool**> | | [optional] **tags** | Option<[**serde_json::Value**](.md)> | | diff --git a/sdks/full/rust/docs/ServersCreateBuildResponse.md b/sdks/full/rust-cli/docs/GamesServersCreateBuildResponse.md similarity index 94% rename from sdks/full/rust/docs/ServersCreateBuildResponse.md rename to sdks/full/rust-cli/docs/GamesServersCreateBuildResponse.md index e5c3a19f8c..79f0e47fd5 100644 --- a/sdks/full/rust/docs/ServersCreateBuildResponse.md +++ b/sdks/full/rust-cli/docs/GamesServersCreateBuildResponse.md @@ -1,4 +1,4 @@ -# ServersCreateBuildResponse +# GamesServersCreateBuildResponse ## Properties diff --git a/sdks/full/rust/docs/ServersCreateServerNetworkRequest.md b/sdks/full/rust-cli/docs/GamesServersCreateServerNetworkRequest.md similarity index 58% rename from sdks/full/rust/docs/ServersCreateServerNetworkRequest.md rename to sdks/full/rust-cli/docs/GamesServersCreateServerNetworkRequest.md index 633ac595fa..d8b3687ebe 100644 --- a/sdks/full/rust/docs/ServersCreateServerNetworkRequest.md +++ b/sdks/full/rust-cli/docs/GamesServersCreateServerNetworkRequest.md @@ -1,11 +1,11 @@ -# ServersCreateServerNetworkRequest +# GamesServersCreateServerNetworkRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | Option<[**crate::models::ServersNetworkMode**](ServersNetworkMode.md)> | | [optional] -**ports** | [**::std::collections::HashMap**](ServersCreateServerPortRequest.md) | | +**mode** | Option<[**crate::models::GamesServersNetworkMode**](GamesServersNetworkMode.md)> | | [optional] +**ports** | [**::std::collections::HashMap**](GamesServersCreateServerPortRequest.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/full/rust/docs/ServersCreateServerPortRequest.md b/sdks/full/rust-cli/docs/GamesServersCreateServerPortRequest.md similarity index 57% rename from sdks/full/rust/docs/ServersCreateServerPortRequest.md rename to sdks/full/rust-cli/docs/GamesServersCreateServerPortRequest.md index 97c550c60d..69cae1d44d 100644 --- a/sdks/full/rust/docs/ServersCreateServerPortRequest.md +++ b/sdks/full/rust-cli/docs/GamesServersCreateServerPortRequest.md @@ -1,12 +1,12 @@ -# ServersCreateServerPortRequest +# GamesServersCreateServerPortRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **internal_port** | Option<**i32**> | | [optional] -**protocol** | [**crate::models::ServersPortProtocol**](ServersPortProtocol.md) | | -**routing** | Option<[**crate::models::ServersPortRouting**](ServersPortRouting.md)> | | [optional] +**protocol** | [**crate::models::GamesServersPortProtocol**](GamesServersPortProtocol.md) | | +**routing** | Option<[**crate::models::GamesServersPortRouting**](GamesServersPortRouting.md)> | | [optional] [[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/full/rust/docs/ServersCreateServerRequest.md b/sdks/full/rust-cli/docs/GamesServersCreateServerRequest.md similarity index 78% rename from sdks/full/rust/docs/ServersCreateServerRequest.md rename to sdks/full/rust-cli/docs/GamesServersCreateServerRequest.md index 382da90515..e7777a44a9 100644 --- a/sdks/full/rust/docs/ServersCreateServerRequest.md +++ b/sdks/full/rust-cli/docs/GamesServersCreateServerRequest.md @@ -1,4 +1,4 @@ -# ServersCreateServerRequest +# GamesServersCreateServerRequest ## Properties @@ -9,8 +9,8 @@ Name | Type | Description | Notes **environment** | Option<**::std::collections::HashMap**> | | [optional] **image_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be set to a safe default, and can be overridden during a DELETE request if needed. | [optional] -**network** | [**crate::models::ServersCreateServerNetworkRequest**](ServersCreateServerNetworkRequest.md) | | -**resources** | [**crate::models::ServersResources**](ServersResources.md) | | +**network** | [**crate::models::GamesServersCreateServerNetworkRequest**](GamesServersCreateServerNetworkRequest.md) | | +**resources** | [**crate::models::GamesServersResources**](GamesServersResources.md) | | **tags** | Option<[**serde_json::Value**](.md)> | | **webhook_url** | Option<**String**> | A url to send to which events from the server running will be sent | [optional] diff --git a/sdks/full/rust-cli/docs/GamesServersCreateServerResponse.md b/sdks/full/rust-cli/docs/GamesServersCreateServerResponse.md new file mode 100644 index 0000000000..14a798c6e8 --- /dev/null +++ b/sdks/full/rust-cli/docs/GamesServersCreateServerResponse.md @@ -0,0 +1,11 @@ +# GamesServersCreateServerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server** | [**crate::models::GamesServersServer**](GamesServersServer.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/full/rust-cli/docs/ServersGetServerLogsResponse.md b/sdks/full/rust-cli/docs/GamesServersGetServerLogsResponse.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersGetServerLogsResponse.md rename to sdks/full/rust-cli/docs/GamesServersGetServerLogsResponse.md index ed594b4b5f..0426f6eaa1 100644 --- a/sdks/full/rust-cli/docs/ServersGetServerLogsResponse.md +++ b/sdks/full/rust-cli/docs/GamesServersGetServerLogsResponse.md @@ -1,4 +1,4 @@ -# ServersGetServerLogsResponse +# GamesServersGetServerLogsResponse ## Properties diff --git a/sdks/full/rust-cli/docs/ServersDestroyServerResponse.md b/sdks/full/rust-cli/docs/GamesServersGetServerResponse.md similarity index 70% rename from sdks/full/rust-cli/docs/ServersDestroyServerResponse.md rename to sdks/full/rust-cli/docs/GamesServersGetServerResponse.md index 0cf193ed7a..b7b9da81b8 100644 --- a/sdks/full/rust-cli/docs/ServersDestroyServerResponse.md +++ b/sdks/full/rust-cli/docs/GamesServersGetServerResponse.md @@ -1,10 +1,10 @@ -# ServersDestroyServerResponse +# GamesServersGetServerResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**server_id** | [**uuid::Uuid**](uuid::Uuid.md) | | +**server** | [**crate::models::GamesServersServer**](GamesServersServer.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/full/rust-cli/docs/ServersListBuildsResponse.md b/sdks/full/rust-cli/docs/GamesServersListBuildsResponse.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersListBuildsResponse.md rename to sdks/full/rust-cli/docs/GamesServersListBuildsResponse.md index 2135664842..0618f5a490 100644 --- a/sdks/full/rust-cli/docs/ServersListBuildsResponse.md +++ b/sdks/full/rust-cli/docs/GamesServersListBuildsResponse.md @@ -1,4 +1,4 @@ -# ServersListBuildsResponse +# GamesServersListBuildsResponse ## Properties diff --git a/sdks/full/rust-cli/docs/GamesServersListServersResponse.md b/sdks/full/rust-cli/docs/GamesServersListServersResponse.md new file mode 100644 index 0000000000..54fa85b8fd --- /dev/null +++ b/sdks/full/rust-cli/docs/GamesServersListServersResponse.md @@ -0,0 +1,11 @@ +# GamesServersListServersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**servers** | [**Vec**](GamesServersServer.md) | A list of servers for the game associated with the token. | + +[[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/full/rust-cli/docs/ServersBuildKind.md b/sdks/full/rust-cli/docs/GamesServersLogStream.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersBuildKind.md rename to sdks/full/rust-cli/docs/GamesServersLogStream.md index 6fc399d0e0..9749bf1b9a 100644 --- a/sdks/full/rust-cli/docs/ServersBuildKind.md +++ b/sdks/full/rust-cli/docs/GamesServersLogStream.md @@ -1,4 +1,4 @@ -# ServersBuildKind +# GamesServersLogStream ## Properties diff --git a/sdks/full/rust/docs/ServersLogsApi.md b/sdks/full/rust-cli/docs/GamesServersLogsApi.md similarity index 57% rename from sdks/full/rust/docs/ServersLogsApi.md rename to sdks/full/rust-cli/docs/GamesServersLogsApi.md index da6ba86641..133558d7f8 100644 --- a/sdks/full/rust/docs/ServersLogsApi.md +++ b/sdks/full/rust-cli/docs/GamesServersLogsApi.md @@ -1,16 +1,16 @@ -# \ServersLogsApi +# \GamesServersLogsApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_logs_get_server_logs**](ServersLogsApi.md#servers_logs_get_server_logs) | **GET** /servers/{server_id}/logs | +[**games_servers_logs_get_server_logs**](GamesServersLogsApi.md#games_servers_logs_get_server_logs) | **GET** /games/{game_id}/servers/{server_id}/logs | -## servers_logs_get_server_logs +## games_servers_logs_get_server_logs -> crate::models::ServersGetServerLogsResponse servers_logs_get_server_logs(server_id, stream, game_id, watch_index) +> crate::models::GamesServersGetServerLogsResponse games_servers_logs_get_server_logs(game_id, server_id, stream, game_id2, watch_index) Returns the logs for a given server. @@ -20,14 +20,15 @@ Returns the logs for a given server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | | [required] | -**stream** | [**ServersLogStream**](.md) | | [required] | -**game_id** | Option<**uuid::Uuid**> | | | +**stream** | [**GamesServersLogStream**](.md) | | [required] | +**game_id2** | Option<**uuid::Uuid**> | | | **watch_index** | Option<**String**> | A query parameter denoting the requests watch index. | | ### Return type -[**crate::models::ServersGetServerLogsResponse**](ServersGetServerLogsResponse.md) +[**crate::models::GamesServersGetServerLogsResponse**](GamesServersGetServerLogsResponse.md) ### Authorization diff --git a/sdks/full/rust-cli/docs/ServersNetwork.md b/sdks/full/rust-cli/docs/GamesServersNetwork.md similarity index 65% rename from sdks/full/rust-cli/docs/ServersNetwork.md rename to sdks/full/rust-cli/docs/GamesServersNetwork.md index e1b819556d..71f789fdca 100644 --- a/sdks/full/rust-cli/docs/ServersNetwork.md +++ b/sdks/full/rust-cli/docs/GamesServersNetwork.md @@ -1,11 +1,11 @@ -# ServersNetwork +# GamesServersNetwork ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | Option<[**crate::models::ServersNetworkMode**](ServersNetworkMode.md)> | | [optional] -**ports** | [**::std::collections::HashMap**](ServersPort.md) | | +**mode** | Option<[**crate::models::GamesServersNetworkMode**](GamesServersNetworkMode.md)> | | [optional] +**ports** | [**::std::collections::HashMap**](GamesServersPort.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/full/rust-cli/docs/ServersBuildCompression.md b/sdks/full/rust-cli/docs/GamesServersNetworkMode.md similarity index 91% rename from sdks/full/rust-cli/docs/ServersBuildCompression.md rename to sdks/full/rust-cli/docs/GamesServersNetworkMode.md index 3e1b76a053..307c5f2b5f 100644 --- a/sdks/full/rust-cli/docs/ServersBuildCompression.md +++ b/sdks/full/rust-cli/docs/GamesServersNetworkMode.md @@ -1,4 +1,4 @@ -# ServersBuildCompression +# GamesServersNetworkMode ## Properties diff --git a/sdks/full/rust-cli/docs/ServersPort.md b/sdks/full/rust-cli/docs/GamesServersPort.md similarity index 67% rename from sdks/full/rust-cli/docs/ServersPort.md rename to sdks/full/rust-cli/docs/GamesServersPort.md index 5ade4ddd58..da477f5485 100644 --- a/sdks/full/rust-cli/docs/ServersPort.md +++ b/sdks/full/rust-cli/docs/GamesServersPort.md @@ -1,14 +1,14 @@ -# ServersPort +# GamesServersPort ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **internal_port** | Option<**i32**> | | [optional] -**protocol** | [**crate::models::ServersPortProtocol**](ServersPortProtocol.md) | | +**protocol** | [**crate::models::GamesServersPortProtocol**](GamesServersPortProtocol.md) | | **public_hostname** | Option<**String**> | | [optional] **public_port** | Option<**i32**> | | [optional] -**routing** | [**crate::models::ServersPortRouting**](ServersPortRouting.md) | | +**routing** | [**crate::models::GamesServersPortRouting**](GamesServersPortRouting.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/full/rust-cli/docs/GamesServersPortProtocol.md b/sdks/full/rust-cli/docs/GamesServersPortProtocol.md new file mode 100644 index 0000000000..e13be068da --- /dev/null +++ b/sdks/full/rust-cli/docs/GamesServersPortProtocol.md @@ -0,0 +1,10 @@ +# GamesServersPortProtocol + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/full/rust-cli/docs/ServersPortRouting.md b/sdks/full/rust-cli/docs/GamesServersPortRouting.md similarity index 94% rename from sdks/full/rust-cli/docs/ServersPortRouting.md rename to sdks/full/rust-cli/docs/GamesServersPortRouting.md index 1ac474c230..12aa111c32 100644 --- a/sdks/full/rust-cli/docs/ServersPortRouting.md +++ b/sdks/full/rust-cli/docs/GamesServersPortRouting.md @@ -1,4 +1,4 @@ -# ServersPortRouting +# GamesServersPortRouting ## Properties diff --git a/sdks/full/rust-cli/docs/ServersResources.md b/sdks/full/rust-cli/docs/GamesServersResources.md similarity index 95% rename from sdks/full/rust-cli/docs/ServersResources.md rename to sdks/full/rust-cli/docs/GamesServersResources.md index 3b3f9d6882..236dd811f1 100644 --- a/sdks/full/rust-cli/docs/ServersResources.md +++ b/sdks/full/rust-cli/docs/GamesServersResources.md @@ -1,4 +1,4 @@ -# ServersResources +# GamesServersResources ## Properties diff --git a/sdks/full/rust/docs/ServersServer.md b/sdks/full/rust-cli/docs/GamesServersServer.md similarity index 84% rename from sdks/full/rust/docs/ServersServer.md rename to sdks/full/rust-cli/docs/GamesServersServer.md index d62789a202..372cc31502 100644 --- a/sdks/full/rust/docs/ServersServer.md +++ b/sdks/full/rust-cli/docs/GamesServersServer.md @@ -1,4 +1,4 @@ -# ServersServer +# GamesServersServer ## Properties @@ -13,8 +13,8 @@ Name | Type | Description | Notes **game_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **image_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be set to a safe default, and can be overridden during a DELETE request if needed. | [optional] -**network** | [**crate::models::ServersNetwork**](ServersNetwork.md) | | -**resources** | [**crate::models::ServersResources**](ServersResources.md) | | +**network** | [**crate::models::GamesServersNetwork**](GamesServersNetwork.md) | | +**resources** | [**crate::models::GamesServersResources**](GamesServersResources.md) | | **server_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **start_ts** | Option<**i64**> | | [optional] **tags** | Option<[**serde_json::Value**](.md)> | | diff --git a/sdks/full/rust-cli/docs/ServersGetServerResponse.md b/sdks/full/rust-cli/docs/ServersGetServerResponse.md deleted file mode 100644 index f5e5e42f86..0000000000 --- a/sdks/full/rust-cli/docs/ServersGetServerResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersGetServerResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**server** | [**crate::models::ServersServer**](ServersServer.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/full/rust-cli/docs/ServersListServersResponse.md b/sdks/full/rust-cli/docs/ServersListServersResponse.md deleted file mode 100644 index b1c8e2d66a..0000000000 --- a/sdks/full/rust-cli/docs/ServersListServersResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersListServersResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**servers** | [**Vec**](ServersServer.md) | A list of servers for the game associated with the token. | - -[[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/full/rust/src/apis/servers_api.rs b/sdks/full/rust-cli/src/apis/games_servers_api.rs similarity index 74% rename from sdks/full/rust/src/apis/servers_api.rs rename to sdks/full/rust-cli/src/apis/games_servers_api.rs index 9fb0383929..2e6678c1e5 100644 --- a/sdks/full/rust/src/apis/servers_api.rs +++ b/sdks/full/rust-cli/src/apis/games_servers_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_create`] +/// struct for typed errors of method [`games_servers_create`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersCreateError { +pub enum GamesServersCreateError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -28,10 +28,10 @@ pub enum ServersCreateError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_destroy`] +/// struct for typed errors of method [`games_servers_destroy`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersDestroyError { +pub enum GamesServersDestroyError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -41,10 +41,10 @@ pub enum ServersDestroyError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_get`] +/// struct for typed errors of method [`games_servers_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersGetError { +pub enum GamesServersGetError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -54,10 +54,10 @@ pub enum ServersGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_list`] +/// struct for typed errors of method [`games_servers_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersListError { +pub enum GamesServersListError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -69,12 +69,12 @@ pub enum ServersListError { /// Create a new dynamic server. -pub async fn servers_create(configuration: &configuration::Configuration, servers_create_server_request: crate::models::ServersCreateServerRequest) -> Result> { +pub async fn games_servers_create(configuration: &configuration::Configuration, game_id: &str, games_servers_create_server_request: crate::models::GamesServersCreateServerRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/servers", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -83,7 +83,7 @@ pub async fn servers_create(configuration: &configuration::Configuration, server if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; - local_var_req_builder = local_var_req_builder.json(&servers_create_server_request); + local_var_req_builder = local_var_req_builder.json(&games_servers_create_server_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -94,19 +94,19 @@ pub async fn servers_create(configuration: &configuration::Configuration, server if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Destroy a dynamic server. -pub async fn servers_destroy(configuration: &configuration::Configuration, server_id: &str, override_kill_timeout: Option) -> Result> { +pub async fn games_servers_destroy(configuration: &configuration::Configuration, game_id: &str, server_id: &str, override_kill_timeout: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_str) = override_kill_timeout { @@ -128,19 +128,19 @@ pub async fn servers_destroy(configuration: &configuration::Configuration, serve if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Gets a dynamic server. -pub async fn servers_get(configuration: &configuration::Configuration, server_id: &str) -> Result> { +pub async fn games_servers_get(configuration: &configuration::Configuration, game_id: &str, server_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -159,25 +159,25 @@ pub async fn servers_get(configuration: &configuration::Configuration, server_id if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Lists all servers associated with the token used. Can be filtered by tags in the query string. -pub async fn servers_list(configuration: &configuration::Configuration, tags: Option<&str>, game_id: Option<&str>) -> Result> { +pub async fn games_servers_list(configuration: &configuration::Configuration, game_id: &str, tags: Option<&str>, game_id2: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/servers", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = tags { local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -196,7 +196,7 @@ pub async fn servers_list(configuration: &configuration::Configuration, tags: Op if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust-cli/src/apis/servers_builds_api.rs b/sdks/full/rust-cli/src/apis/games_servers_builds_api.rs similarity index 72% rename from sdks/full/rust-cli/src/apis/servers_builds_api.rs rename to sdks/full/rust-cli/src/apis/games_servers_builds_api.rs index 496a1d874a..95d4950995 100644 --- a/sdks/full/rust-cli/src/apis/servers_builds_api.rs +++ b/sdks/full/rust-cli/src/apis/games_servers_builds_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_builds_complete_build`] +/// struct for typed errors of method [`games_servers_builds_complete_build`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsCompleteBuildError { +pub enum GamesServersBuildsCompleteBuildError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -28,10 +28,10 @@ pub enum ServersBuildsCompleteBuildError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_builds_list_builds`] +/// struct for typed errors of method [`games_servers_builds_list_builds`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsListBuildsError { +pub enum GamesServersBuildsListBuildsError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -41,10 +41,10 @@ pub enum ServersBuildsListBuildsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_builds_prepare_build`] +/// struct for typed errors of method [`games_servers_builds_prepare_build`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsPrepareBuildError { +pub enum GamesServersBuildsPrepareBuildError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -56,12 +56,12 @@ pub enum ServersBuildsPrepareBuildError { /// Marks an upload as complete. -pub async fn servers_builds_complete_build(configuration: &configuration::Configuration, upload_id: &str) -> Result<(), Error> { +pub async fn games_servers_builds_complete_build(configuration: &configuration::Configuration, game_id: &str, build_id: &str) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/uploads/{upload_id}/complete", local_var_configuration.base_path, upload_id=crate::apis::urlencode(upload_id)); + let local_var_uri_str = format!("{}/games/{game_id}/builds/{build_id}/complete", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), build_id=crate::apis::urlencode(build_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -80,25 +80,25 @@ pub async fn servers_builds_complete_build(configuration: &configuration::Config if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. -pub async fn servers_builds_list_builds(configuration: &configuration::Configuration, tags: Option<&str>, game_id: Option<&str>) -> Result> { +pub async fn games_servers_builds_list_builds(configuration: &configuration::Configuration, game_id: &str, tags: Option<&str>, game_id2: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/builds", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/builds", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = tags { local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -117,19 +117,19 @@ pub async fn servers_builds_list_builds(configuration: &configuration::Configura if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Creates a new game build for the given game. -pub async fn servers_builds_prepare_build(configuration: &configuration::Configuration, servers_create_build_request: crate::models::ServersCreateBuildRequest) -> Result> { +pub async fn games_servers_builds_prepare_build(configuration: &configuration::Configuration, game_id: &str, games_servers_create_build_request: crate::models::GamesServersCreateBuildRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/builds", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/builds/prepare", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -138,7 +138,7 @@ pub async fn servers_builds_prepare_build(configuration: &configuration::Configu if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; - local_var_req_builder = local_var_req_builder.json(&servers_create_build_request); + local_var_req_builder = local_var_req_builder.json(&games_servers_create_build_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -149,7 +149,7 @@ pub async fn servers_builds_prepare_build(configuration: &configuration::Configu if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust/src/apis/servers_logs_api.rs b/sdks/full/rust-cli/src/apis/games_servers_logs_api.rs similarity index 73% rename from sdks/full/rust/src/apis/servers_logs_api.rs rename to sdks/full/rust-cli/src/apis/games_servers_logs_api.rs index 1314d6f921..a277a8dfe4 100644 --- a/sdks/full/rust/src/apis/servers_logs_api.rs +++ b/sdks/full/rust-cli/src/apis/games_servers_logs_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_logs_get_server_logs`] +/// struct for typed errors of method [`games_servers_logs_get_server_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersLogsGetServerLogsError { +pub enum GamesServersLogsGetServerLogsError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -30,16 +30,16 @@ pub enum ServersLogsGetServerLogsError { /// Returns the logs for a given server. -pub async fn servers_logs_get_server_logs(configuration: &configuration::Configuration, server_id: &str, stream: crate::models::ServersLogStream, game_id: Option<&str>, watch_index: Option<&str>) -> Result> { +pub async fn games_servers_logs_get_server_logs(configuration: &configuration::Configuration, game_id: &str, server_id: &str, stream: crate::models::GamesServersLogStream, game_id2: Option<&str>, watch_index: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}/logs", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}/logs", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("stream", &stream.to_string())]); - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_str) = watch_index { @@ -61,7 +61,7 @@ pub async fn servers_logs_get_server_logs(configuration: &configuration::Configu if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust-cli/src/apis/mod.rs b/sdks/full/rust-cli/src/apis/mod.rs index 11b380d655..505fa0f688 100644 --- a/sdks/full/rust-cli/src/apis/mod.rs +++ b/sdks/full/rust-cli/src/apis/mod.rs @@ -114,6 +114,9 @@ pub mod cloud_groups_api; pub mod cloud_logs_api; pub mod cloud_tiers_api; pub mod cloud_uploads_api; +pub mod games_servers_api; +pub mod games_servers_builds_api; +pub mod games_servers_logs_api; pub mod group_api; pub mod group_invites_api; pub mod group_join_requests_api; @@ -129,8 +132,5 @@ pub mod matchmaker_regions_api; pub mod portal_games_api; pub mod provision_datacenters_api; pub mod provision_servers_api; -pub mod servers_api; -pub mod servers_builds_api; -pub mod servers_logs_api; pub mod configuration; diff --git a/sdks/full/rust-cli/src/models/servers_build_compression.rs b/sdks/full/rust-cli/src/models/games_servers_build_compression.rs similarity index 76% rename from sdks/full/rust-cli/src/models/servers_build_compression.rs rename to sdks/full/rust-cli/src/models/games_servers_build_compression.rs index fd549d6279..91ec708e80 100644 --- a/sdks/full/rust-cli/src/models/servers_build_compression.rs +++ b/sdks/full/rust-cli/src/models/games_servers_build_compression.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersBuildCompression { +pub enum GamesServersBuildCompression { #[serde(rename = "none")] None, #[serde(rename = "lz4")] @@ -19,7 +19,7 @@ pub enum ServersBuildCompression { } -impl ToString for ServersBuildCompression { +impl ToString for GamesServersBuildCompression { fn to_string(&self) -> String { match self { Self::None => String::from("none"), @@ -28,8 +28,8 @@ impl ToString for ServersBuildCompression { } } -impl Default for ServersBuildCompression { - fn default() -> ServersBuildCompression { +impl Default for GamesServersBuildCompression { + fn default() -> GamesServersBuildCompression { Self::None } } diff --git a/sdks/full/rust/src/models/servers_build_kind.rs b/sdks/full/rust-cli/src/models/games_servers_build_kind.rs similarity index 80% rename from sdks/full/rust/src/models/servers_build_kind.rs rename to sdks/full/rust-cli/src/models/games_servers_build_kind.rs index 853abbb0e7..1886fd0941 100644 --- a/sdks/full/rust/src/models/servers_build_kind.rs +++ b/sdks/full/rust-cli/src/models/games_servers_build_kind.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersBuildKind { +pub enum GamesServersBuildKind { #[serde(rename = "docker_image")] DockerImage, #[serde(rename = "oci_bundle")] @@ -19,7 +19,7 @@ pub enum ServersBuildKind { } -impl ToString for ServersBuildKind { +impl ToString for GamesServersBuildKind { fn to_string(&self) -> String { match self { Self::DockerImage => String::from("docker_image"), @@ -28,8 +28,8 @@ impl ToString for ServersBuildKind { } } -impl Default for ServersBuildKind { - fn default() -> ServersBuildKind { +impl Default for GamesServersBuildKind { + fn default() -> GamesServersBuildKind { Self::DockerImage } } diff --git a/sdks/full/rust/src/models/servers_create_build_request.rs b/sdks/full/rust-cli/src/models/games_servers_create_build_request.rs similarity index 81% rename from sdks/full/rust/src/models/servers_create_build_request.rs rename to sdks/full/rust-cli/src/models/games_servers_create_build_request.rs index 395fe9aeb6..77aa1f62a0 100644 --- a/sdks/full/rust/src/models/servers_create_build_request.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_build_request.rs @@ -12,9 +12,9 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateBuildRequest { +pub struct GamesServersCreateBuildRequest { #[serde(rename = "compression", skip_serializing_if = "Option::is_none")] - pub compression: Option, + pub compression: Option, /// Represent a resource's readable display name. #[serde(rename = "display_name")] pub display_name: String, @@ -24,16 +24,16 @@ pub struct ServersCreateBuildRequest { #[serde(rename = "image_tag")] pub image_tag: String, #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] - pub kind: Option, + pub kind: Option, #[serde(rename = "multipart_upload", skip_serializing_if = "Option::is_none")] pub multipart_upload: Option, #[serde(rename = "tags", deserialize_with = "Option::deserialize")] pub tags: Option, } -impl ServersCreateBuildRequest { - pub fn new(display_name: String, image_file: crate::models::UploadPrepareFile, image_tag: String, tags: Option) -> ServersCreateBuildRequest { - ServersCreateBuildRequest { +impl GamesServersCreateBuildRequest { + pub fn new(display_name: String, image_file: crate::models::UploadPrepareFile, image_tag: String, tags: Option) -> GamesServersCreateBuildRequest { + GamesServersCreateBuildRequest { compression: None, display_name, image_file: Box::new(image_file), diff --git a/sdks/full/rust/src/models/servers_create_build_response.rs b/sdks/full/rust-cli/src/models/games_servers_create_build_response.rs similarity index 80% rename from sdks/full/rust/src/models/servers_create_build_response.rs rename to sdks/full/rust-cli/src/models/games_servers_create_build_response.rs index 551e3030bf..e199d6330e 100644 --- a/sdks/full/rust/src/models/servers_create_build_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_build_response.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateBuildResponse { +pub struct GamesServersCreateBuildResponse { #[serde(rename = "build_id")] pub build_id: uuid::Uuid, #[serde(rename = "image_presigned_request", skip_serializing_if = "Option::is_none")] @@ -23,9 +23,9 @@ pub struct ServersCreateBuildResponse { pub upload_id: uuid::Uuid, } -impl ServersCreateBuildResponse { - pub fn new(build_id: uuid::Uuid, upload_id: uuid::Uuid) -> ServersCreateBuildResponse { - ServersCreateBuildResponse { +impl GamesServersCreateBuildResponse { + pub fn new(build_id: uuid::Uuid, upload_id: uuid::Uuid) -> GamesServersCreateBuildResponse { + GamesServersCreateBuildResponse { build_id, image_presigned_request: None, image_presigned_requests: None, diff --git a/sdks/full/rust/src/models/servers_create_server_network_request.rs b/sdks/full/rust-cli/src/models/games_servers_create_server_network_request.rs similarity index 63% rename from sdks/full/rust/src/models/servers_create_server_network_request.rs rename to sdks/full/rust-cli/src/models/games_servers_create_server_network_request.rs index d469cc181d..3bf3d7c187 100644 --- a/sdks/full/rust/src/models/servers_create_server_network_request.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_server_network_request.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerNetworkRequest { +pub struct GamesServersCreateServerNetworkRequest { #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, + pub mode: Option, #[serde(rename = "ports")] - pub ports: ::std::collections::HashMap, + pub ports: ::std::collections::HashMap, } -impl ServersCreateServerNetworkRequest { - pub fn new(ports: ::std::collections::HashMap) -> ServersCreateServerNetworkRequest { - ServersCreateServerNetworkRequest { +impl GamesServersCreateServerNetworkRequest { + pub fn new(ports: ::std::collections::HashMap) -> GamesServersCreateServerNetworkRequest { + GamesServersCreateServerNetworkRequest { mode: None, ports, } diff --git a/sdks/full/rust-cli/src/models/servers_create_server_port_request.rs b/sdks/full/rust-cli/src/models/games_servers_create_server_port_request.rs similarity index 62% rename from sdks/full/rust-cli/src/models/servers_create_server_port_request.rs rename to sdks/full/rust-cli/src/models/games_servers_create_server_port_request.rs index d818685f71..7f8bb7f5f3 100644 --- a/sdks/full/rust-cli/src/models/servers_create_server_port_request.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_server_port_request.rs @@ -12,18 +12,18 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerPortRequest { +pub struct GamesServersCreateServerPortRequest { #[serde(rename = "internal_port", skip_serializing_if = "Option::is_none")] pub internal_port: Option, #[serde(rename = "protocol")] - pub protocol: crate::models::ServersPortProtocol, + pub protocol: crate::models::GamesServersPortProtocol, #[serde(rename = "routing", skip_serializing_if = "Option::is_none")] - pub routing: Option>, + pub routing: Option>, } -impl ServersCreateServerPortRequest { - pub fn new(protocol: crate::models::ServersPortProtocol) -> ServersCreateServerPortRequest { - ServersCreateServerPortRequest { +impl GamesServersCreateServerPortRequest { + pub fn new(protocol: crate::models::GamesServersPortProtocol) -> GamesServersCreateServerPortRequest { + GamesServersCreateServerPortRequest { internal_port: None, protocol, routing: None, diff --git a/sdks/full/rust/src/models/servers_create_server_request.rs b/sdks/full/rust-cli/src/models/games_servers_create_server_request.rs similarity index 79% rename from sdks/full/rust/src/models/servers_create_server_request.rs rename to sdks/full/rust-cli/src/models/games_servers_create_server_request.rs index e50b4b9541..8b132e9b05 100644 --- a/sdks/full/rust/src/models/servers_create_server_request.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_server_request.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerRequest { +pub struct GamesServersCreateServerRequest { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, /// The name ID of the datacenter @@ -26,9 +26,9 @@ pub struct ServersCreateServerRequest { #[serde(rename = "kill_timeout", skip_serializing_if = "Option::is_none")] pub kill_timeout: Option, #[serde(rename = "network")] - pub network: Box, + pub network: Box, #[serde(rename = "resources")] - pub resources: Box, + pub resources: Box, #[serde(rename = "tags", deserialize_with = "Option::deserialize")] pub tags: Option, /// A url to send to which events from the server running will be sent @@ -36,9 +36,9 @@ pub struct ServersCreateServerRequest { pub webhook_url: Option, } -impl ServersCreateServerRequest { - pub fn new(datacenter: String, image_id: uuid::Uuid, network: crate::models::ServersCreateServerNetworkRequest, resources: crate::models::ServersResources, tags: Option) -> ServersCreateServerRequest { - ServersCreateServerRequest { +impl GamesServersCreateServerRequest { + pub fn new(datacenter: String, image_id: uuid::Uuid, network: crate::models::GamesServersCreateServerNetworkRequest, resources: crate::models::GamesServersResources, tags: Option) -> GamesServersCreateServerRequest { + GamesServersCreateServerRequest { arguments: None, datacenter, environment: None, diff --git a/sdks/full/rust-cli/src/models/servers_get_server_response.rs b/sdks/full/rust-cli/src/models/games_servers_create_server_response.rs similarity index 58% rename from sdks/full/rust-cli/src/models/servers_get_server_response.rs rename to sdks/full/rust-cli/src/models/games_servers_create_server_response.rs index 2f017da813..e0ad46d243 100644 --- a/sdks/full/rust-cli/src/models/servers_get_server_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_create_server_response.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersGetServerResponse { +pub struct GamesServersCreateServerResponse { #[serde(rename = "server")] - pub server: Box, + pub server: Box, } -impl ServersGetServerResponse { - pub fn new(server: crate::models::ServersServer) -> ServersGetServerResponse { - ServersGetServerResponse { +impl GamesServersCreateServerResponse { + pub fn new(server: crate::models::GamesServersServer) -> GamesServersCreateServerResponse { + GamesServersCreateServerResponse { server: Box::new(server), } } diff --git a/sdks/full/rust-cli/src/models/servers_get_server_logs_response.rs b/sdks/full/rust-cli/src/models/games_servers_get_server_logs_response.rs similarity index 78% rename from sdks/full/rust-cli/src/models/servers_get_server_logs_response.rs rename to sdks/full/rust-cli/src/models/games_servers_get_server_logs_response.rs index dd6df5a770..2b70761837 100644 --- a/sdks/full/rust-cli/src/models/servers_get_server_logs_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_get_server_logs_response.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersGetServerLogsResponse { +pub struct GamesServersGetServerLogsResponse { /// Sorted old to new. #[serde(rename = "lines")] pub lines: Vec, @@ -23,9 +23,9 @@ pub struct ServersGetServerLogsResponse { pub watch: Box, } -impl ServersGetServerLogsResponse { - pub fn new(lines: Vec, timestamps: Vec, watch: crate::models::WatchResponse) -> ServersGetServerLogsResponse { - ServersGetServerLogsResponse { +impl GamesServersGetServerLogsResponse { + pub fn new(lines: Vec, timestamps: Vec, watch: crate::models::WatchResponse) -> GamesServersGetServerLogsResponse { + GamesServersGetServerLogsResponse { lines, timestamps, watch: Box::new(watch), diff --git a/sdks/full/rust/src/models/servers_get_server_response.rs b/sdks/full/rust-cli/src/models/games_servers_get_server_response.rs similarity index 59% rename from sdks/full/rust/src/models/servers_get_server_response.rs rename to sdks/full/rust-cli/src/models/games_servers_get_server_response.rs index 2f017da813..9e1a147fe5 100644 --- a/sdks/full/rust/src/models/servers_get_server_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_get_server_response.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersGetServerResponse { +pub struct GamesServersGetServerResponse { #[serde(rename = "server")] - pub server: Box, + pub server: Box, } -impl ServersGetServerResponse { - pub fn new(server: crate::models::ServersServer) -> ServersGetServerResponse { - ServersGetServerResponse { +impl GamesServersGetServerResponse { + pub fn new(server: crate::models::GamesServersServer) -> GamesServersGetServerResponse { + GamesServersGetServerResponse { server: Box::new(server), } } diff --git a/sdks/full/rust/src/models/servers_list_builds_response.rs b/sdks/full/rust-cli/src/models/games_servers_list_builds_response.rs similarity index 78% rename from sdks/full/rust/src/models/servers_list_builds_response.rs rename to sdks/full/rust-cli/src/models/games_servers_list_builds_response.rs index 3bfdec824f..86a9771f1f 100644 --- a/sdks/full/rust/src/models/servers_list_builds_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_list_builds_response.rs @@ -12,15 +12,15 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersListBuildsResponse { +pub struct GamesServersListBuildsResponse { /// A list of builds for the game associated with the token. #[serde(rename = "builds")] pub builds: Vec, } -impl ServersListBuildsResponse { - pub fn new(builds: Vec) -> ServersListBuildsResponse { - ServersListBuildsResponse { +impl GamesServersListBuildsResponse { + pub fn new(builds: Vec) -> GamesServersListBuildsResponse { + GamesServersListBuildsResponse { builds, } } diff --git a/sdks/full/rust-cli/src/models/servers_list_servers_response.rs b/sdks/full/rust-cli/src/models/games_servers_list_servers_response.rs similarity index 61% rename from sdks/full/rust-cli/src/models/servers_list_servers_response.rs rename to sdks/full/rust-cli/src/models/games_servers_list_servers_response.rs index 202010aa26..9651221a82 100644 --- a/sdks/full/rust-cli/src/models/servers_list_servers_response.rs +++ b/sdks/full/rust-cli/src/models/games_servers_list_servers_response.rs @@ -12,15 +12,15 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersListServersResponse { +pub struct GamesServersListServersResponse { /// A list of servers for the game associated with the token. #[serde(rename = "servers")] - pub servers: Vec, + pub servers: Vec, } -impl ServersListServersResponse { - pub fn new(servers: Vec) -> ServersListServersResponse { - ServersListServersResponse { +impl GamesServersListServersResponse { + pub fn new(servers: Vec) -> GamesServersListServersResponse { + GamesServersListServersResponse { servers, } } diff --git a/sdks/full/rust/src/models/servers_log_stream.rs b/sdks/full/rust-cli/src/models/games_servers_log_stream.rs similarity index 80% rename from sdks/full/rust/src/models/servers_log_stream.rs rename to sdks/full/rust-cli/src/models/games_servers_log_stream.rs index b96bdda215..7194ee8d17 100644 --- a/sdks/full/rust/src/models/servers_log_stream.rs +++ b/sdks/full/rust-cli/src/models/games_servers_log_stream.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersLogStream { +pub enum GamesServersLogStream { #[serde(rename = "std_out")] StdOut, #[serde(rename = "std_err")] @@ -19,7 +19,7 @@ pub enum ServersLogStream { } -impl ToString for ServersLogStream { +impl ToString for GamesServersLogStream { fn to_string(&self) -> String { match self { Self::StdOut => String::from("std_out"), @@ -28,8 +28,8 @@ impl ToString for ServersLogStream { } } -impl Default for ServersLogStream { - fn default() -> ServersLogStream { +impl Default for GamesServersLogStream { + fn default() -> GamesServersLogStream { Self::StdOut } } diff --git a/sdks/full/rust-cli/src/models/servers_network.rs b/sdks/full/rust-cli/src/models/games_servers_network.rs similarity index 72% rename from sdks/full/rust-cli/src/models/servers_network.rs rename to sdks/full/rust-cli/src/models/games_servers_network.rs index 97bade5673..6d0d2c891c 100644 --- a/sdks/full/rust-cli/src/models/servers_network.rs +++ b/sdks/full/rust-cli/src/models/games_servers_network.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersNetwork { +pub struct GamesServersNetwork { #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, + pub mode: Option, #[serde(rename = "ports")] - pub ports: ::std::collections::HashMap, + pub ports: ::std::collections::HashMap, } -impl ServersNetwork { - pub fn new(ports: ::std::collections::HashMap) -> ServersNetwork { - ServersNetwork { +impl GamesServersNetwork { + pub fn new(ports: ::std::collections::HashMap) -> GamesServersNetwork { + GamesServersNetwork { mode: None, ports, } diff --git a/sdks/full/rust-cli/src/models/servers_network_mode.rs b/sdks/full/rust-cli/src/models/games_servers_network_mode.rs similarity index 78% rename from sdks/full/rust-cli/src/models/servers_network_mode.rs rename to sdks/full/rust-cli/src/models/games_servers_network_mode.rs index bbb9bd9a5b..78008e9dae 100644 --- a/sdks/full/rust-cli/src/models/servers_network_mode.rs +++ b/sdks/full/rust-cli/src/models/games_servers_network_mode.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersNetworkMode { +pub enum GamesServersNetworkMode { #[serde(rename = "bridge")] Bridge, #[serde(rename = "host")] @@ -19,7 +19,7 @@ pub enum ServersNetworkMode { } -impl ToString for ServersNetworkMode { +impl ToString for GamesServersNetworkMode { fn to_string(&self) -> String { match self { Self::Bridge => String::from("bridge"), @@ -28,8 +28,8 @@ impl ToString for ServersNetworkMode { } } -impl Default for ServersNetworkMode { - fn default() -> ServersNetworkMode { +impl Default for GamesServersNetworkMode { + fn default() -> GamesServersNetworkMode { Self::Bridge } } diff --git a/sdks/full/rust-cli/src/models/servers_port.rs b/sdks/full/rust-cli/src/models/games_servers_port.rs similarity index 72% rename from sdks/full/rust-cli/src/models/servers_port.rs rename to sdks/full/rust-cli/src/models/games_servers_port.rs index ab305ac1e4..958763e8e7 100644 --- a/sdks/full/rust-cli/src/models/servers_port.rs +++ b/sdks/full/rust-cli/src/models/games_servers_port.rs @@ -12,22 +12,22 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersPort { +pub struct GamesServersPort { #[serde(rename = "internal_port", skip_serializing_if = "Option::is_none")] pub internal_port: Option, #[serde(rename = "protocol")] - pub protocol: crate::models::ServersPortProtocol, + pub protocol: crate::models::GamesServersPortProtocol, #[serde(rename = "public_hostname", skip_serializing_if = "Option::is_none")] pub public_hostname: Option, #[serde(rename = "public_port", skip_serializing_if = "Option::is_none")] pub public_port: Option, #[serde(rename = "routing")] - pub routing: Box, + pub routing: Box, } -impl ServersPort { - pub fn new(protocol: crate::models::ServersPortProtocol, routing: crate::models::ServersPortRouting) -> ServersPort { - ServersPort { +impl GamesServersPort { + pub fn new(protocol: crate::models::GamesServersPortProtocol, routing: crate::models::GamesServersPortRouting) -> GamesServersPort { + GamesServersPort { internal_port: None, protocol, public_hostname: None, diff --git a/sdks/full/rust-cli/src/models/servers_port_protocol.rs b/sdks/full/rust-cli/src/models/games_servers_port_protocol.rs similarity index 83% rename from sdks/full/rust-cli/src/models/servers_port_protocol.rs rename to sdks/full/rust-cli/src/models/games_servers_port_protocol.rs index e2e8c326c9..184df31ce0 100644 --- a/sdks/full/rust-cli/src/models/servers_port_protocol.rs +++ b/sdks/full/rust-cli/src/models/games_servers_port_protocol.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersPortProtocol { +pub enum GamesServersPortProtocol { #[serde(rename = "http")] Http, #[serde(rename = "https")] @@ -25,7 +25,7 @@ pub enum ServersPortProtocol { } -impl ToString for ServersPortProtocol { +impl ToString for GamesServersPortProtocol { fn to_string(&self) -> String { match self { Self::Http => String::from("http"), @@ -37,8 +37,8 @@ impl ToString for ServersPortProtocol { } } -impl Default for ServersPortProtocol { - fn default() -> ServersPortProtocol { +impl Default for GamesServersPortProtocol { + fn default() -> GamesServersPortProtocol { Self::Http } } diff --git a/sdks/full/rust-cli/src/models/servers_port_routing.rs b/sdks/full/rust-cli/src/models/games_servers_port_routing.rs similarity index 80% rename from sdks/full/rust-cli/src/models/servers_port_routing.rs rename to sdks/full/rust-cli/src/models/games_servers_port_routing.rs index 83f0846fc4..6504f350f2 100644 --- a/sdks/full/rust-cli/src/models/servers_port_routing.rs +++ b/sdks/full/rust-cli/src/models/games_servers_port_routing.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersPortRouting { +pub struct GamesServersPortRouting { #[serde(rename = "game_guard", skip_serializing_if = "Option::is_none")] pub game_guard: Option, #[serde(rename = "host", skip_serializing_if = "Option::is_none")] pub host: Option, } -impl ServersPortRouting { - pub fn new() -> ServersPortRouting { - ServersPortRouting { +impl GamesServersPortRouting { + pub fn new() -> GamesServersPortRouting { + GamesServersPortRouting { game_guard: None, host: None, } diff --git a/sdks/full/rust-cli/src/models/servers_resources.rs b/sdks/full/rust-cli/src/models/games_servers_resources.rs similarity index 80% rename from sdks/full/rust-cli/src/models/servers_resources.rs rename to sdks/full/rust-cli/src/models/games_servers_resources.rs index d29a3cb0ac..e64e78b7a3 100644 --- a/sdks/full/rust-cli/src/models/servers_resources.rs +++ b/sdks/full/rust-cli/src/models/games_servers_resources.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersResources { +pub struct GamesServersResources { /// The number of CPU cores in millicores, or 1/1000 of a core. For example, 1/8 of a core would be 125 millicores, and 1 core would be 1000 millicores. #[serde(rename = "cpu")] pub cpu: i32, @@ -21,9 +21,9 @@ pub struct ServersResources { pub memory: i32, } -impl ServersResources { - pub fn new(cpu: i32, memory: i32) -> ServersResources { - ServersResources { +impl GamesServersResources { + pub fn new(cpu: i32, memory: i32) -> GamesServersResources { + GamesServersResources { cpu, memory, } diff --git a/sdks/full/rust-cli/src/models/servers_server.rs b/sdks/full/rust-cli/src/models/games_servers_server.rs similarity index 85% rename from sdks/full/rust-cli/src/models/servers_server.rs rename to sdks/full/rust-cli/src/models/games_servers_server.rs index 637c914820..96bf28c6cc 100644 --- a/sdks/full/rust-cli/src/models/servers_server.rs +++ b/sdks/full/rust-cli/src/models/games_servers_server.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersServer { +pub struct GamesServersServer { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, #[serde(rename = "cluster_id")] @@ -33,9 +33,9 @@ pub struct ServersServer { #[serde(rename = "kill_timeout", skip_serializing_if = "Option::is_none")] pub kill_timeout: Option, #[serde(rename = "network")] - pub network: Box, + pub network: Box, #[serde(rename = "resources")] - pub resources: Box, + pub resources: Box, #[serde(rename = "server_id")] pub server_id: uuid::Uuid, #[serde(rename = "start_ts", skip_serializing_if = "Option::is_none")] @@ -44,9 +44,9 @@ pub struct ServersServer { pub tags: Option, } -impl ServersServer { - pub fn new(cluster_id: uuid::Uuid, create_ts: i64, datacenter_id: uuid::Uuid, game_id: uuid::Uuid, image_id: uuid::Uuid, network: crate::models::ServersNetwork, resources: crate::models::ServersResources, server_id: uuid::Uuid, tags: Option) -> ServersServer { - ServersServer { +impl GamesServersServer { + pub fn new(cluster_id: uuid::Uuid, create_ts: i64, datacenter_id: uuid::Uuid, game_id: uuid::Uuid, image_id: uuid::Uuid, network: crate::models::GamesServersNetwork, resources: crate::models::GamesServersResources, server_id: uuid::Uuid, tags: Option) -> GamesServersServer { + GamesServersServer { arguments: None, cluster_id, create_ts, diff --git a/sdks/full/rust-cli/src/models/mod.rs b/sdks/full/rust-cli/src/models/mod.rs index a15d7977dc..dce2f2f89d 100644 --- a/sdks/full/rust-cli/src/models/mod.rs +++ b/sdks/full/rust-cli/src/models/mod.rs @@ -382,6 +382,46 @@ pub mod game_stat_summary; pub use self::game_stat_summary::GameStatSummary; pub mod game_summary; pub use self::game_summary::GameSummary; +pub mod games_servers_build_compression; +pub use self::games_servers_build_compression::GamesServersBuildCompression; +pub mod games_servers_build_kind; +pub use self::games_servers_build_kind::GamesServersBuildKind; +pub mod games_servers_create_build_request; +pub use self::games_servers_create_build_request::GamesServersCreateBuildRequest; +pub mod games_servers_create_build_response; +pub use self::games_servers_create_build_response::GamesServersCreateBuildResponse; +pub mod games_servers_create_server_network_request; +pub use self::games_servers_create_server_network_request::GamesServersCreateServerNetworkRequest; +pub mod games_servers_create_server_port_request; +pub use self::games_servers_create_server_port_request::GamesServersCreateServerPortRequest; +pub mod games_servers_create_server_request; +pub use self::games_servers_create_server_request::GamesServersCreateServerRequest; +pub mod games_servers_create_server_response; +pub use self::games_servers_create_server_response::GamesServersCreateServerResponse; +pub mod games_servers_get_server_logs_response; +pub use self::games_servers_get_server_logs_response::GamesServersGetServerLogsResponse; +pub mod games_servers_get_server_response; +pub use self::games_servers_get_server_response::GamesServersGetServerResponse; +pub mod games_servers_list_builds_response; +pub use self::games_servers_list_builds_response::GamesServersListBuildsResponse; +pub mod games_servers_list_servers_response; +pub use self::games_servers_list_servers_response::GamesServersListServersResponse; +pub mod games_servers_log_stream; +pub use self::games_servers_log_stream::GamesServersLogStream; +pub mod games_servers_network; +pub use self::games_servers_network::GamesServersNetwork; +pub mod games_servers_network_mode; +pub use self::games_servers_network_mode::GamesServersNetworkMode; +pub mod games_servers_port; +pub use self::games_servers_port::GamesServersPort; +pub mod games_servers_port_protocol; +pub use self::games_servers_port_protocol::GamesServersPortProtocol; +pub mod games_servers_port_routing; +pub use self::games_servers_port_routing::GamesServersPortRouting; +pub mod games_servers_resources; +pub use self::games_servers_resources::GamesServersResources; +pub mod games_servers_server; +pub use self::games_servers_server::GamesServersServer; pub mod geo_coord; pub use self::geo_coord::GeoCoord; pub mod geo_distance; @@ -606,48 +646,6 @@ pub mod provision_datacenters_get_tls_response; pub use self::provision_datacenters_get_tls_response::ProvisionDatacentersGetTlsResponse; pub mod provision_servers_get_info_response; pub use self::provision_servers_get_info_response::ProvisionServersGetInfoResponse; -pub mod servers_build_compression; -pub use self::servers_build_compression::ServersBuildCompression; -pub mod servers_build_kind; -pub use self::servers_build_kind::ServersBuildKind; -pub mod servers_create_build_request; -pub use self::servers_create_build_request::ServersCreateBuildRequest; -pub mod servers_create_build_response; -pub use self::servers_create_build_response::ServersCreateBuildResponse; -pub mod servers_create_server_network_request; -pub use self::servers_create_server_network_request::ServersCreateServerNetworkRequest; -pub mod servers_create_server_port_request; -pub use self::servers_create_server_port_request::ServersCreateServerPortRequest; -pub mod servers_create_server_request; -pub use self::servers_create_server_request::ServersCreateServerRequest; -pub mod servers_create_server_response; -pub use self::servers_create_server_response::ServersCreateServerResponse; -pub mod servers_destroy_server_response; -pub use self::servers_destroy_server_response::ServersDestroyServerResponse; -pub mod servers_get_server_logs_response; -pub use self::servers_get_server_logs_response::ServersGetServerLogsResponse; -pub mod servers_get_server_response; -pub use self::servers_get_server_response::ServersGetServerResponse; -pub mod servers_list_builds_response; -pub use self::servers_list_builds_response::ServersListBuildsResponse; -pub mod servers_list_servers_response; -pub use self::servers_list_servers_response::ServersListServersResponse; -pub mod servers_log_stream; -pub use self::servers_log_stream::ServersLogStream; -pub mod servers_network; -pub use self::servers_network::ServersNetwork; -pub mod servers_network_mode; -pub use self::servers_network_mode::ServersNetworkMode; -pub mod servers_port; -pub use self::servers_port::ServersPort; -pub mod servers_port_protocol; -pub use self::servers_port_protocol::ServersPortProtocol; -pub mod servers_port_routing; -pub use self::servers_port_routing::ServersPortRouting; -pub mod servers_resources; -pub use self::servers_resources::ServersResources; -pub mod servers_server; -pub use self::servers_server::ServersServer; pub mod upload_prepare_file; pub use self::upload_prepare_file::UploadPrepareFile; pub mod upload_presigned_request; diff --git a/sdks/full/rust-cli/src/models/servers_destroy_server_response.rs b/sdks/full/rust-cli/src/models/servers_destroy_server_response.rs deleted file mode 100644 index f993e53a94..0000000000 --- a/sdks/full/rust-cli/src/models/servers_destroy_server_response.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Rivet API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * - * Generated by: https://openapi-generator.tech - */ - - - - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersDestroyServerResponse { - #[serde(rename = "server_id")] - pub server_id: uuid::Uuid, -} - -impl ServersDestroyServerResponse { - pub fn new(server_id: uuid::Uuid) -> ServersDestroyServerResponse { - ServersDestroyServerResponse { - server_id, - } - } -} - - diff --git a/sdks/full/rust/.openapi-generator/FILES b/sdks/full/rust/.openapi-generator/FILES index 499eb1b382..77f166cf0c 100644 --- a/sdks/full/rust/.openapi-generator/FILES +++ b/sdks/full/rust/.openapi-generator/FILES @@ -219,6 +219,29 @@ docs/GameStatFormatMethod.md docs/GameStatSortingMethod.md docs/GameStatSummary.md docs/GameSummary.md +docs/GamesServersApi.md +docs/GamesServersBuildCompression.md +docs/GamesServersBuildKind.md +docs/GamesServersBuildsApi.md +docs/GamesServersCreateBuildRequest.md +docs/GamesServersCreateBuildResponse.md +docs/GamesServersCreateServerNetworkRequest.md +docs/GamesServersCreateServerPortRequest.md +docs/GamesServersCreateServerRequest.md +docs/GamesServersCreateServerResponse.md +docs/GamesServersGetServerLogsResponse.md +docs/GamesServersGetServerResponse.md +docs/GamesServersListBuildsResponse.md +docs/GamesServersListServersResponse.md +docs/GamesServersLogStream.md +docs/GamesServersLogsApi.md +docs/GamesServersNetwork.md +docs/GamesServersNetworkMode.md +docs/GamesServersPort.md +docs/GamesServersPortProtocol.md +docs/GamesServersPortRouting.md +docs/GamesServersResources.md +docs/GamesServersServer.md docs/GeoCoord.md docs/GeoDistance.md docs/GlobalEventNotification.md @@ -346,30 +369,6 @@ docs/ProvisionDatacentersApi.md docs/ProvisionDatacentersGetTlsResponse.md docs/ProvisionServersApi.md docs/ProvisionServersGetInfoResponse.md -docs/ServersApi.md -docs/ServersBuildCompression.md -docs/ServersBuildKind.md -docs/ServersBuildsApi.md -docs/ServersCreateBuildRequest.md -docs/ServersCreateBuildResponse.md -docs/ServersCreateServerNetworkRequest.md -docs/ServersCreateServerPortRequest.md -docs/ServersCreateServerRequest.md -docs/ServersCreateServerResponse.md -docs/ServersDestroyServerResponse.md -docs/ServersGetServerLogsResponse.md -docs/ServersGetServerResponse.md -docs/ServersListBuildsResponse.md -docs/ServersListServersResponse.md -docs/ServersLogStream.md -docs/ServersLogsApi.md -docs/ServersNetwork.md -docs/ServersNetworkMode.md -docs/ServersPort.md -docs/ServersPortProtocol.md -docs/ServersPortRouting.md -docs/ServersResources.md -docs/ServersServer.md docs/UploadPrepareFile.md docs/UploadPresignedRequest.md docs/ValidationError.md @@ -400,6 +399,9 @@ src/apis/cloud_logs_api.rs src/apis/cloud_tiers_api.rs src/apis/cloud_uploads_api.rs src/apis/configuration.rs +src/apis/games_servers_api.rs +src/apis/games_servers_builds_api.rs +src/apis/games_servers_logs_api.rs src/apis/group_api.rs src/apis/group_invites_api.rs src/apis/group_join_requests_api.rs @@ -416,9 +418,6 @@ src/apis/mod.rs src/apis/portal_games_api.rs src/apis/provision_datacenters_api.rs src/apis/provision_servers_api.rs -src/apis/servers_api.rs -src/apis/servers_builds_api.rs -src/apis/servers_logs_api.rs src/lib.rs src/models/admin_clusters_build_delivery_method.rs src/models/admin_clusters_cluster.rs @@ -612,6 +611,26 @@ src/models/game_stat_format_method.rs src/models/game_stat_sorting_method.rs src/models/game_stat_summary.rs src/models/game_summary.rs +src/models/games_servers_build_compression.rs +src/models/games_servers_build_kind.rs +src/models/games_servers_create_build_request.rs +src/models/games_servers_create_build_response.rs +src/models/games_servers_create_server_network_request.rs +src/models/games_servers_create_server_port_request.rs +src/models/games_servers_create_server_request.rs +src/models/games_servers_create_server_response.rs +src/models/games_servers_get_server_logs_response.rs +src/models/games_servers_get_server_response.rs +src/models/games_servers_list_builds_response.rs +src/models/games_servers_list_servers_response.rs +src/models/games_servers_log_stream.rs +src/models/games_servers_network.rs +src/models/games_servers_network_mode.rs +src/models/games_servers_port.rs +src/models/games_servers_port_protocol.rs +src/models/games_servers_port_routing.rs +src/models/games_servers_resources.rs +src/models/games_servers_server.rs src/models/geo_coord.rs src/models/geo_distance.rs src/models/global_event_notification.rs @@ -725,27 +744,6 @@ src/models/portal_notification_register_service.rs src/models/portal_notification_unregister_service.rs src/models/provision_datacenters_get_tls_response.rs src/models/provision_servers_get_info_response.rs -src/models/servers_build_compression.rs -src/models/servers_build_kind.rs -src/models/servers_create_build_request.rs -src/models/servers_create_build_response.rs -src/models/servers_create_server_network_request.rs -src/models/servers_create_server_port_request.rs -src/models/servers_create_server_request.rs -src/models/servers_create_server_response.rs -src/models/servers_destroy_server_response.rs -src/models/servers_get_server_logs_response.rs -src/models/servers_get_server_response.rs -src/models/servers_list_builds_response.rs -src/models/servers_list_servers_response.rs -src/models/servers_log_stream.rs -src/models/servers_network.rs -src/models/servers_network_mode.rs -src/models/servers_port.rs -src/models/servers_port_protocol.rs -src/models/servers_port_routing.rs -src/models/servers_resources.rs -src/models/servers_server.rs src/models/upload_prepare_file.rs src/models/upload_presigned_request.rs src/models/validation_error.rs diff --git a/sdks/full/rust/README.md b/sdks/full/rust/README.md index 1d982febf3..82989b805a 100644 --- a/sdks/full/rust/README.md +++ b/sdks/full/rust/README.md @@ -91,6 +91,14 @@ Class | Method | HTTP request | Description *CloudLogsApi* | [**cloud_logs_get_ray_perf_logs**](docs/CloudLogsApi.md#cloud_logs_get_ray_perf_logs) | **GET** /cloud/rays/{ray_id}/perf | *CloudTiersApi* | [**cloud_tiers_get_region_tiers**](docs/CloudTiersApi.md#cloud_tiers_get_region_tiers) | **GET** /cloud/region-tiers | *CloudUploadsApi* | [**cloud_uploads_complete_upload**](docs/CloudUploadsApi.md#cloud_uploads_complete_upload) | **POST** /cloud/uploads/{upload_id}/complete | +*GamesServersApi* | [**games_servers_create**](docs/GamesServersApi.md#games_servers_create) | **POST** /games/{game_id}/servers | +*GamesServersApi* | [**games_servers_destroy**](docs/GamesServersApi.md#games_servers_destroy) | **DELETE** /games/{game_id}/servers/{server_id} | +*GamesServersApi* | [**games_servers_get**](docs/GamesServersApi.md#games_servers_get) | **GET** /games/{game_id}/servers/{server_id} | +*GamesServersApi* | [**games_servers_list**](docs/GamesServersApi.md#games_servers_list) | **GET** /games/{game_id}/servers | +*GamesServersBuildsApi* | [**games_servers_builds_complete_build**](docs/GamesServersBuildsApi.md#games_servers_builds_complete_build) | **POST** /games/{game_id}/builds/{build_id}/complete | +*GamesServersBuildsApi* | [**games_servers_builds_list_builds**](docs/GamesServersBuildsApi.md#games_servers_builds_list_builds) | **GET** /games/{game_id}/builds | +*GamesServersBuildsApi* | [**games_servers_builds_prepare_build**](docs/GamesServersBuildsApi.md#games_servers_builds_prepare_build) | **POST** /games/{game_id}/builds/prepare | +*GamesServersLogsApi* | [**games_servers_logs_get_server_logs**](docs/GamesServersLogsApi.md#games_servers_logs_get_server_logs) | **GET** /games/{game_id}/servers/{server_id}/logs | *GroupApi* | [**group_ban_identity**](docs/GroupApi.md#group_ban_identity) | **POST** /group/groups/{group_id}/bans/{identity_id} | *GroupApi* | [**group_complete_avatar_upload**](docs/GroupApi.md#group_complete_avatar_upload) | **POST** /group/groups/{group_id}/avatar-upload/{upload_id}/complete | *GroupApi* | [**group_create**](docs/GroupApi.md#group_create) | **POST** /group/groups | @@ -167,14 +175,6 @@ Class | Method | HTTP request | Description *PortalGamesApi* | [**portal_games_get_game_profile**](docs/PortalGamesApi.md#portal_games_get_game_profile) | **GET** /portal/games/{game_name_id}/profile | *ProvisionDatacentersApi* | [**provision_datacenters_get_tls**](docs/ProvisionDatacentersApi.md#provision_datacenters_get_tls) | **GET** /datacenters/{datacenter_id}/tls | *ProvisionServersApi* | [**provision_servers_get_info**](docs/ProvisionServersApi.md#provision_servers_get_info) | **GET** /servers/{ip} | -*ServersApi* | [**servers_create**](docs/ServersApi.md#servers_create) | **POST** /servers | -*ServersApi* | [**servers_destroy**](docs/ServersApi.md#servers_destroy) | **DELETE** /servers/{server_id} | -*ServersApi* | [**servers_get**](docs/ServersApi.md#servers_get) | **GET** /servers/{server_id} | -*ServersApi* | [**servers_list**](docs/ServersApi.md#servers_list) | **GET** /servers | -*ServersBuildsApi* | [**servers_builds_complete_build**](docs/ServersBuildsApi.md#servers_builds_complete_build) | **POST** /servers/uploads/{upload_id}/complete | -*ServersBuildsApi* | [**servers_builds_list_builds**](docs/ServersBuildsApi.md#servers_builds_list_builds) | **GET** /servers/builds | -*ServersBuildsApi* | [**servers_builds_prepare_build**](docs/ServersBuildsApi.md#servers_builds_prepare_build) | **POST** /servers/builds | -*ServersLogsApi* | [**servers_logs_get_server_logs**](docs/ServersLogsApi.md#servers_logs_get_server_logs) | **GET** /servers/{server_id}/logs | ## Documentation For Models @@ -371,6 +371,26 @@ Class | Method | HTTP request | Description - [GameStatSortingMethod](docs/GameStatSortingMethod.md) - [GameStatSummary](docs/GameStatSummary.md) - [GameSummary](docs/GameSummary.md) + - [GamesServersBuildCompression](docs/GamesServersBuildCompression.md) + - [GamesServersBuildKind](docs/GamesServersBuildKind.md) + - [GamesServersCreateBuildRequest](docs/GamesServersCreateBuildRequest.md) + - [GamesServersCreateBuildResponse](docs/GamesServersCreateBuildResponse.md) + - [GamesServersCreateServerNetworkRequest](docs/GamesServersCreateServerNetworkRequest.md) + - [GamesServersCreateServerPortRequest](docs/GamesServersCreateServerPortRequest.md) + - [GamesServersCreateServerRequest](docs/GamesServersCreateServerRequest.md) + - [GamesServersCreateServerResponse](docs/GamesServersCreateServerResponse.md) + - [GamesServersGetServerLogsResponse](docs/GamesServersGetServerLogsResponse.md) + - [GamesServersGetServerResponse](docs/GamesServersGetServerResponse.md) + - [GamesServersListBuildsResponse](docs/GamesServersListBuildsResponse.md) + - [GamesServersListServersResponse](docs/GamesServersListServersResponse.md) + - [GamesServersLogStream](docs/GamesServersLogStream.md) + - [GamesServersNetwork](docs/GamesServersNetwork.md) + - [GamesServersNetworkMode](docs/GamesServersNetworkMode.md) + - [GamesServersPort](docs/GamesServersPort.md) + - [GamesServersPortProtocol](docs/GamesServersPortProtocol.md) + - [GamesServersPortRouting](docs/GamesServersPortRouting.md) + - [GamesServersResources](docs/GamesServersResources.md) + - [GamesServersServer](docs/GamesServersServer.md) - [GeoCoord](docs/GeoCoord.md) - [GeoDistance](docs/GeoDistance.md) - [GlobalEventNotification](docs/GlobalEventNotification.md) @@ -483,27 +503,6 @@ Class | Method | HTTP request | Description - [PortalNotificationUnregisterService](docs/PortalNotificationUnregisterService.md) - [ProvisionDatacentersGetTlsResponse](docs/ProvisionDatacentersGetTlsResponse.md) - [ProvisionServersGetInfoResponse](docs/ProvisionServersGetInfoResponse.md) - - [ServersBuildCompression](docs/ServersBuildCompression.md) - - [ServersBuildKind](docs/ServersBuildKind.md) - - [ServersCreateBuildRequest](docs/ServersCreateBuildRequest.md) - - [ServersCreateBuildResponse](docs/ServersCreateBuildResponse.md) - - [ServersCreateServerNetworkRequest](docs/ServersCreateServerNetworkRequest.md) - - [ServersCreateServerPortRequest](docs/ServersCreateServerPortRequest.md) - - [ServersCreateServerRequest](docs/ServersCreateServerRequest.md) - - [ServersCreateServerResponse](docs/ServersCreateServerResponse.md) - - [ServersDestroyServerResponse](docs/ServersDestroyServerResponse.md) - - [ServersGetServerLogsResponse](docs/ServersGetServerLogsResponse.md) - - [ServersGetServerResponse](docs/ServersGetServerResponse.md) - - [ServersListBuildsResponse](docs/ServersListBuildsResponse.md) - - [ServersListServersResponse](docs/ServersListServersResponse.md) - - [ServersLogStream](docs/ServersLogStream.md) - - [ServersNetwork](docs/ServersNetwork.md) - - [ServersNetworkMode](docs/ServersNetworkMode.md) - - [ServersPort](docs/ServersPort.md) - - [ServersPortProtocol](docs/ServersPortProtocol.md) - - [ServersPortRouting](docs/ServersPortRouting.md) - - [ServersResources](docs/ServersResources.md) - - [ServersServer](docs/ServersServer.md) - [UploadPrepareFile](docs/UploadPrepareFile.md) - [UploadPresignedRequest](docs/UploadPresignedRequest.md) - [ValidationError](docs/ValidationError.md) diff --git a/sdks/full/rust-cli/docs/ServersApi.md b/sdks/full/rust/docs/GamesServersApi.md similarity index 62% rename from sdks/full/rust-cli/docs/ServersApi.md rename to sdks/full/rust/docs/GamesServersApi.md index 708f96bcf2..f07830f717 100644 --- a/sdks/full/rust-cli/docs/ServersApi.md +++ b/sdks/full/rust/docs/GamesServersApi.md @@ -1,19 +1,19 @@ -# \ServersApi +# \GamesServersApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_create**](ServersApi.md#servers_create) | **POST** /servers | -[**servers_destroy**](ServersApi.md#servers_destroy) | **DELETE** /servers/{server_id} | -[**servers_get**](ServersApi.md#servers_get) | **GET** /servers/{server_id} | -[**servers_list**](ServersApi.md#servers_list) | **GET** /servers | +[**games_servers_create**](GamesServersApi.md#games_servers_create) | **POST** /games/{game_id}/servers | +[**games_servers_destroy**](GamesServersApi.md#games_servers_destroy) | **DELETE** /games/{game_id}/servers/{server_id} | +[**games_servers_get**](GamesServersApi.md#games_servers_get) | **GET** /games/{game_id}/servers/{server_id} | +[**games_servers_list**](GamesServersApi.md#games_servers_list) | **GET** /games/{game_id}/servers | -## servers_create +## games_servers_create -> crate::models::ServersCreateServerResponse servers_create(servers_create_server_request) +> crate::models::GamesServersCreateServerResponse games_servers_create(game_id, games_servers_create_server_request) Create a new dynamic server. @@ -23,11 +23,12 @@ Create a new dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**servers_create_server_request** | [**ServersCreateServerRequest**](ServersCreateServerRequest.md) | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**games_servers_create_server_request** | [**GamesServersCreateServerRequest**](GamesServersCreateServerRequest.md) | | [required] | ### Return type -[**crate::models::ServersCreateServerResponse**](ServersCreateServerResponse.md) +[**crate::models::GamesServersCreateServerResponse**](GamesServersCreateServerResponse.md) ### Authorization @@ -41,9 +42,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_destroy +## games_servers_destroy -> crate::models::ServersDestroyServerResponse servers_destroy(server_id, override_kill_timeout) +> serde_json::Value games_servers_destroy(game_id, server_id, override_kill_timeout) Destroy a dynamic server. @@ -53,12 +54,13 @@ Destroy a dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | The id of the server to destroy | [required] | **override_kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be used to override the default kill timeout if a faster time is needed, say for ignoring a graceful shutdown. | | ### Return type -[**crate::models::ServersDestroyServerResponse**](ServersDestroyServerResponse.md) +[**serde_json::Value**](serde_json::Value.md) ### Authorization @@ -72,9 +74,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_get +## games_servers_get -> crate::models::ServersGetServerResponse servers_get(server_id) +> crate::models::GamesServersGetServerResponse games_servers_get(game_id, server_id) Gets a dynamic server. @@ -84,11 +86,12 @@ Gets a dynamic server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | The id of the server to destroy | [required] | ### Return type -[**crate::models::ServersGetServerResponse**](ServersGetServerResponse.md) +[**crate::models::GamesServersGetServerResponse**](GamesServersGetServerResponse.md) ### Authorization @@ -102,9 +105,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_list +## games_servers_list -> crate::models::ServersListServersResponse servers_list(tags, game_id) +> crate::models::GamesServersListServersResponse games_servers_list(game_id, tags, game_id2) Lists all servers associated with the token used. Can be filtered by tags in the query string. @@ -114,12 +117,13 @@ Lists all servers associated with the token used. Can be filtered by tags in the Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **tags** | Option<**String**> | | | -**game_id** | Option<**uuid::Uuid**> | | | +**game_id2** | Option<**uuid::Uuid**> | | | ### Return type -[**crate::models::ServersListServersResponse**](ServersListServersResponse.md) +[**crate::models::GamesServersListServersResponse**](GamesServersListServersResponse.md) ### Authorization diff --git a/sdks/full/rust/docs/GamesServersBuildCompression.md b/sdks/full/rust/docs/GamesServersBuildCompression.md new file mode 100644 index 0000000000..a6e61f4f03 --- /dev/null +++ b/sdks/full/rust/docs/GamesServersBuildCompression.md @@ -0,0 +1,10 @@ +# GamesServersBuildCompression + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/full/rust-cli/docs/ServersLogStream.md b/sdks/full/rust/docs/GamesServersBuildKind.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersLogStream.md rename to sdks/full/rust/docs/GamesServersBuildKind.md index 9706b84a3a..b6f5a36981 100644 --- a/sdks/full/rust-cli/docs/ServersLogStream.md +++ b/sdks/full/rust/docs/GamesServersBuildKind.md @@ -1,4 +1,4 @@ -# ServersLogStream +# GamesServersBuildKind ## Properties diff --git a/sdks/full/rust/docs/ServersBuildsApi.md b/sdks/full/rust/docs/GamesServersBuildsApi.md similarity index 56% rename from sdks/full/rust/docs/ServersBuildsApi.md rename to sdks/full/rust/docs/GamesServersBuildsApi.md index 579cfc8c42..aa3ddc3f13 100644 --- a/sdks/full/rust/docs/ServersBuildsApi.md +++ b/sdks/full/rust/docs/GamesServersBuildsApi.md @@ -1,18 +1,18 @@ -# \ServersBuildsApi +# \GamesServersBuildsApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_builds_complete_build**](ServersBuildsApi.md#servers_builds_complete_build) | **POST** /servers/uploads/{upload_id}/complete | -[**servers_builds_list_builds**](ServersBuildsApi.md#servers_builds_list_builds) | **GET** /servers/builds | -[**servers_builds_prepare_build**](ServersBuildsApi.md#servers_builds_prepare_build) | **POST** /servers/builds | +[**games_servers_builds_complete_build**](GamesServersBuildsApi.md#games_servers_builds_complete_build) | **POST** /games/{game_id}/builds/{build_id}/complete | +[**games_servers_builds_list_builds**](GamesServersBuildsApi.md#games_servers_builds_list_builds) | **GET** /games/{game_id}/builds | +[**games_servers_builds_prepare_build**](GamesServersBuildsApi.md#games_servers_builds_prepare_build) | **POST** /games/{game_id}/builds/prepare | -## servers_builds_complete_build +## games_servers_builds_complete_build -> servers_builds_complete_build(upload_id) +> games_servers_builds_complete_build(game_id, build_id) Marks an upload as complete. @@ -22,7 +22,8 @@ Marks an upload as complete. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**upload_id** | **uuid::Uuid** | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**build_id** | **uuid::Uuid** | | [required] | ### Return type @@ -40,9 +41,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_builds_list_builds +## games_servers_builds_list_builds -> crate::models::ServersListBuildsResponse servers_builds_list_builds(tags, game_id) +> crate::models::GamesServersListBuildsResponse games_servers_builds_list_builds(game_id, tags, game_id2) Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. @@ -52,12 +53,13 @@ Lists all builds of the game associated with the token used. Can be filtered by Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **tags** | Option<**String**> | | | -**game_id** | Option<**uuid::Uuid**> | | | +**game_id2** | Option<**uuid::Uuid**> | | | ### Return type -[**crate::models::ServersListBuildsResponse**](ServersListBuildsResponse.md) +[**crate::models::GamesServersListBuildsResponse**](GamesServersListBuildsResponse.md) ### Authorization @@ -71,9 +73,9 @@ Name | Type | Description | Required | Notes [[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) -## servers_builds_prepare_build +## games_servers_builds_prepare_build -> crate::models::ServersCreateBuildResponse servers_builds_prepare_build(servers_create_build_request) +> crate::models::GamesServersCreateBuildResponse games_servers_builds_prepare_build(game_id, games_servers_create_build_request) Creates a new game build for the given game. @@ -83,11 +85,12 @@ Creates a new game build for the given game. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**servers_create_build_request** | [**ServersCreateBuildRequest**](ServersCreateBuildRequest.md) | | [required] | +**game_id** | **uuid::Uuid** | | [required] | +**games_servers_create_build_request** | [**GamesServersCreateBuildRequest**](GamesServersCreateBuildRequest.md) | | [required] | ### Return type -[**crate::models::ServersCreateBuildResponse**](ServersCreateBuildResponse.md) +[**crate::models::GamesServersCreateBuildResponse**](GamesServersCreateBuildResponse.md) ### Authorization diff --git a/sdks/full/rust/docs/ServersCreateBuildRequest.md b/sdks/full/rust/docs/GamesServersCreateBuildRequest.md similarity index 70% rename from sdks/full/rust/docs/ServersCreateBuildRequest.md rename to sdks/full/rust/docs/GamesServersCreateBuildRequest.md index 1c96d10698..28704e2c42 100644 --- a/sdks/full/rust/docs/ServersCreateBuildRequest.md +++ b/sdks/full/rust/docs/GamesServersCreateBuildRequest.md @@ -1,14 +1,14 @@ -# ServersCreateBuildRequest +# GamesServersCreateBuildRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**compression** | Option<[**crate::models::ServersBuildCompression**](ServersBuildCompression.md)> | | [optional] +**compression** | Option<[**crate::models::GamesServersBuildCompression**](GamesServersBuildCompression.md)> | | [optional] **display_name** | **String** | Represent a resource's readable display name. | **image_file** | [**crate::models::UploadPrepareFile**](UploadPrepareFile.md) | | **image_tag** | **String** | A tag given to the game build. | -**kind** | Option<[**crate::models::ServersBuildKind**](ServersBuildKind.md)> | | [optional] +**kind** | Option<[**crate::models::GamesServersBuildKind**](GamesServersBuildKind.md)> | | [optional] **multipart_upload** | Option<**bool**> | | [optional] **tags** | Option<[**serde_json::Value**](.md)> | | diff --git a/sdks/full/rust-cli/docs/ServersCreateBuildResponse.md b/sdks/full/rust/docs/GamesServersCreateBuildResponse.md similarity index 94% rename from sdks/full/rust-cli/docs/ServersCreateBuildResponse.md rename to sdks/full/rust/docs/GamesServersCreateBuildResponse.md index e5c3a19f8c..79f0e47fd5 100644 --- a/sdks/full/rust-cli/docs/ServersCreateBuildResponse.md +++ b/sdks/full/rust/docs/GamesServersCreateBuildResponse.md @@ -1,4 +1,4 @@ -# ServersCreateBuildResponse +# GamesServersCreateBuildResponse ## Properties diff --git a/sdks/full/rust-cli/docs/ServersCreateServerNetworkRequest.md b/sdks/full/rust/docs/GamesServersCreateServerNetworkRequest.md similarity index 58% rename from sdks/full/rust-cli/docs/ServersCreateServerNetworkRequest.md rename to sdks/full/rust/docs/GamesServersCreateServerNetworkRequest.md index 633ac595fa..d8b3687ebe 100644 --- a/sdks/full/rust-cli/docs/ServersCreateServerNetworkRequest.md +++ b/sdks/full/rust/docs/GamesServersCreateServerNetworkRequest.md @@ -1,11 +1,11 @@ -# ServersCreateServerNetworkRequest +# GamesServersCreateServerNetworkRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | Option<[**crate::models::ServersNetworkMode**](ServersNetworkMode.md)> | | [optional] -**ports** | [**::std::collections::HashMap**](ServersCreateServerPortRequest.md) | | +**mode** | Option<[**crate::models::GamesServersNetworkMode**](GamesServersNetworkMode.md)> | | [optional] +**ports** | [**::std::collections::HashMap**](GamesServersCreateServerPortRequest.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/full/rust-cli/docs/ServersCreateServerPortRequest.md b/sdks/full/rust/docs/GamesServersCreateServerPortRequest.md similarity index 57% rename from sdks/full/rust-cli/docs/ServersCreateServerPortRequest.md rename to sdks/full/rust/docs/GamesServersCreateServerPortRequest.md index 97c550c60d..69cae1d44d 100644 --- a/sdks/full/rust-cli/docs/ServersCreateServerPortRequest.md +++ b/sdks/full/rust/docs/GamesServersCreateServerPortRequest.md @@ -1,12 +1,12 @@ -# ServersCreateServerPortRequest +# GamesServersCreateServerPortRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **internal_port** | Option<**i32**> | | [optional] -**protocol** | [**crate::models::ServersPortProtocol**](ServersPortProtocol.md) | | -**routing** | Option<[**crate::models::ServersPortRouting**](ServersPortRouting.md)> | | [optional] +**protocol** | [**crate::models::GamesServersPortProtocol**](GamesServersPortProtocol.md) | | +**routing** | Option<[**crate::models::GamesServersPortRouting**](GamesServersPortRouting.md)> | | [optional] [[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/full/rust-cli/docs/ServersCreateServerRequest.md b/sdks/full/rust/docs/GamesServersCreateServerRequest.md similarity index 78% rename from sdks/full/rust-cli/docs/ServersCreateServerRequest.md rename to sdks/full/rust/docs/GamesServersCreateServerRequest.md index 382da90515..e7777a44a9 100644 --- a/sdks/full/rust-cli/docs/ServersCreateServerRequest.md +++ b/sdks/full/rust/docs/GamesServersCreateServerRequest.md @@ -1,4 +1,4 @@ -# ServersCreateServerRequest +# GamesServersCreateServerRequest ## Properties @@ -9,8 +9,8 @@ Name | Type | Description | Notes **environment** | Option<**::std::collections::HashMap**> | | [optional] **image_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be set to a safe default, and can be overridden during a DELETE request if needed. | [optional] -**network** | [**crate::models::ServersCreateServerNetworkRequest**](ServersCreateServerNetworkRequest.md) | | -**resources** | [**crate::models::ServersResources**](ServersResources.md) | | +**network** | [**crate::models::GamesServersCreateServerNetworkRequest**](GamesServersCreateServerNetworkRequest.md) | | +**resources** | [**crate::models::GamesServersResources**](GamesServersResources.md) | | **tags** | Option<[**serde_json::Value**](.md)> | | **webhook_url** | Option<**String**> | A url to send to which events from the server running will be sent | [optional] diff --git a/sdks/full/rust/docs/GamesServersCreateServerResponse.md b/sdks/full/rust/docs/GamesServersCreateServerResponse.md new file mode 100644 index 0000000000..14a798c6e8 --- /dev/null +++ b/sdks/full/rust/docs/GamesServersCreateServerResponse.md @@ -0,0 +1,11 @@ +# GamesServersCreateServerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server** | [**crate::models::GamesServersServer**](GamesServersServer.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/full/rust/docs/ServersGetServerLogsResponse.md b/sdks/full/rust/docs/GamesServersGetServerLogsResponse.md similarity index 92% rename from sdks/full/rust/docs/ServersGetServerLogsResponse.md rename to sdks/full/rust/docs/GamesServersGetServerLogsResponse.md index ed594b4b5f..0426f6eaa1 100644 --- a/sdks/full/rust/docs/ServersGetServerLogsResponse.md +++ b/sdks/full/rust/docs/GamesServersGetServerLogsResponse.md @@ -1,4 +1,4 @@ -# ServersGetServerLogsResponse +# GamesServersGetServerLogsResponse ## Properties diff --git a/sdks/full/rust-cli/docs/ServersCreateServerResponse.md b/sdks/full/rust/docs/GamesServersGetServerResponse.md similarity index 70% rename from sdks/full/rust-cli/docs/ServersCreateServerResponse.md rename to sdks/full/rust/docs/GamesServersGetServerResponse.md index 29bae37bf7..b7b9da81b8 100644 --- a/sdks/full/rust-cli/docs/ServersCreateServerResponse.md +++ b/sdks/full/rust/docs/GamesServersGetServerResponse.md @@ -1,10 +1,10 @@ -# ServersCreateServerResponse +# GamesServersGetServerResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**server** | [**crate::models::ServersServer**](ServersServer.md) | | +**server** | [**crate::models::GamesServersServer**](GamesServersServer.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/full/rust/docs/ServersListBuildsResponse.md b/sdks/full/rust/docs/GamesServersListBuildsResponse.md similarity index 92% rename from sdks/full/rust/docs/ServersListBuildsResponse.md rename to sdks/full/rust/docs/GamesServersListBuildsResponse.md index 2135664842..0618f5a490 100644 --- a/sdks/full/rust/docs/ServersListBuildsResponse.md +++ b/sdks/full/rust/docs/GamesServersListBuildsResponse.md @@ -1,4 +1,4 @@ -# ServersListBuildsResponse +# GamesServersListBuildsResponse ## Properties diff --git a/sdks/full/rust/docs/GamesServersListServersResponse.md b/sdks/full/rust/docs/GamesServersListServersResponse.md new file mode 100644 index 0000000000..54fa85b8fd --- /dev/null +++ b/sdks/full/rust/docs/GamesServersListServersResponse.md @@ -0,0 +1,11 @@ +# GamesServersListServersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**servers** | [**Vec**](GamesServersServer.md) | A list of servers for the game associated with the token. | + +[[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/full/rust-cli/docs/ServersNetworkMode.md b/sdks/full/rust/docs/GamesServersLogStream.md similarity index 92% rename from sdks/full/rust-cli/docs/ServersNetworkMode.md rename to sdks/full/rust/docs/GamesServersLogStream.md index 9fdd3e28c1..9749bf1b9a 100644 --- a/sdks/full/rust-cli/docs/ServersNetworkMode.md +++ b/sdks/full/rust/docs/GamesServersLogStream.md @@ -1,4 +1,4 @@ -# ServersNetworkMode +# GamesServersLogStream ## Properties diff --git a/sdks/full/rust-cli/docs/ServersLogsApi.md b/sdks/full/rust/docs/GamesServersLogsApi.md similarity index 57% rename from sdks/full/rust-cli/docs/ServersLogsApi.md rename to sdks/full/rust/docs/GamesServersLogsApi.md index da6ba86641..133558d7f8 100644 --- a/sdks/full/rust-cli/docs/ServersLogsApi.md +++ b/sdks/full/rust/docs/GamesServersLogsApi.md @@ -1,16 +1,16 @@ -# \ServersLogsApi +# \GamesServersLogsApi All URIs are relative to *https://api.rivet.gg* Method | HTTP request | Description ------------- | ------------- | ------------- -[**servers_logs_get_server_logs**](ServersLogsApi.md#servers_logs_get_server_logs) | **GET** /servers/{server_id}/logs | +[**games_servers_logs_get_server_logs**](GamesServersLogsApi.md#games_servers_logs_get_server_logs) | **GET** /games/{game_id}/servers/{server_id}/logs | -## servers_logs_get_server_logs +## games_servers_logs_get_server_logs -> crate::models::ServersGetServerLogsResponse servers_logs_get_server_logs(server_id, stream, game_id, watch_index) +> crate::models::GamesServersGetServerLogsResponse games_servers_logs_get_server_logs(game_id, server_id, stream, game_id2, watch_index) Returns the logs for a given server. @@ -20,14 +20,15 @@ Returns the logs for a given server. Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- +**game_id** | **uuid::Uuid** | | [required] | **server_id** | **uuid::Uuid** | | [required] | -**stream** | [**ServersLogStream**](.md) | | [required] | -**game_id** | Option<**uuid::Uuid**> | | | +**stream** | [**GamesServersLogStream**](.md) | | [required] | +**game_id2** | Option<**uuid::Uuid**> | | | **watch_index** | Option<**String**> | A query parameter denoting the requests watch index. | | ### Return type -[**crate::models::ServersGetServerLogsResponse**](ServersGetServerLogsResponse.md) +[**crate::models::GamesServersGetServerLogsResponse**](GamesServersGetServerLogsResponse.md) ### Authorization diff --git a/sdks/full/rust/docs/ServersNetwork.md b/sdks/full/rust/docs/GamesServersNetwork.md similarity index 65% rename from sdks/full/rust/docs/ServersNetwork.md rename to sdks/full/rust/docs/GamesServersNetwork.md index e1b819556d..71f789fdca 100644 --- a/sdks/full/rust/docs/ServersNetwork.md +++ b/sdks/full/rust/docs/GamesServersNetwork.md @@ -1,11 +1,11 @@ -# ServersNetwork +# GamesServersNetwork ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mode** | Option<[**crate::models::ServersNetworkMode**](ServersNetworkMode.md)> | | [optional] -**ports** | [**::std::collections::HashMap**](ServersPort.md) | | +**mode** | Option<[**crate::models::GamesServersNetworkMode**](GamesServersNetworkMode.md)> | | [optional] +**ports** | [**::std::collections::HashMap**](GamesServersPort.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/full/rust/docs/GamesServersNetworkMode.md b/sdks/full/rust/docs/GamesServersNetworkMode.md new file mode 100644 index 0000000000..307c5f2b5f --- /dev/null +++ b/sdks/full/rust/docs/GamesServersNetworkMode.md @@ -0,0 +1,10 @@ +# GamesServersNetworkMode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/full/rust/docs/ServersPort.md b/sdks/full/rust/docs/GamesServersPort.md similarity index 67% rename from sdks/full/rust/docs/ServersPort.md rename to sdks/full/rust/docs/GamesServersPort.md index 5ade4ddd58..da477f5485 100644 --- a/sdks/full/rust/docs/ServersPort.md +++ b/sdks/full/rust/docs/GamesServersPort.md @@ -1,14 +1,14 @@ -# ServersPort +# GamesServersPort ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **internal_port** | Option<**i32**> | | [optional] -**protocol** | [**crate::models::ServersPortProtocol**](ServersPortProtocol.md) | | +**protocol** | [**crate::models::GamesServersPortProtocol**](GamesServersPortProtocol.md) | | **public_hostname** | Option<**String**> | | [optional] **public_port** | Option<**i32**> | | [optional] -**routing** | [**crate::models::ServersPortRouting**](ServersPortRouting.md) | | +**routing** | [**crate::models::GamesServersPortRouting**](GamesServersPortRouting.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/full/rust/docs/GamesServersPortProtocol.md b/sdks/full/rust/docs/GamesServersPortProtocol.md new file mode 100644 index 0000000000..e13be068da --- /dev/null +++ b/sdks/full/rust/docs/GamesServersPortProtocol.md @@ -0,0 +1,10 @@ +# GamesServersPortProtocol + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/full/rust/docs/ServersPortRouting.md b/sdks/full/rust/docs/GamesServersPortRouting.md similarity index 94% rename from sdks/full/rust/docs/ServersPortRouting.md rename to sdks/full/rust/docs/GamesServersPortRouting.md index 1ac474c230..12aa111c32 100644 --- a/sdks/full/rust/docs/ServersPortRouting.md +++ b/sdks/full/rust/docs/GamesServersPortRouting.md @@ -1,4 +1,4 @@ -# ServersPortRouting +# GamesServersPortRouting ## Properties diff --git a/sdks/full/rust/docs/ServersResources.md b/sdks/full/rust/docs/GamesServersResources.md similarity index 95% rename from sdks/full/rust/docs/ServersResources.md rename to sdks/full/rust/docs/GamesServersResources.md index 3b3f9d6882..236dd811f1 100644 --- a/sdks/full/rust/docs/ServersResources.md +++ b/sdks/full/rust/docs/GamesServersResources.md @@ -1,4 +1,4 @@ -# ServersResources +# GamesServersResources ## Properties diff --git a/sdks/full/rust-cli/docs/ServersServer.md b/sdks/full/rust/docs/GamesServersServer.md similarity index 84% rename from sdks/full/rust-cli/docs/ServersServer.md rename to sdks/full/rust/docs/GamesServersServer.md index d62789a202..372cc31502 100644 --- a/sdks/full/rust-cli/docs/ServersServer.md +++ b/sdks/full/rust/docs/GamesServersServer.md @@ -1,4 +1,4 @@ -# ServersServer +# GamesServersServer ## Properties @@ -13,8 +13,8 @@ Name | Type | Description | Notes **game_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **image_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **kill_timeout** | Option<**i64**> | The duration to wait for in milliseconds before killing the server. This should be set to a safe default, and can be overridden during a DELETE request if needed. | [optional] -**network** | [**crate::models::ServersNetwork**](ServersNetwork.md) | | -**resources** | [**crate::models::ServersResources**](ServersResources.md) | | +**network** | [**crate::models::GamesServersNetwork**](GamesServersNetwork.md) | | +**resources** | [**crate::models::GamesServersResources**](GamesServersResources.md) | | **server_id** | [**uuid::Uuid**](uuid::Uuid.md) | | **start_ts** | Option<**i64**> | | [optional] **tags** | Option<[**serde_json::Value**](.md)> | | diff --git a/sdks/full/rust/docs/ServersBuildCompression.md b/sdks/full/rust/docs/ServersBuildCompression.md deleted file mode 100644 index 3e1b76a053..0000000000 --- a/sdks/full/rust/docs/ServersBuildCompression.md +++ /dev/null @@ -1,10 +0,0 @@ -# ServersBuildCompression - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/full/rust/docs/ServersBuildKind.md b/sdks/full/rust/docs/ServersBuildKind.md deleted file mode 100644 index 6fc399d0e0..0000000000 --- a/sdks/full/rust/docs/ServersBuildKind.md +++ /dev/null @@ -1,10 +0,0 @@ -# ServersBuildKind - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/full/rust/docs/ServersCreateServerResponse.md b/sdks/full/rust/docs/ServersCreateServerResponse.md deleted file mode 100644 index 29bae37bf7..0000000000 --- a/sdks/full/rust/docs/ServersCreateServerResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersCreateServerResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**server** | [**crate::models::ServersServer**](ServersServer.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/full/rust/docs/ServersDestroyServerResponse.md b/sdks/full/rust/docs/ServersDestroyServerResponse.md deleted file mode 100644 index 0cf193ed7a..0000000000 --- a/sdks/full/rust/docs/ServersDestroyServerResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersDestroyServerResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**server_id** | [**uuid::Uuid**](uuid::Uuid.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/full/rust/docs/ServersGetServerResponse.md b/sdks/full/rust/docs/ServersGetServerResponse.md deleted file mode 100644 index f5e5e42f86..0000000000 --- a/sdks/full/rust/docs/ServersGetServerResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersGetServerResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**server** | [**crate::models::ServersServer**](ServersServer.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/full/rust/docs/ServersListServersResponse.md b/sdks/full/rust/docs/ServersListServersResponse.md deleted file mode 100644 index b1c8e2d66a..0000000000 --- a/sdks/full/rust/docs/ServersListServersResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ServersListServersResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**servers** | [**Vec**](ServersServer.md) | A list of servers for the game associated with the token. | - -[[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/full/rust/docs/ServersLogStream.md b/sdks/full/rust/docs/ServersLogStream.md deleted file mode 100644 index 9706b84a3a..0000000000 --- a/sdks/full/rust/docs/ServersLogStream.md +++ /dev/null @@ -1,10 +0,0 @@ -# ServersLogStream - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/full/rust/docs/ServersNetworkMode.md b/sdks/full/rust/docs/ServersNetworkMode.md deleted file mode 100644 index 9fdd3e28c1..0000000000 --- a/sdks/full/rust/docs/ServersNetworkMode.md +++ /dev/null @@ -1,10 +0,0 @@ -# ServersNetworkMode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/full/rust/docs/ServersPortProtocol.md b/sdks/full/rust/docs/ServersPortProtocol.md deleted file mode 100644 index 595d11df8f..0000000000 --- a/sdks/full/rust/docs/ServersPortProtocol.md +++ /dev/null @@ -1,10 +0,0 @@ -# ServersPortProtocol - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/full/rust-cli/src/apis/servers_api.rs b/sdks/full/rust/src/apis/games_servers_api.rs similarity index 74% rename from sdks/full/rust-cli/src/apis/servers_api.rs rename to sdks/full/rust/src/apis/games_servers_api.rs index 9fb0383929..2e6678c1e5 100644 --- a/sdks/full/rust-cli/src/apis/servers_api.rs +++ b/sdks/full/rust/src/apis/games_servers_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_create`] +/// struct for typed errors of method [`games_servers_create`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersCreateError { +pub enum GamesServersCreateError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -28,10 +28,10 @@ pub enum ServersCreateError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_destroy`] +/// struct for typed errors of method [`games_servers_destroy`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersDestroyError { +pub enum GamesServersDestroyError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -41,10 +41,10 @@ pub enum ServersDestroyError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_get`] +/// struct for typed errors of method [`games_servers_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersGetError { +pub enum GamesServersGetError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -54,10 +54,10 @@ pub enum ServersGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_list`] +/// struct for typed errors of method [`games_servers_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersListError { +pub enum GamesServersListError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -69,12 +69,12 @@ pub enum ServersListError { /// Create a new dynamic server. -pub async fn servers_create(configuration: &configuration::Configuration, servers_create_server_request: crate::models::ServersCreateServerRequest) -> Result> { +pub async fn games_servers_create(configuration: &configuration::Configuration, game_id: &str, games_servers_create_server_request: crate::models::GamesServersCreateServerRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/servers", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -83,7 +83,7 @@ pub async fn servers_create(configuration: &configuration::Configuration, server if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; - local_var_req_builder = local_var_req_builder.json(&servers_create_server_request); + local_var_req_builder = local_var_req_builder.json(&games_servers_create_server_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -94,19 +94,19 @@ pub async fn servers_create(configuration: &configuration::Configuration, server if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Destroy a dynamic server. -pub async fn servers_destroy(configuration: &configuration::Configuration, server_id: &str, override_kill_timeout: Option) -> Result> { +pub async fn games_servers_destroy(configuration: &configuration::Configuration, game_id: &str, server_id: &str, override_kill_timeout: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_str) = override_kill_timeout { @@ -128,19 +128,19 @@ pub async fn servers_destroy(configuration: &configuration::Configuration, serve if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Gets a dynamic server. -pub async fn servers_get(configuration: &configuration::Configuration, server_id: &str) -> Result> { +pub async fn games_servers_get(configuration: &configuration::Configuration, game_id: &str, server_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -159,25 +159,25 @@ pub async fn servers_get(configuration: &configuration::Configuration, server_id if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Lists all servers associated with the token used. Can be filtered by tags in the query string. -pub async fn servers_list(configuration: &configuration::Configuration, tags: Option<&str>, game_id: Option<&str>) -> Result> { +pub async fn games_servers_list(configuration: &configuration::Configuration, game_id: &str, tags: Option<&str>, game_id2: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/servers", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = tags { local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -196,7 +196,7 @@ pub async fn servers_list(configuration: &configuration::Configuration, tags: Op if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust/src/apis/servers_builds_api.rs b/sdks/full/rust/src/apis/games_servers_builds_api.rs similarity index 72% rename from sdks/full/rust/src/apis/servers_builds_api.rs rename to sdks/full/rust/src/apis/games_servers_builds_api.rs index 496a1d874a..95d4950995 100644 --- a/sdks/full/rust/src/apis/servers_builds_api.rs +++ b/sdks/full/rust/src/apis/games_servers_builds_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_builds_complete_build`] +/// struct for typed errors of method [`games_servers_builds_complete_build`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsCompleteBuildError { +pub enum GamesServersBuildsCompleteBuildError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -28,10 +28,10 @@ pub enum ServersBuildsCompleteBuildError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_builds_list_builds`] +/// struct for typed errors of method [`games_servers_builds_list_builds`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsListBuildsError { +pub enum GamesServersBuildsListBuildsError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -41,10 +41,10 @@ pub enum ServersBuildsListBuildsError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`servers_builds_prepare_build`] +/// struct for typed errors of method [`games_servers_builds_prepare_build`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersBuildsPrepareBuildError { +pub enum GamesServersBuildsPrepareBuildError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -56,12 +56,12 @@ pub enum ServersBuildsPrepareBuildError { /// Marks an upload as complete. -pub async fn servers_builds_complete_build(configuration: &configuration::Configuration, upload_id: &str) -> Result<(), Error> { +pub async fn games_servers_builds_complete_build(configuration: &configuration::Configuration, game_id: &str, build_id: &str) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/uploads/{upload_id}/complete", local_var_configuration.base_path, upload_id=crate::apis::urlencode(upload_id)); + let local_var_uri_str = format!("{}/games/{game_id}/builds/{build_id}/complete", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), build_id=crate::apis::urlencode(build_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -80,25 +80,25 @@ pub async fn servers_builds_complete_build(configuration: &configuration::Config if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. -pub async fn servers_builds_list_builds(configuration: &configuration::Configuration, tags: Option<&str>, game_id: Option<&str>) -> Result> { +pub async fn games_servers_builds_list_builds(configuration: &configuration::Configuration, game_id: &str, tags: Option<&str>, game_id2: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/builds", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/builds", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = tags { local_var_req_builder = local_var_req_builder.query(&[("tags", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -117,19 +117,19 @@ pub async fn servers_builds_list_builds(configuration: &configuration::Configura if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Creates a new game build for the given game. -pub async fn servers_builds_prepare_build(configuration: &configuration::Configuration, servers_create_build_request: crate::models::ServersCreateBuildRequest) -> Result> { +pub async fn games_servers_builds_prepare_build(configuration: &configuration::Configuration, game_id: &str, games_servers_create_build_request: crate::models::GamesServersCreateBuildRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/builds", local_var_configuration.base_path); + let local_var_uri_str = format!("{}/games/{game_id}/builds/prepare", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { @@ -138,7 +138,7 @@ pub async fn servers_builds_prepare_build(configuration: &configuration::Configu if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; - local_var_req_builder = local_var_req_builder.json(&servers_create_build_request); + local_var_req_builder = local_var_req_builder.json(&games_servers_create_build_request); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -149,7 +149,7 @@ pub async fn servers_builds_prepare_build(configuration: &configuration::Configu if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust-cli/src/apis/servers_logs_api.rs b/sdks/full/rust/src/apis/games_servers_logs_api.rs similarity index 73% rename from sdks/full/rust-cli/src/apis/servers_logs_api.rs rename to sdks/full/rust/src/apis/games_servers_logs_api.rs index 1314d6f921..a277a8dfe4 100644 --- a/sdks/full/rust-cli/src/apis/servers_logs_api.rs +++ b/sdks/full/rust/src/apis/games_servers_logs_api.rs @@ -15,10 +15,10 @@ use crate::apis::ResponseContent; use super::{Error, configuration}; -/// struct for typed errors of method [`servers_logs_get_server_logs`] +/// struct for typed errors of method [`games_servers_logs_get_server_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServersLogsGetServerLogsError { +pub enum GamesServersLogsGetServerLogsError { Status400(crate::models::ErrorBody), Status403(crate::models::ErrorBody), Status404(crate::models::ErrorBody), @@ -30,16 +30,16 @@ pub enum ServersLogsGetServerLogsError { /// Returns the logs for a given server. -pub async fn servers_logs_get_server_logs(configuration: &configuration::Configuration, server_id: &str, stream: crate::models::ServersLogStream, game_id: Option<&str>, watch_index: Option<&str>) -> Result> { +pub async fn games_servers_logs_get_server_logs(configuration: &configuration::Configuration, game_id: &str, server_id: &str, stream: crate::models::GamesServersLogStream, game_id2: Option<&str>, watch_index: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!("{}/servers/{server_id}/logs", local_var_configuration.base_path, server_id=crate::apis::urlencode(server_id)); + let local_var_uri_str = format!("{}/games/{game_id}/servers/{server_id}/logs", local_var_configuration.base_path, game_id=crate::apis::urlencode(game_id), server_id=crate::apis::urlencode(server_id)); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); local_var_req_builder = local_var_req_builder.query(&[("stream", &stream.to_string())]); - if let Some(ref local_var_str) = game_id { + if let Some(ref local_var_str) = game_id2 { local_var_req_builder = local_var_req_builder.query(&[("game_id", &local_var_str.to_string())]); } if let Some(ref local_var_str) = watch_index { @@ -61,7 +61,7 @@ pub async fn servers_logs_get_server_logs(configuration: &configuration::Configu if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } diff --git a/sdks/full/rust/src/apis/mod.rs b/sdks/full/rust/src/apis/mod.rs index 11b380d655..505fa0f688 100644 --- a/sdks/full/rust/src/apis/mod.rs +++ b/sdks/full/rust/src/apis/mod.rs @@ -114,6 +114,9 @@ pub mod cloud_groups_api; pub mod cloud_logs_api; pub mod cloud_tiers_api; pub mod cloud_uploads_api; +pub mod games_servers_api; +pub mod games_servers_builds_api; +pub mod games_servers_logs_api; pub mod group_api; pub mod group_invites_api; pub mod group_join_requests_api; @@ -129,8 +132,5 @@ pub mod matchmaker_regions_api; pub mod portal_games_api; pub mod provision_datacenters_api; pub mod provision_servers_api; -pub mod servers_api; -pub mod servers_builds_api; -pub mod servers_logs_api; pub mod configuration; diff --git a/sdks/full/rust/src/models/servers_build_compression.rs b/sdks/full/rust/src/models/games_servers_build_compression.rs similarity index 76% rename from sdks/full/rust/src/models/servers_build_compression.rs rename to sdks/full/rust/src/models/games_servers_build_compression.rs index fd549d6279..91ec708e80 100644 --- a/sdks/full/rust/src/models/servers_build_compression.rs +++ b/sdks/full/rust/src/models/games_servers_build_compression.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersBuildCompression { +pub enum GamesServersBuildCompression { #[serde(rename = "none")] None, #[serde(rename = "lz4")] @@ -19,7 +19,7 @@ pub enum ServersBuildCompression { } -impl ToString for ServersBuildCompression { +impl ToString for GamesServersBuildCompression { fn to_string(&self) -> String { match self { Self::None => String::from("none"), @@ -28,8 +28,8 @@ impl ToString for ServersBuildCompression { } } -impl Default for ServersBuildCompression { - fn default() -> ServersBuildCompression { +impl Default for GamesServersBuildCompression { + fn default() -> GamesServersBuildCompression { Self::None } } diff --git a/sdks/full/rust-cli/src/models/servers_build_kind.rs b/sdks/full/rust/src/models/games_servers_build_kind.rs similarity index 80% rename from sdks/full/rust-cli/src/models/servers_build_kind.rs rename to sdks/full/rust/src/models/games_servers_build_kind.rs index 853abbb0e7..1886fd0941 100644 --- a/sdks/full/rust-cli/src/models/servers_build_kind.rs +++ b/sdks/full/rust/src/models/games_servers_build_kind.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersBuildKind { +pub enum GamesServersBuildKind { #[serde(rename = "docker_image")] DockerImage, #[serde(rename = "oci_bundle")] @@ -19,7 +19,7 @@ pub enum ServersBuildKind { } -impl ToString for ServersBuildKind { +impl ToString for GamesServersBuildKind { fn to_string(&self) -> String { match self { Self::DockerImage => String::from("docker_image"), @@ -28,8 +28,8 @@ impl ToString for ServersBuildKind { } } -impl Default for ServersBuildKind { - fn default() -> ServersBuildKind { +impl Default for GamesServersBuildKind { + fn default() -> GamesServersBuildKind { Self::DockerImage } } diff --git a/sdks/full/rust-cli/src/models/servers_create_build_request.rs b/sdks/full/rust/src/models/games_servers_create_build_request.rs similarity index 81% rename from sdks/full/rust-cli/src/models/servers_create_build_request.rs rename to sdks/full/rust/src/models/games_servers_create_build_request.rs index 395fe9aeb6..77aa1f62a0 100644 --- a/sdks/full/rust-cli/src/models/servers_create_build_request.rs +++ b/sdks/full/rust/src/models/games_servers_create_build_request.rs @@ -12,9 +12,9 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateBuildRequest { +pub struct GamesServersCreateBuildRequest { #[serde(rename = "compression", skip_serializing_if = "Option::is_none")] - pub compression: Option, + pub compression: Option, /// Represent a resource's readable display name. #[serde(rename = "display_name")] pub display_name: String, @@ -24,16 +24,16 @@ pub struct ServersCreateBuildRequest { #[serde(rename = "image_tag")] pub image_tag: String, #[serde(rename = "kind", skip_serializing_if = "Option::is_none")] - pub kind: Option, + pub kind: Option, #[serde(rename = "multipart_upload", skip_serializing_if = "Option::is_none")] pub multipart_upload: Option, #[serde(rename = "tags", deserialize_with = "Option::deserialize")] pub tags: Option, } -impl ServersCreateBuildRequest { - pub fn new(display_name: String, image_file: crate::models::UploadPrepareFile, image_tag: String, tags: Option) -> ServersCreateBuildRequest { - ServersCreateBuildRequest { +impl GamesServersCreateBuildRequest { + pub fn new(display_name: String, image_file: crate::models::UploadPrepareFile, image_tag: String, tags: Option) -> GamesServersCreateBuildRequest { + GamesServersCreateBuildRequest { compression: None, display_name, image_file: Box::new(image_file), diff --git a/sdks/full/rust-cli/src/models/servers_create_build_response.rs b/sdks/full/rust/src/models/games_servers_create_build_response.rs similarity index 80% rename from sdks/full/rust-cli/src/models/servers_create_build_response.rs rename to sdks/full/rust/src/models/games_servers_create_build_response.rs index 551e3030bf..e199d6330e 100644 --- a/sdks/full/rust-cli/src/models/servers_create_build_response.rs +++ b/sdks/full/rust/src/models/games_servers_create_build_response.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateBuildResponse { +pub struct GamesServersCreateBuildResponse { #[serde(rename = "build_id")] pub build_id: uuid::Uuid, #[serde(rename = "image_presigned_request", skip_serializing_if = "Option::is_none")] @@ -23,9 +23,9 @@ pub struct ServersCreateBuildResponse { pub upload_id: uuid::Uuid, } -impl ServersCreateBuildResponse { - pub fn new(build_id: uuid::Uuid, upload_id: uuid::Uuid) -> ServersCreateBuildResponse { - ServersCreateBuildResponse { +impl GamesServersCreateBuildResponse { + pub fn new(build_id: uuid::Uuid, upload_id: uuid::Uuid) -> GamesServersCreateBuildResponse { + GamesServersCreateBuildResponse { build_id, image_presigned_request: None, image_presigned_requests: None, diff --git a/sdks/full/rust-cli/src/models/servers_create_server_network_request.rs b/sdks/full/rust/src/models/games_servers_create_server_network_request.rs similarity index 63% rename from sdks/full/rust-cli/src/models/servers_create_server_network_request.rs rename to sdks/full/rust/src/models/games_servers_create_server_network_request.rs index d469cc181d..3bf3d7c187 100644 --- a/sdks/full/rust-cli/src/models/servers_create_server_network_request.rs +++ b/sdks/full/rust/src/models/games_servers_create_server_network_request.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerNetworkRequest { +pub struct GamesServersCreateServerNetworkRequest { #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, + pub mode: Option, #[serde(rename = "ports")] - pub ports: ::std::collections::HashMap, + pub ports: ::std::collections::HashMap, } -impl ServersCreateServerNetworkRequest { - pub fn new(ports: ::std::collections::HashMap) -> ServersCreateServerNetworkRequest { - ServersCreateServerNetworkRequest { +impl GamesServersCreateServerNetworkRequest { + pub fn new(ports: ::std::collections::HashMap) -> GamesServersCreateServerNetworkRequest { + GamesServersCreateServerNetworkRequest { mode: None, ports, } diff --git a/sdks/full/rust/src/models/servers_create_server_port_request.rs b/sdks/full/rust/src/models/games_servers_create_server_port_request.rs similarity index 62% rename from sdks/full/rust/src/models/servers_create_server_port_request.rs rename to sdks/full/rust/src/models/games_servers_create_server_port_request.rs index d818685f71..7f8bb7f5f3 100644 --- a/sdks/full/rust/src/models/servers_create_server_port_request.rs +++ b/sdks/full/rust/src/models/games_servers_create_server_port_request.rs @@ -12,18 +12,18 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerPortRequest { +pub struct GamesServersCreateServerPortRequest { #[serde(rename = "internal_port", skip_serializing_if = "Option::is_none")] pub internal_port: Option, #[serde(rename = "protocol")] - pub protocol: crate::models::ServersPortProtocol, + pub protocol: crate::models::GamesServersPortProtocol, #[serde(rename = "routing", skip_serializing_if = "Option::is_none")] - pub routing: Option>, + pub routing: Option>, } -impl ServersCreateServerPortRequest { - pub fn new(protocol: crate::models::ServersPortProtocol) -> ServersCreateServerPortRequest { - ServersCreateServerPortRequest { +impl GamesServersCreateServerPortRequest { + pub fn new(protocol: crate::models::GamesServersPortProtocol) -> GamesServersCreateServerPortRequest { + GamesServersCreateServerPortRequest { internal_port: None, protocol, routing: None, diff --git a/sdks/full/rust-cli/src/models/servers_create_server_request.rs b/sdks/full/rust/src/models/games_servers_create_server_request.rs similarity index 79% rename from sdks/full/rust-cli/src/models/servers_create_server_request.rs rename to sdks/full/rust/src/models/games_servers_create_server_request.rs index e50b4b9541..8b132e9b05 100644 --- a/sdks/full/rust-cli/src/models/servers_create_server_request.rs +++ b/sdks/full/rust/src/models/games_servers_create_server_request.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerRequest { +pub struct GamesServersCreateServerRequest { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, /// The name ID of the datacenter @@ -26,9 +26,9 @@ pub struct ServersCreateServerRequest { #[serde(rename = "kill_timeout", skip_serializing_if = "Option::is_none")] pub kill_timeout: Option, #[serde(rename = "network")] - pub network: Box, + pub network: Box, #[serde(rename = "resources")] - pub resources: Box, + pub resources: Box, #[serde(rename = "tags", deserialize_with = "Option::deserialize")] pub tags: Option, /// A url to send to which events from the server running will be sent @@ -36,9 +36,9 @@ pub struct ServersCreateServerRequest { pub webhook_url: Option, } -impl ServersCreateServerRequest { - pub fn new(datacenter: String, image_id: uuid::Uuid, network: crate::models::ServersCreateServerNetworkRequest, resources: crate::models::ServersResources, tags: Option) -> ServersCreateServerRequest { - ServersCreateServerRequest { +impl GamesServersCreateServerRequest { + pub fn new(datacenter: String, image_id: uuid::Uuid, network: crate::models::GamesServersCreateServerNetworkRequest, resources: crate::models::GamesServersResources, tags: Option) -> GamesServersCreateServerRequest { + GamesServersCreateServerRequest { arguments: None, datacenter, environment: None, diff --git a/sdks/full/rust/src/models/servers_create_server_response.rs b/sdks/full/rust/src/models/games_servers_create_server_response.rs similarity index 58% rename from sdks/full/rust/src/models/servers_create_server_response.rs rename to sdks/full/rust/src/models/games_servers_create_server_response.rs index 3c32cbd896..e0ad46d243 100644 --- a/sdks/full/rust/src/models/servers_create_server_response.rs +++ b/sdks/full/rust/src/models/games_servers_create_server_response.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerResponse { +pub struct GamesServersCreateServerResponse { #[serde(rename = "server")] - pub server: Box, + pub server: Box, } -impl ServersCreateServerResponse { - pub fn new(server: crate::models::ServersServer) -> ServersCreateServerResponse { - ServersCreateServerResponse { +impl GamesServersCreateServerResponse { + pub fn new(server: crate::models::GamesServersServer) -> GamesServersCreateServerResponse { + GamesServersCreateServerResponse { server: Box::new(server), } } diff --git a/sdks/full/rust/src/models/servers_get_server_logs_response.rs b/sdks/full/rust/src/models/games_servers_get_server_logs_response.rs similarity index 78% rename from sdks/full/rust/src/models/servers_get_server_logs_response.rs rename to sdks/full/rust/src/models/games_servers_get_server_logs_response.rs index dd6df5a770..2b70761837 100644 --- a/sdks/full/rust/src/models/servers_get_server_logs_response.rs +++ b/sdks/full/rust/src/models/games_servers_get_server_logs_response.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersGetServerLogsResponse { +pub struct GamesServersGetServerLogsResponse { /// Sorted old to new. #[serde(rename = "lines")] pub lines: Vec, @@ -23,9 +23,9 @@ pub struct ServersGetServerLogsResponse { pub watch: Box, } -impl ServersGetServerLogsResponse { - pub fn new(lines: Vec, timestamps: Vec, watch: crate::models::WatchResponse) -> ServersGetServerLogsResponse { - ServersGetServerLogsResponse { +impl GamesServersGetServerLogsResponse { + pub fn new(lines: Vec, timestamps: Vec, watch: crate::models::WatchResponse) -> GamesServersGetServerLogsResponse { + GamesServersGetServerLogsResponse { lines, timestamps, watch: Box::new(watch), diff --git a/sdks/full/rust-cli/src/models/servers_create_server_response.rs b/sdks/full/rust/src/models/games_servers_get_server_response.rs similarity index 59% rename from sdks/full/rust-cli/src/models/servers_create_server_response.rs rename to sdks/full/rust/src/models/games_servers_get_server_response.rs index 3c32cbd896..9e1a147fe5 100644 --- a/sdks/full/rust-cli/src/models/servers_create_server_response.rs +++ b/sdks/full/rust/src/models/games_servers_get_server_response.rs @@ -12,14 +12,14 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersCreateServerResponse { +pub struct GamesServersGetServerResponse { #[serde(rename = "server")] - pub server: Box, + pub server: Box, } -impl ServersCreateServerResponse { - pub fn new(server: crate::models::ServersServer) -> ServersCreateServerResponse { - ServersCreateServerResponse { +impl GamesServersGetServerResponse { + pub fn new(server: crate::models::GamesServersServer) -> GamesServersGetServerResponse { + GamesServersGetServerResponse { server: Box::new(server), } } diff --git a/sdks/full/rust-cli/src/models/servers_list_builds_response.rs b/sdks/full/rust/src/models/games_servers_list_builds_response.rs similarity index 78% rename from sdks/full/rust-cli/src/models/servers_list_builds_response.rs rename to sdks/full/rust/src/models/games_servers_list_builds_response.rs index 3bfdec824f..86a9771f1f 100644 --- a/sdks/full/rust-cli/src/models/servers_list_builds_response.rs +++ b/sdks/full/rust/src/models/games_servers_list_builds_response.rs @@ -12,15 +12,15 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersListBuildsResponse { +pub struct GamesServersListBuildsResponse { /// A list of builds for the game associated with the token. #[serde(rename = "builds")] pub builds: Vec, } -impl ServersListBuildsResponse { - pub fn new(builds: Vec) -> ServersListBuildsResponse { - ServersListBuildsResponse { +impl GamesServersListBuildsResponse { + pub fn new(builds: Vec) -> GamesServersListBuildsResponse { + GamesServersListBuildsResponse { builds, } } diff --git a/sdks/full/rust/src/models/servers_list_servers_response.rs b/sdks/full/rust/src/models/games_servers_list_servers_response.rs similarity index 61% rename from sdks/full/rust/src/models/servers_list_servers_response.rs rename to sdks/full/rust/src/models/games_servers_list_servers_response.rs index 202010aa26..9651221a82 100644 --- a/sdks/full/rust/src/models/servers_list_servers_response.rs +++ b/sdks/full/rust/src/models/games_servers_list_servers_response.rs @@ -12,15 +12,15 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersListServersResponse { +pub struct GamesServersListServersResponse { /// A list of servers for the game associated with the token. #[serde(rename = "servers")] - pub servers: Vec, + pub servers: Vec, } -impl ServersListServersResponse { - pub fn new(servers: Vec) -> ServersListServersResponse { - ServersListServersResponse { +impl GamesServersListServersResponse { + pub fn new(servers: Vec) -> GamesServersListServersResponse { + GamesServersListServersResponse { servers, } } diff --git a/sdks/full/rust-cli/src/models/servers_log_stream.rs b/sdks/full/rust/src/models/games_servers_log_stream.rs similarity index 80% rename from sdks/full/rust-cli/src/models/servers_log_stream.rs rename to sdks/full/rust/src/models/games_servers_log_stream.rs index b96bdda215..7194ee8d17 100644 --- a/sdks/full/rust-cli/src/models/servers_log_stream.rs +++ b/sdks/full/rust/src/models/games_servers_log_stream.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersLogStream { +pub enum GamesServersLogStream { #[serde(rename = "std_out")] StdOut, #[serde(rename = "std_err")] @@ -19,7 +19,7 @@ pub enum ServersLogStream { } -impl ToString for ServersLogStream { +impl ToString for GamesServersLogStream { fn to_string(&self) -> String { match self { Self::StdOut => String::from("std_out"), @@ -28,8 +28,8 @@ impl ToString for ServersLogStream { } } -impl Default for ServersLogStream { - fn default() -> ServersLogStream { +impl Default for GamesServersLogStream { + fn default() -> GamesServersLogStream { Self::StdOut } } diff --git a/sdks/full/rust/src/models/servers_network.rs b/sdks/full/rust/src/models/games_servers_network.rs similarity index 72% rename from sdks/full/rust/src/models/servers_network.rs rename to sdks/full/rust/src/models/games_servers_network.rs index 97bade5673..6d0d2c891c 100644 --- a/sdks/full/rust/src/models/servers_network.rs +++ b/sdks/full/rust/src/models/games_servers_network.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersNetwork { +pub struct GamesServersNetwork { #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, + pub mode: Option, #[serde(rename = "ports")] - pub ports: ::std::collections::HashMap, + pub ports: ::std::collections::HashMap, } -impl ServersNetwork { - pub fn new(ports: ::std::collections::HashMap) -> ServersNetwork { - ServersNetwork { +impl GamesServersNetwork { + pub fn new(ports: ::std::collections::HashMap) -> GamesServersNetwork { + GamesServersNetwork { mode: None, ports, } diff --git a/sdks/full/rust/src/models/servers_network_mode.rs b/sdks/full/rust/src/models/games_servers_network_mode.rs similarity index 78% rename from sdks/full/rust/src/models/servers_network_mode.rs rename to sdks/full/rust/src/models/games_servers_network_mode.rs index bbb9bd9a5b..78008e9dae 100644 --- a/sdks/full/rust/src/models/servers_network_mode.rs +++ b/sdks/full/rust/src/models/games_servers_network_mode.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersNetworkMode { +pub enum GamesServersNetworkMode { #[serde(rename = "bridge")] Bridge, #[serde(rename = "host")] @@ -19,7 +19,7 @@ pub enum ServersNetworkMode { } -impl ToString for ServersNetworkMode { +impl ToString for GamesServersNetworkMode { fn to_string(&self) -> String { match self { Self::Bridge => String::from("bridge"), @@ -28,8 +28,8 @@ impl ToString for ServersNetworkMode { } } -impl Default for ServersNetworkMode { - fn default() -> ServersNetworkMode { +impl Default for GamesServersNetworkMode { + fn default() -> GamesServersNetworkMode { Self::Bridge } } diff --git a/sdks/full/rust/src/models/servers_port.rs b/sdks/full/rust/src/models/games_servers_port.rs similarity index 72% rename from sdks/full/rust/src/models/servers_port.rs rename to sdks/full/rust/src/models/games_servers_port.rs index ab305ac1e4..958763e8e7 100644 --- a/sdks/full/rust/src/models/servers_port.rs +++ b/sdks/full/rust/src/models/games_servers_port.rs @@ -12,22 +12,22 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersPort { +pub struct GamesServersPort { #[serde(rename = "internal_port", skip_serializing_if = "Option::is_none")] pub internal_port: Option, #[serde(rename = "protocol")] - pub protocol: crate::models::ServersPortProtocol, + pub protocol: crate::models::GamesServersPortProtocol, #[serde(rename = "public_hostname", skip_serializing_if = "Option::is_none")] pub public_hostname: Option, #[serde(rename = "public_port", skip_serializing_if = "Option::is_none")] pub public_port: Option, #[serde(rename = "routing")] - pub routing: Box, + pub routing: Box, } -impl ServersPort { - pub fn new(protocol: crate::models::ServersPortProtocol, routing: crate::models::ServersPortRouting) -> ServersPort { - ServersPort { +impl GamesServersPort { + pub fn new(protocol: crate::models::GamesServersPortProtocol, routing: crate::models::GamesServersPortRouting) -> GamesServersPort { + GamesServersPort { internal_port: None, protocol, public_hostname: None, diff --git a/sdks/full/rust/src/models/servers_port_protocol.rs b/sdks/full/rust/src/models/games_servers_port_protocol.rs similarity index 83% rename from sdks/full/rust/src/models/servers_port_protocol.rs rename to sdks/full/rust/src/models/games_servers_port_protocol.rs index e2e8c326c9..184df31ce0 100644 --- a/sdks/full/rust/src/models/servers_port_protocol.rs +++ b/sdks/full/rust/src/models/games_servers_port_protocol.rs @@ -11,7 +11,7 @@ /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ServersPortProtocol { +pub enum GamesServersPortProtocol { #[serde(rename = "http")] Http, #[serde(rename = "https")] @@ -25,7 +25,7 @@ pub enum ServersPortProtocol { } -impl ToString for ServersPortProtocol { +impl ToString for GamesServersPortProtocol { fn to_string(&self) -> String { match self { Self::Http => String::from("http"), @@ -37,8 +37,8 @@ impl ToString for ServersPortProtocol { } } -impl Default for ServersPortProtocol { - fn default() -> ServersPortProtocol { +impl Default for GamesServersPortProtocol { + fn default() -> GamesServersPortProtocol { Self::Http } } diff --git a/sdks/full/rust/src/models/servers_port_routing.rs b/sdks/full/rust/src/models/games_servers_port_routing.rs similarity index 80% rename from sdks/full/rust/src/models/servers_port_routing.rs rename to sdks/full/rust/src/models/games_servers_port_routing.rs index 83f0846fc4..6504f350f2 100644 --- a/sdks/full/rust/src/models/servers_port_routing.rs +++ b/sdks/full/rust/src/models/games_servers_port_routing.rs @@ -12,16 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersPortRouting { +pub struct GamesServersPortRouting { #[serde(rename = "game_guard", skip_serializing_if = "Option::is_none")] pub game_guard: Option, #[serde(rename = "host", skip_serializing_if = "Option::is_none")] pub host: Option, } -impl ServersPortRouting { - pub fn new() -> ServersPortRouting { - ServersPortRouting { +impl GamesServersPortRouting { + pub fn new() -> GamesServersPortRouting { + GamesServersPortRouting { game_guard: None, host: None, } diff --git a/sdks/full/rust/src/models/servers_resources.rs b/sdks/full/rust/src/models/games_servers_resources.rs similarity index 80% rename from sdks/full/rust/src/models/servers_resources.rs rename to sdks/full/rust/src/models/games_servers_resources.rs index d29a3cb0ac..e64e78b7a3 100644 --- a/sdks/full/rust/src/models/servers_resources.rs +++ b/sdks/full/rust/src/models/games_servers_resources.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersResources { +pub struct GamesServersResources { /// The number of CPU cores in millicores, or 1/1000 of a core. For example, 1/8 of a core would be 125 millicores, and 1 core would be 1000 millicores. #[serde(rename = "cpu")] pub cpu: i32, @@ -21,9 +21,9 @@ pub struct ServersResources { pub memory: i32, } -impl ServersResources { - pub fn new(cpu: i32, memory: i32) -> ServersResources { - ServersResources { +impl GamesServersResources { + pub fn new(cpu: i32, memory: i32) -> GamesServersResources { + GamesServersResources { cpu, memory, } diff --git a/sdks/full/rust/src/models/servers_server.rs b/sdks/full/rust/src/models/games_servers_server.rs similarity index 85% rename from sdks/full/rust/src/models/servers_server.rs rename to sdks/full/rust/src/models/games_servers_server.rs index 637c914820..96bf28c6cc 100644 --- a/sdks/full/rust/src/models/servers_server.rs +++ b/sdks/full/rust/src/models/games_servers_server.rs @@ -12,7 +12,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersServer { +pub struct GamesServersServer { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, #[serde(rename = "cluster_id")] @@ -33,9 +33,9 @@ pub struct ServersServer { #[serde(rename = "kill_timeout", skip_serializing_if = "Option::is_none")] pub kill_timeout: Option, #[serde(rename = "network")] - pub network: Box, + pub network: Box, #[serde(rename = "resources")] - pub resources: Box, + pub resources: Box, #[serde(rename = "server_id")] pub server_id: uuid::Uuid, #[serde(rename = "start_ts", skip_serializing_if = "Option::is_none")] @@ -44,9 +44,9 @@ pub struct ServersServer { pub tags: Option, } -impl ServersServer { - pub fn new(cluster_id: uuid::Uuid, create_ts: i64, datacenter_id: uuid::Uuid, game_id: uuid::Uuid, image_id: uuid::Uuid, network: crate::models::ServersNetwork, resources: crate::models::ServersResources, server_id: uuid::Uuid, tags: Option) -> ServersServer { - ServersServer { +impl GamesServersServer { + pub fn new(cluster_id: uuid::Uuid, create_ts: i64, datacenter_id: uuid::Uuid, game_id: uuid::Uuid, image_id: uuid::Uuid, network: crate::models::GamesServersNetwork, resources: crate::models::GamesServersResources, server_id: uuid::Uuid, tags: Option) -> GamesServersServer { + GamesServersServer { arguments: None, cluster_id, create_ts, diff --git a/sdks/full/rust/src/models/mod.rs b/sdks/full/rust/src/models/mod.rs index a15d7977dc..dce2f2f89d 100644 --- a/sdks/full/rust/src/models/mod.rs +++ b/sdks/full/rust/src/models/mod.rs @@ -382,6 +382,46 @@ pub mod game_stat_summary; pub use self::game_stat_summary::GameStatSummary; pub mod game_summary; pub use self::game_summary::GameSummary; +pub mod games_servers_build_compression; +pub use self::games_servers_build_compression::GamesServersBuildCompression; +pub mod games_servers_build_kind; +pub use self::games_servers_build_kind::GamesServersBuildKind; +pub mod games_servers_create_build_request; +pub use self::games_servers_create_build_request::GamesServersCreateBuildRequest; +pub mod games_servers_create_build_response; +pub use self::games_servers_create_build_response::GamesServersCreateBuildResponse; +pub mod games_servers_create_server_network_request; +pub use self::games_servers_create_server_network_request::GamesServersCreateServerNetworkRequest; +pub mod games_servers_create_server_port_request; +pub use self::games_servers_create_server_port_request::GamesServersCreateServerPortRequest; +pub mod games_servers_create_server_request; +pub use self::games_servers_create_server_request::GamesServersCreateServerRequest; +pub mod games_servers_create_server_response; +pub use self::games_servers_create_server_response::GamesServersCreateServerResponse; +pub mod games_servers_get_server_logs_response; +pub use self::games_servers_get_server_logs_response::GamesServersGetServerLogsResponse; +pub mod games_servers_get_server_response; +pub use self::games_servers_get_server_response::GamesServersGetServerResponse; +pub mod games_servers_list_builds_response; +pub use self::games_servers_list_builds_response::GamesServersListBuildsResponse; +pub mod games_servers_list_servers_response; +pub use self::games_servers_list_servers_response::GamesServersListServersResponse; +pub mod games_servers_log_stream; +pub use self::games_servers_log_stream::GamesServersLogStream; +pub mod games_servers_network; +pub use self::games_servers_network::GamesServersNetwork; +pub mod games_servers_network_mode; +pub use self::games_servers_network_mode::GamesServersNetworkMode; +pub mod games_servers_port; +pub use self::games_servers_port::GamesServersPort; +pub mod games_servers_port_protocol; +pub use self::games_servers_port_protocol::GamesServersPortProtocol; +pub mod games_servers_port_routing; +pub use self::games_servers_port_routing::GamesServersPortRouting; +pub mod games_servers_resources; +pub use self::games_servers_resources::GamesServersResources; +pub mod games_servers_server; +pub use self::games_servers_server::GamesServersServer; pub mod geo_coord; pub use self::geo_coord::GeoCoord; pub mod geo_distance; @@ -606,48 +646,6 @@ pub mod provision_datacenters_get_tls_response; pub use self::provision_datacenters_get_tls_response::ProvisionDatacentersGetTlsResponse; pub mod provision_servers_get_info_response; pub use self::provision_servers_get_info_response::ProvisionServersGetInfoResponse; -pub mod servers_build_compression; -pub use self::servers_build_compression::ServersBuildCompression; -pub mod servers_build_kind; -pub use self::servers_build_kind::ServersBuildKind; -pub mod servers_create_build_request; -pub use self::servers_create_build_request::ServersCreateBuildRequest; -pub mod servers_create_build_response; -pub use self::servers_create_build_response::ServersCreateBuildResponse; -pub mod servers_create_server_network_request; -pub use self::servers_create_server_network_request::ServersCreateServerNetworkRequest; -pub mod servers_create_server_port_request; -pub use self::servers_create_server_port_request::ServersCreateServerPortRequest; -pub mod servers_create_server_request; -pub use self::servers_create_server_request::ServersCreateServerRequest; -pub mod servers_create_server_response; -pub use self::servers_create_server_response::ServersCreateServerResponse; -pub mod servers_destroy_server_response; -pub use self::servers_destroy_server_response::ServersDestroyServerResponse; -pub mod servers_get_server_logs_response; -pub use self::servers_get_server_logs_response::ServersGetServerLogsResponse; -pub mod servers_get_server_response; -pub use self::servers_get_server_response::ServersGetServerResponse; -pub mod servers_list_builds_response; -pub use self::servers_list_builds_response::ServersListBuildsResponse; -pub mod servers_list_servers_response; -pub use self::servers_list_servers_response::ServersListServersResponse; -pub mod servers_log_stream; -pub use self::servers_log_stream::ServersLogStream; -pub mod servers_network; -pub use self::servers_network::ServersNetwork; -pub mod servers_network_mode; -pub use self::servers_network_mode::ServersNetworkMode; -pub mod servers_port; -pub use self::servers_port::ServersPort; -pub mod servers_port_protocol; -pub use self::servers_port_protocol::ServersPortProtocol; -pub mod servers_port_routing; -pub use self::servers_port_routing::ServersPortRouting; -pub mod servers_resources; -pub use self::servers_resources::ServersResources; -pub mod servers_server; -pub use self::servers_server::ServersServer; pub mod upload_prepare_file; pub use self::upload_prepare_file::UploadPrepareFile; pub mod upload_presigned_request; diff --git a/sdks/full/rust/src/models/servers_destroy_server_response.rs b/sdks/full/rust/src/models/servers_destroy_server_response.rs deleted file mode 100644 index f993e53a94..0000000000 --- a/sdks/full/rust/src/models/servers_destroy_server_response.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Rivet API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.0.1 - * - * Generated by: https://openapi-generator.tech - */ - - - - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServersDestroyServerResponse { - #[serde(rename = "server_id")] - pub server_id: uuid::Uuid, -} - -impl ServersDestroyServerResponse { - pub fn new(server_id: uuid::Uuid) -> ServersDestroyServerResponse { - ServersDestroyServerResponse { - server_id, - } - } -} - - diff --git a/sdks/full/typescript/archive.tgz b/sdks/full/typescript/archive.tgz new file mode 100644 index 0000000000..9bd1fbcead --- /dev/null +++ b/sdks/full/typescript/archive.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3d46a0f917fe62d04407cec672e14d4d8ae167eeb509227448da13b73f41f39 +size 543156 diff --git a/sdks/full/typescript/package.json b/sdks/full/typescript/package.json index 6399ccb231..e4717dc07f 100644 --- a/sdks/full/typescript/package.json +++ b/sdks/full/typescript/package.json @@ -55,5 +55,6 @@ "prettier": "2.7.1", "typescript": "4.6.4", "@types/node-fetch": "2.6.11" - } + }, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } diff --git a/sdks/full/typescript/src/Client.ts b/sdks/full/typescript/src/Client.ts index a4df62420e..5a2c479e81 100644 --- a/sdks/full/typescript/src/Client.ts +++ b/sdks/full/typescript/src/Client.ts @@ -6,11 +6,11 @@ import * as environments from "./environments"; import * as core from "./core"; import { Admin } from "./api/resources/admin/client/Client"; import { Cloud } from "./api/resources/cloud/client/Client"; +import { Games } from "./api/resources/games/client/Client"; import { Group } from "./api/resources/group/client/Client"; import { Identity } from "./api/resources/identity/client/Client"; import { Kv } from "./api/resources/kv/client/Client"; import { Provision } from "./api/resources/provision/client/Client"; -import { Servers } from "./api/resources/servers/client/Client"; import { Auth } from "./api/resources/auth/client/Client"; import { Job } from "./api/resources/job/client/Client"; import { Matchmaker } from "./api/resources/matchmaker/client/Client"; @@ -48,6 +48,12 @@ export class RivetClient { return (this._cloud ??= new Cloud(this._options)); } + protected _games: Games | undefined; + + public get games(): Games { + return (this._games ??= new Games(this._options)); + } + protected _group: Group | undefined; public get group(): Group { @@ -72,12 +78,6 @@ export class RivetClient { return (this._provision ??= new Provision(this._options)); } - protected _servers: Servers | undefined; - - public get servers(): Servers { - return (this._servers ??= new Servers(this._options)); - } - protected _auth: Auth | undefined; public get auth(): Auth { diff --git a/sdks/full/typescript/src/api/resources/games/client/Client.ts b/sdks/full/typescript/src/api/resources/games/client/Client.ts new file mode 100644 index 0000000000..96714e15e2 --- /dev/null +++ b/sdks/full/typescript/src/api/resources/games/client/Client.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import { Servers } from "../resources/servers/client/Client"; + +export declare namespace Games { + interface Options { + environment?: core.Supplier; + token?: core.Supplier; + fetcher?: core.FetchFunction; + } + + 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; + } +} + +export class Games { + constructor(protected readonly _options: Games.Options = {}) {} + + protected _servers: Servers | undefined; + + public get servers(): Servers { + return (this._servers ??= new Servers(this._options)); + } +} diff --git a/sdks/full/typescript/src/api/resources/games/client/index.ts b/sdks/full/typescript/src/api/resources/games/client/index.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/sdks/full/typescript/src/api/resources/games/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/sdks/full/typescript/src/api/resources/games/index.ts b/sdks/full/typescript/src/api/resources/games/index.ts new file mode 100644 index 0000000000..4ce0f39077 --- /dev/null +++ b/sdks/full/typescript/src/api/resources/games/index.ts @@ -0,0 +1,2 @@ +export * from "./resources"; +export * from "./client"; diff --git a/sdks/full/typescript/src/api/resources/games/resources/index.ts b/sdks/full/typescript/src/api/resources/games/resources/index.ts new file mode 100644 index 0000000000..ab7c2d0930 --- /dev/null +++ b/sdks/full/typescript/src/api/resources/games/resources/index.ts @@ -0,0 +1 @@ +export * as servers from "./servers"; diff --git a/sdks/full/typescript/src/api/resources/servers/client/Client.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/client/Client.ts similarity index 90% rename from sdks/full/typescript/src/api/resources/servers/client/Client.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/client/Client.ts index 423ee7b663..1734dcc177 100644 --- a/sdks/full/typescript/src/api/resources/servers/client/Client.ts +++ b/sdks/full/typescript/src/api/resources/games/resources/servers/client/Client.ts @@ -2,12 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as environments from "../../../../environments"; -import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as environments from "../../../../../../environments"; +import * as core from "../../../../../../core"; +import * as Rivet from "../../../../../index"; import urlJoin from "url-join"; -import * as serializers from "../../../../serialization/index"; -import * as errors from "../../../../errors/index"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; import { Builds } from "../resources/builds/client/Client"; import { Logs } from "../resources/logs/client/Client"; @@ -34,6 +34,7 @@ export class Servers { /** * Gets a dynamic server. * + * @param {string} gameId * @param {string} serverId - The id of the server to destroy * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * @@ -45,16 +46,17 @@ export class Servers { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") + * await client.games.servers.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") */ public async get( + gameId: string, serverId: string, requestOptions?: Servers.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - `/servers/${encodeURIComponent(serverId)}` + `/games/${encodeURIComponent(gameId)}/servers/${encodeURIComponent(serverId)}` ), method: "GET", headers: { @@ -67,7 +69,7 @@ export class Servers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.GetServerResponse.parseOrThrow(_response.body, { + return serializers.games.servers.GetServerResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -164,7 +166,8 @@ export class Servers { /** * Lists all servers associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.servers.GetServersRequest} request + * @param {string} gameId + * @param {Rivet.games.servers.GetServersRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -175,29 +178,30 @@ export class Servers { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.list({ + * await client.games.servers.list("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { * tags: "string", * gameId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" * }) */ public async list( - request: Rivet.servers.GetServersRequest = {}, + gameId: string, + request: Rivet.games.servers.GetServersRequest = {}, requestOptions?: Servers.RequestOptions - ): Promise { - const { tags, gameId } = request; + ): Promise { + const { tags, gameId: gameId_ } = request; const _queryParams: Record = {}; if (tags != null) { _queryParams["tags"] = tags; } - if (gameId != null) { - _queryParams["game_id"] = gameId; + if (gameId_ != null) { + _queryParams["game_id"] = gameId_; } const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - "/servers" + `/games/${encodeURIComponent(gameId)}/servers` ), method: "GET", headers: { @@ -211,7 +215,7 @@ export class Servers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.ListServersResponse.parseOrThrow(_response.body, { + return serializers.games.servers.ListServersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -308,7 +312,8 @@ export class Servers { /** * Create a new dynamic server. * - * @param {Rivet.servers.CreateServerRequest} request + * @param {string} gameId + * @param {Rivet.games.servers.CreateServerRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -319,7 +324,7 @@ export class Servers { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.create({ + * await client.games.servers.create("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { * datacenter: "string", * tags: { * "key": "value" @@ -336,13 +341,14 @@ export class Servers { * }) */ public async create( - request: Rivet.servers.CreateServerRequest, + gameId: string, + request: Rivet.games.servers.CreateServerRequest, requestOptions?: Servers.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - "/servers" + `/games/${encodeURIComponent(gameId)}/servers` ), method: "POST", headers: { @@ -350,13 +356,15 @@ export class Servers { }, contentType: "application/json", requestType: "json", - body: serializers.servers.CreateServerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.games.servers.CreateServerRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.CreateServerResponse.parseOrThrow(_response.body, { + return serializers.games.servers.CreateServerResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -453,8 +461,9 @@ export class Servers { /** * Destroy a dynamic server. * + * @param {string} gameId * @param {string} serverId - The id of the server to destroy - * @param {Rivet.servers.DestroyServerRequest} request + * @param {Rivet.games.servers.DestroyServerRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -465,15 +474,16 @@ export class Servers { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.destroy("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { + * await client.games.servers.destroy("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { * overrideKillTimeout: 1000000 * }) */ public async destroy( + gameId: string, serverId: string, - request: Rivet.servers.DestroyServerRequest = {}, + request: Rivet.games.servers.DestroyServerRequest = {}, requestOptions?: Servers.RequestOptions - ): Promise { + ): Promise { const { overrideKillTimeout } = request; const _queryParams: Record = {}; if (overrideKillTimeout != null) { @@ -483,7 +493,7 @@ export class Servers { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - `/servers/${encodeURIComponent(serverId)}` + `/games/${encodeURIComponent(gameId)}/servers/${encodeURIComponent(serverId)}` ), method: "DELETE", headers: { @@ -497,7 +507,7 @@ export class Servers { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.DestroyServerResponse.parseOrThrow(_response.body, { + return serializers.games.servers.DestroyServerResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/sdks/full/typescript/src/api/resources/servers/client/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/client/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/client/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/client/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/client/requests/DestroyServerRequest.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/DestroyServerRequest.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/client/requests/DestroyServerRequest.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/DestroyServerRequest.ts diff --git a/sdks/full/typescript/src/api/resources/servers/client/requests/GetServersRequest.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/GetServersRequest.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/client/requests/GetServersRequest.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/GetServersRequest.ts diff --git a/sdks/full/typescript/src/api/resources/servers/client/requests/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/client/requests/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/client/requests/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/Client.ts similarity index 89% rename from sdks/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/Client.ts index 4253a51005..75b2c33fd5 100644 --- a/sdks/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts +++ b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/Client.ts @@ -2,12 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as environments from "../../../../../../environments"; -import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as environments from "../../../../../../../../environments"; +import * as core from "../../../../../../../../core"; +import * as Rivet from "../../../../../../../index"; import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; -import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../../../serialization/index"; +import * as errors from "../../../../../../../../errors/index"; export declare namespace Builds { interface Options { @@ -32,7 +32,8 @@ export class Builds { /** * Lists all builds of the game associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.servers.GetBuildsRequest} request + * @param {string} gameId + * @param {Rivet.games.servers.GetBuildsRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -43,29 +44,30 @@ export class Builds { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.builds.listBuilds({ + * await client.games.servers.builds.listBuilds("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { * tags: "string", * gameId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" * }) */ public async listBuilds( - request: Rivet.servers.GetBuildsRequest = {}, + gameId: string, + request: Rivet.games.servers.GetBuildsRequest = {}, requestOptions?: Builds.RequestOptions - ): Promise { - const { tags, gameId } = request; + ): Promise { + const { tags, gameId: gameId_ } = request; const _queryParams: Record = {}; if (tags != null) { _queryParams["tags"] = tags; } - if (gameId != null) { - _queryParams["game_id"] = gameId; + if (gameId_ != null) { + _queryParams["game_id"] = gameId_; } const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - "/servers/builds" + `/games/${encodeURIComponent(gameId)}/builds` ), method: "GET", headers: { @@ -79,7 +81,7 @@ export class Builds { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.ListBuildsResponse.parseOrThrow(_response.body, { + return serializers.games.servers.ListBuildsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -176,7 +178,8 @@ export class Builds { /** * Creates a new game build for the given game. * - * @param {Rivet.servers.CreateBuildRequest} request + * @param {string} gameId + * @param {Rivet.games.servers.CreateBuildRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -187,7 +190,7 @@ export class Builds { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.builds.prepareBuild({ + * await client.games.servers.builds.prepareBuild("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { * displayName: "string", * tags: { * "key": "value" @@ -195,18 +198,19 @@ export class Builds { * imageTag: "string", * imageFile: {}, * multipartUpload: true, - * kind: Rivet.servers.BuildKind.DockerImage, - * compression: Rivet.servers.BuildCompression.None + * kind: Rivet.games.servers.BuildKind.DockerImage, + * compression: Rivet.games.servers.BuildCompression.None * }) */ public async prepareBuild( - request: Rivet.servers.CreateBuildRequest, + gameId: string, + request: Rivet.games.servers.CreateBuildRequest, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - "/servers/builds" + `/games/${encodeURIComponent(gameId)}/builds/prepare` ), method: "POST", headers: { @@ -214,13 +218,15 @@ export class Builds { }, contentType: "application/json", requestType: "json", - body: serializers.servers.CreateBuildRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.games.servers.CreateBuildRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 180000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.CreateBuildResponse.parseOrThrow(_response.body, { + return serializers.games.servers.CreateBuildResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -317,7 +323,8 @@ export class Builds { /** * Marks an upload as complete. * - * @param {string} uploadId + * @param {string} gameId + * @param {string} buildId * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -328,13 +335,13 @@ export class Builds { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.builds.completeBuild("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") + * await client.games.servers.builds.completeBuild("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") */ - public async completeBuild(uploadId: string, requestOptions?: Builds.RequestOptions): Promise { + public async completeBuild(gameId: string, buildId: string, requestOptions?: Builds.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - `/servers/uploads/${encodeURIComponent(uploadId)}/complete` + `/games/${encodeURIComponent(gameId)}/builds/${encodeURIComponent(buildId)}/complete` ), method: "POST", headers: { diff --git a/sdks/full/typescript/src/api/resources/servers/resources/builds/client/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/builds/client/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/builds/client/requests/GetBuildsRequest.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/requests/GetBuildsRequest.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/builds/client/requests/GetBuildsRequest.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/requests/GetBuildsRequest.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/builds/client/requests/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/requests/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/builds/client/requests/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/client/requests/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/builds/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/builds/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/builds/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/common/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/common/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/common/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/common/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/Client.ts similarity index 86% rename from sdks/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/Client.ts index 2d5252f593..c9889249e7 100644 --- a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts +++ b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/Client.ts @@ -2,12 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as environments from "../../../../../../environments"; -import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as environments from "../../../../../../../../environments"; +import * as core from "../../../../../../../../core"; +import * as Rivet from "../../../../../../../index"; import urlJoin from "url-join"; -import * as serializers from "../../../../../../serialization/index"; -import * as errors from "../../../../../../errors/index"; +import * as serializers from "../../../../../../../../serialization/index"; +import * as errors from "../../../../../../../../errors/index"; export declare namespace Logs { interface Options { @@ -32,8 +32,9 @@ export class Logs { /** * Returns the logs for a given server. * + * @param {string} gameId * @param {string} serverId - * @param {Rivet.servers.GetServerLogsRequest} request + * @param {Rivet.games.servers.GetServerLogsRequest} request * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Rivet.InternalError} @@ -44,22 +45,23 @@ export class Logs { * @throws {@link Rivet.BadRequestError} * * @example - * await client.servers.logs.getServerLogs("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { - * stream: Rivet.servers.LogStream.StdOut, + * await client.games.servers.logs.getServerLogs("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { + * stream: Rivet.games.servers.LogStream.StdOut, * gameId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", * watchIndex: "string" * }) */ public async getServerLogs( + gameId: string, serverId: string, - request: Rivet.servers.GetServerLogsRequest, + request: Rivet.games.servers.GetServerLogsRequest, requestOptions?: Logs.RequestOptions - ): Promise { - const { stream, gameId, watchIndex } = request; + ): Promise { + const { stream, gameId: gameId_, watchIndex } = request; const _queryParams: Record = {}; _queryParams["stream"] = stream; - if (gameId != null) { - _queryParams["game_id"] = gameId; + if (gameId_ != null) { + _queryParams["game_id"] = gameId_; } if (watchIndex != null) { @@ -69,7 +71,7 @@ export class Logs { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, - `/servers/${encodeURIComponent(serverId)}/logs` + `/games/${encodeURIComponent(gameId)}/servers/${encodeURIComponent(serverId)}/logs` ), method: "GET", headers: { @@ -83,7 +85,7 @@ export class Logs { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.servers.GetServerLogsResponse.parseOrThrow(_response.body, { + return serializers.games.servers.GetServerLogsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/logs/client/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts similarity index 70% rename from sdks/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts index 9374f68b6c..2c7435c979 100644 --- a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts +++ b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts @@ -2,18 +2,18 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as Rivet from "../../../../../../../../index"; /** * @example * { - * stream: Rivet.servers.LogStream.StdOut, + * stream: Rivet.games.servers.LogStream.StdOut, * gameId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", * watchIndex: "string" * } */ export interface GetServerLogsRequest { - stream: Rivet.servers.LogStream; + stream: Rivet.games.servers.LogStream; gameId?: string; /** * A query parameter denoting the requests watch index. diff --git a/sdks/full/typescript/src/api/resources/servers/resources/logs/client/requests/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/requests/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/logs/client/requests/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/client/requests/index.ts diff --git a/sdks/full/typescript/src/api/resources/servers/resources/logs/index.ts b/sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/index.ts similarity index 100% rename from sdks/full/typescript/src/api/resources/servers/resources/logs/index.ts rename to sdks/full/typescript/src/api/resources/games/resources/servers/resources/logs/index.ts diff --git a/sdks/full/typescript/src/api/resources/index.ts b/sdks/full/typescript/src/api/resources/index.ts index 3989427651..656fd32412 100644 --- a/sdks/full/typescript/src/api/resources/index.ts +++ b/sdks/full/typescript/src/api/resources/index.ts @@ -1,10 +1,10 @@ export * as admin from "./admin"; export * as cloud from "./cloud"; +export * as games from "./games"; export * as group from "./group"; export * as identity from "./identity"; export * as kv from "./kv"; export * as provision from "./provision"; -export * as servers from "./servers"; export * as auth from "./auth"; export * as captcha from "./captcha"; export * as common from "./common"; diff --git a/sdks/full/typescript/src/serialization/resources/games/index.ts b/sdks/full/typescript/src/serialization/resources/games/index.ts new file mode 100644 index 0000000000..3e5335fe42 --- /dev/null +++ b/sdks/full/typescript/src/serialization/resources/games/index.ts @@ -0,0 +1 @@ +export * from "./resources"; diff --git a/sdks/full/typescript/src/serialization/resources/games/resources/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/index.ts new file mode 100644 index 0000000000..ab7c2d0930 --- /dev/null +++ b/sdks/full/typescript/src/serialization/resources/games/resources/index.ts @@ -0,0 +1 @@ +export * as servers from "./servers"; diff --git a/sdks/full/typescript/src/serialization/resources/servers/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/servers/index.ts similarity index 100% rename from sdks/full/typescript/src/serialization/resources/servers/index.ts rename to sdks/full/typescript/src/serialization/resources/games/resources/servers/index.ts diff --git a/sdks/full/typescript/src/serialization/resources/servers/resources/builds/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/builds/index.ts similarity index 100% rename from sdks/full/typescript/src/serialization/resources/servers/resources/builds/index.ts rename to sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/builds/index.ts diff --git a/sdks/full/typescript/src/serialization/resources/servers/resources/common/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/common/index.ts similarity index 100% rename from sdks/full/typescript/src/serialization/resources/servers/resources/common/index.ts rename to sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/common/index.ts diff --git a/sdks/full/typescript/src/serialization/resources/servers/resources/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/index.ts similarity index 100% rename from sdks/full/typescript/src/serialization/resources/servers/resources/index.ts rename to sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/index.ts diff --git a/sdks/full/typescript/src/serialization/resources/servers/resources/logs/index.ts b/sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/logs/index.ts similarity index 100% rename from sdks/full/typescript/src/serialization/resources/servers/resources/logs/index.ts rename to sdks/full/typescript/src/serialization/resources/games/resources/servers/resources/logs/index.ts diff --git a/sdks/full/typescript/src/serialization/resources/index.ts b/sdks/full/typescript/src/serialization/resources/index.ts index f134c5d8f3..530397e873 100644 --- a/sdks/full/typescript/src/serialization/resources/index.ts +++ b/sdks/full/typescript/src/serialization/resources/index.ts @@ -1,10 +1,10 @@ export * as admin from "./admin"; export * as cloud from "./cloud"; +export * as games from "./games"; export * as group from "./group"; export * as identity from "./identity"; export * as kv from "./kv"; export * as provision from "./provision"; -export * as servers from "./servers"; export * as auth from "./auth"; export * as captcha from "./captcha"; export * as common from "./common"; diff --git a/sdks/full/typescript/types/Client.d.ts b/sdks/full/typescript/types/Client.d.ts index cc17ae102e..c3382ffcfa 100644 --- a/sdks/full/typescript/types/Client.d.ts +++ b/sdks/full/typescript/types/Client.d.ts @@ -5,11 +5,11 @@ import * as environments from "./environments"; import * as core from "./core"; import { Admin } from "./api/resources/admin/client/Client"; import { Cloud } from "./api/resources/cloud/client/Client"; +import { Games } from "./api/resources/games/client/Client"; import { Group } from "./api/resources/group/client/Client"; import { Identity } from "./api/resources/identity/client/Client"; import { Kv } from "./api/resources/kv/client/Client"; import { Provision } from "./api/resources/provision/client/Client"; -import { Servers } from "./api/resources/servers/client/Client"; import { Auth } from "./api/resources/auth/client/Client"; import { Job } from "./api/resources/job/client/Client"; import { Matchmaker } from "./api/resources/matchmaker/client/Client"; @@ -36,6 +36,8 @@ export declare class RivetClient { get admin(): Admin; protected _cloud: Cloud | undefined; get cloud(): Cloud; + protected _games: Games | undefined; + get games(): Games; protected _group: Group | undefined; get group(): Group; protected _identity: Identity | undefined; @@ -44,8 +46,6 @@ export declare class RivetClient { get kv(): Kv; protected _provision: Provision | undefined; get provision(): Provision; - protected _servers: Servers | undefined; - get servers(): Servers; protected _auth: Auth | undefined; get auth(): Auth; protected _job: Job | undefined; diff --git a/sdks/full/typescript/types/api/resources/index.d.ts b/sdks/full/typescript/types/api/resources/index.d.ts index 3989427651..656fd32412 100644 --- a/sdks/full/typescript/types/api/resources/index.d.ts +++ b/sdks/full/typescript/types/api/resources/index.d.ts @@ -1,10 +1,10 @@ export * as admin from "./admin"; export * as cloud from "./cloud"; +export * as games from "./games"; export * as group from "./group"; export * as identity from "./identity"; export * as kv from "./kv"; export * as provision from "./provision"; -export * as servers from "./servers"; export * as auth from "./auth"; export * as captcha from "./captcha"; export * as common from "./common"; diff --git a/sdks/full/typescript/types/serialization/resources/index.d.ts b/sdks/full/typescript/types/serialization/resources/index.d.ts index f134c5d8f3..530397e873 100644 --- a/sdks/full/typescript/types/serialization/resources/index.d.ts +++ b/sdks/full/typescript/types/serialization/resources/index.d.ts @@ -1,10 +1,10 @@ export * as admin from "./admin"; export * as cloud from "./cloud"; +export * as games from "./games"; export * as group from "./group"; export * as identity from "./identity"; export * as kv from "./kv"; export * as provision from "./provision"; -export * as servers from "./servers"; export * as auth from "./auth"; export * as captcha from "./captcha"; export * as common from "./common"; diff --git a/sdks/runtime/typescript/archive.tgz b/sdks/runtime/typescript/archive.tgz new file mode 100644 index 0000000000..c599cffbf6 --- /dev/null +++ b/sdks/runtime/typescript/archive.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c250c80610ec1d1ebcc201d6e3b6e55c4859f730b356d29126bf5d69c023a582 +size 282585 diff --git a/sdks/runtime/typescript/package.json b/sdks/runtime/typescript/package.json index 7687b6f0ff..d58d1f93a5 100644 --- a/sdks/runtime/typescript/package.json +++ b/sdks/runtime/typescript/package.json @@ -55,5 +55,6 @@ "prettier": "2.7.1", "typescript": "4.6.4", "@types/node-fetch": "2.6.11" - } + }, + "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" } diff --git a/shell.nix b/shell.nix index d5c68b5a5a..d7214d2094 100644 --- a/shell.nix +++ b/shell.nix @@ -46,7 +46,7 @@ in openssh # ssh-keygen # Runtimes - nodejs # Required for Fern + nodejs_20 # Required for Fern python310Packages.detect-secrets # Compilers diff --git a/svc/Cargo.lock b/svc/Cargo.lock index 484fff12a2..a52936264c 100644 --- a/svc/Cargo.lock +++ b/svc/Cargo.lock @@ -833,9 +833,11 @@ dependencies = [ "rivet-health-checks", "rivet-operation", "rivet-pools", + "rivet-util-team", "s3-util", "serde", "serde_json", + "team-get", "token-revoke", "tokio", "tracing", diff --git a/svc/Cargo.toml b/svc/Cargo.toml index bffcdade4b..5c18538a12 100644 --- a/svc/Cargo.toml +++ b/svc/Cargo.toml @@ -61,6 +61,7 @@ members = [ "pkg/cloud/ops/version-get", "pkg/cloud/ops/version-publish", "pkg/cloud/worker", + "pkg/cluster", "pkg/cluster/standalone/datacenter-tls-renew", "pkg/cluster/standalone/default-update", "pkg/cluster/standalone/gc", @@ -145,6 +146,7 @@ members = [ "pkg/kv/ops/get", "pkg/kv/ops/list", "pkg/kv/worker", + "pkg/linode", "pkg/linode/standalone/gc", "pkg/load-test/standalone/api-cloud", "pkg/load-test/standalone/mm", diff --git a/svc/api/monolith/Service.toml b/svc/api/monolith/Service.toml index 4f509cae8b..d3f573ef69 100644 --- a/svc/api/monolith/Service.toml +++ b/svc/api/monolith/Service.toml @@ -11,6 +11,7 @@ paths = [ "/auth", "/cf-verification", "/cloud", + "/games", "/group", "/identity", "/job", @@ -83,12 +84,6 @@ subdomain = "portal.api" strip-prefix = "/v1" add-path = "/portal" -[[api.router.mounts]] -deprecated = true -subdomain = "servers.api" -strip-prefix = "/v1" -add-path = "/servers" - [[api.router.mounts]] deprecated = true subdomain = "status.api" diff --git a/svc/api/monolith/src/route/mod.rs b/svc/api/monolith/src/route/mod.rs index 0ed0ba74dc..a88933b731 100644 --- a/svc/api/monolith/src/route/mod.rs +++ b/svc/api/monolith/src/route/mod.rs @@ -58,13 +58,12 @@ define_router! { path: api_portal::route::Router, prefix: "portal", }, - { - path: api_servers::route::Router, - prefix: "servers", - }, { path: api_status::route::Router, prefix: "status", }, + { + path: api_servers::route::Router, + }, ], } diff --git a/svc/api/servers/Cargo.toml b/svc/api/servers/Cargo.toml index 0b57ba8339..8cb3ca050e 100644 --- a/svc/api/servers/Cargo.toml +++ b/svc/api/servers/Cargo.toml @@ -28,6 +28,7 @@ tracing = "0.1" tracing-futures = "0.2" tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] } url = "2.2.2" +util-team = { package = "rivet-util-team", path = "../../pkg/team/util" } uuid = { version = "1", features = ["v4"] } build-create = { path = "../../pkg/build/ops/create" } @@ -42,6 +43,7 @@ ds-server-list-for-game = { path = "../../pkg/ds/ops/server-list-for-game" } game-get = { path = "../../pkg/game/ops/get" } game-namespace-get = { path = "../../pkg/game/ops/namespace-get" } game-version-get = { path = "../../pkg/game/ops/version-get" } +team-get = { path = "../../pkg/team/ops/get" } token-revoke = { path = "../../pkg/token/ops/revoke" } upload-complete = { path = "../../pkg/upload/ops/complete" } upload-get = { path = "../../pkg/upload/ops/get" } diff --git a/svc/api/servers/src/assert.rs b/svc/api/servers/src/assert.rs index 541cf6c89d..b0430b2e73 100644 --- a/svc/api/servers/src/assert.rs +++ b/svc/api/servers/src/assert.rs @@ -1,81 +1,23 @@ use api_helper::ctx::Ctx; -use proto::backend; +use rivet_api::models; +use rivet_convert::ApiTryFrom; use rivet_operation::prelude::*; use crate::auth::Auth; -/// Validates that a given user ID is registered. -pub async fn user_registered(ctx: &OperationContext<()>, user_id: Uuid) -> GlobalResult<()> { - // If the user has at least one identity they are considered registered - let identity = op!([ctx] user_identity_get { - user_ids: vec![user_id.into()] - }) - .await?; - - let identities = &unwrap_ref!(identity.users.first()).identities; - ensure_with!(!identities.is_empty(), IDENTITY_NOT_REGISTERED); - - Ok(()) -} - -/// Validates that a game's version exists and belongs to the given game ID. -/// -/// Throws `NotFound` if version does not exist and `BadRequest` if does not belong to the given -/// game. -pub async fn version_for_game( - ctx: &Ctx, - game_id: Uuid, - version_id: Uuid, -) -> GlobalResult { - let version_get_res = op!([ctx] game_version_get { - version_ids: vec![version_id.into()], - }) - .await?; - - let version_data = unwrap!(version_get_res.versions.first()); - let version_game_id = unwrap_ref!(version_data.game_id).as_uuid(); - - ensure_eq!(version_game_id, game_id, "version does not belong to game"); - - Ok(version_data.clone()) -} - -/// Validates that a game's namespace exists and belongs to the given game ID. -/// -/// Throws `NotFound` if namespace does not exist and `BadRequest` if does not belong to the given -/// game. -pub async fn namespace_for_game( - ctx: &Ctx, - game_id: Uuid, - namespace_id: Uuid, -) -> GlobalResult { - let ns_get_res = op!([ctx] game_namespace_get { - namespace_ids: vec![namespace_id.into()], - }) - .await?; - - let ns_data = unwrap!(ns_get_res.namespaces.first()); - let ns_game_id = unwrap_ref!(ns_data.game_id).as_uuid(); - - ensure_eq!(ns_game_id, game_id, "namespace does not belong to game"); - - Ok(ns_data.clone()) -} - /// Validates that a server belongs to the given game ID. -/// -/// Throws `NotFound` if server does not exist and `BadRequest` if does not belong to the given -/// game. pub async fn server_for_game(ctx: &Ctx, server_id: Uuid, game_id: Uuid) -> GlobalResult<()> { - let server_get_res = op!([ctx] ds_server_get { + let get_res = op!([ctx] ds_server_get { server_ids: vec![server_id.into()], }) .await?; - // let server_data = unwrap!(server_get_res.servers.first()); - // let server_game_id = unwrap_ref!(server_data.game_id).as_uuid(); + let server = models::GamesServersServer::api_try_from( + unwrap_with!(get_res.servers.first(), SERVERS_SERVER_NOT_FOUND).clone(), + )?; - // ensure_eq!(game_id, server_game_id, "server does not belong to game"); + // Validate token can access server + ensure_with!(server.game_id == game_id, SERVERS_SERVER_NOT_FOUND); Ok(()) } diff --git a/svc/api/servers/src/auth.rs b/svc/api/servers/src/auth.rs index df20b1f7d9..634f0a6a53 100644 --- a/svc/api/servers/src/auth.rs +++ b/svc/api/servers/src/auth.rs @@ -1,5 +1,3 @@ -use std::collections::HashSet; - use api_helper::{ auth::{ApiAuth, AuthRateLimitCtx}, util::{as_auth_expired, basic_rate_limit}, @@ -8,8 +6,6 @@ use proto::{backend, claims::Claims}; use rivet_claims::ClaimsDecode; use rivet_operation::prelude::*; -use crate::assert; - pub struct Auth { claims: Option, } @@ -47,340 +43,87 @@ impl Auth { self.claims()?.as_game_service() } - /// Validates that the agent can read the given games or is an admin. - pub async fn check_games_read_or_admin( - &self, - ctx: &OperationContext<()>, - game_ids: Vec, - ) -> GlobalResult<()> { - match self.check_games_read(ctx, game_ids).await { - Err(err) if err.is(formatted_error::code::API_FORBIDDEN) => self.or_admin(ctx).await, - other => other, - } - } - - /// Validates that the agent can read the given games or is an admin. - pub async fn check_game_service_or_cloud_token(&self) -> GlobalResult { - let claims = self.claims()?; - - match (claims.as_game_service(), claims.as_game_cloud()) { - (Ok(game_service), _) => Ok(game_service.game_id), - (_, Ok(game_cloud)) => Ok(game_cloud.game_id), - _ => bail_with!( - CLAIMS_MISSING_ENTITLEMENT, - entitlements = "GameService, GameCloud" - ), - } - } - - /// Validates that the agent can read the given game or is an admin. - pub async fn check_game_read_or_admin( + pub async fn check_game( &self, ctx: &OperationContext<()>, game_id: Uuid, + allow_service: bool, ) -> GlobalResult<()> { - match self.check_game_read(ctx, game_id).await { - Err(err) if err.is(formatted_error::code::API_FORBIDDEN) => self.or_admin(ctx).await, - other => other, - } - } - - /// Validates that the agent can write the given game or is an admin. - pub async fn check_game_write_or_admin( - &self, - ctx: &OperationContext<()>, - game_id: Uuid, - ) -> GlobalResult<()> { - match self.check_game_write(ctx, game_id).await { - Err(err) if err.is(formatted_error::code::API_FORBIDDEN) => self.or_admin(ctx).await, - other => other, - } - } - - /// Validates that the given agent is an admin user. - pub async fn admin(&self, ctx: &OperationContext<()>) -> GlobalResult<()> { let claims = self.claims()?; - if claims.as_user().is_ok() { - let (user, _) = self.user(ctx).await?; - - ensure_with!(user.is_admin, IDENTITY_NOT_ADMIN); - - Ok(()) - } else { - bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User"); - } - } - - // Helper function - async fn or_admin(&self, ctx: &OperationContext<()>) -> GlobalResult<()> { - match self.admin(ctx).await { - Err(err) - if err.is(formatted_error::code::API_FORBIDDEN) - || err.is(formatted_error::code::IDENTITY_NOT_ADMIN) => - { - bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User, GameCloud"); - } - other => other, - } - } - - pub async fn user( - &self, - ctx: &OperationContext<()>, - ) -> GlobalResult<(backend::user::User, rivet_claims::ent::User)> { - let claims = self.claims()?; - let user_ent = claims.as_user()?; - - let user_res = op!([ctx] user_get { - user_ids: vec![user_ent.user_id.into()], - }) - .await?; - let user = unwrap!(user_res.users.first()); - - // Verify user is not deleted - if user.delete_complete_ts.is_some() { - let jti = unwrap!(claims.jti); - op!([ctx] token_revoke { - jtis: vec![jti], - }) - .await?; - - bail_with!(TOKEN_REVOKED); - } - - Ok((user.clone(), user_ent)) - } - - /// Validates that the agent can read a list of teams. - pub async fn check_teams_read( - &self, - ctx: &OperationContext<()>, - team_ids: Vec, - ) -> GlobalResult<()> { - let claims = self.claims()?; - - if claims.as_user().is_ok() { - let (user, user_ent) = self.user(ctx).await?; - // assert::user_registered(ctx, user_ent.user_id).await?; - - let team_list_res = op!([ctx] user_team_list { - user_ids: vec![user_ent.user_id.into()], - }) - .await?; - - let user_teams = unwrap!(team_list_res.users.first()); - let user_team_ids = user_teams - .teams - .iter() - .map(|t| Ok(unwrap_ref!(t.team_id).as_uuid())) - .collect::>>()?; - let has_teams = team_ids - .iter() - .all(|team_id| user_team_ids.contains(team_id)); - - ensure_with!(has_teams || user.is_admin, GROUP_NOT_MEMBER); - + if let Ok(cloud_ent) = claims.as_game_cloud() { + ensure_with!( + cloud_ent.game_id == game_id, + API_FORBIDDEN, + reason = "Cloud token cannot write to this game", + ); Ok(()) - } else if claims.as_game_cloud().is_ok() { - bail_with!( + } else if let Ok(service_ent) = claims.as_game_service() { + ensure_with!( + allow_service, API_FORBIDDEN, - reason = "Game cloud token cannot write to this game", + reason = "Cannot use service token for this endpoint." ); - } else { - bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User, GameCloud"); - } - } - - // /// Validates that the agent can read a given team. - // pub async fn check_team_read( - // &self, - // ctx: &OperationContext<()>, - // team_id: Uuid, - // ) -> GlobalResult<()> { - // self.check_teams_read(ctx, vec![team_id]).await - // } - - // /// Validates that the agent can write to a given team. - // pub async fn check_team_write( - // &self, - // ctx: &OperationContext<()>, - // team_id: Uuid, - // ) -> GlobalResult<()> { - // tokio::try_join!( - // self.check_team_read(ctx, team_id), - // self.check_dev_team_active(ctx, team_id) - // )?; - - // Ok(()) - // } - - /// Validates that the agent can read a list of games. - pub async fn check_games_read( - &self, - ctx: &OperationContext<()>, - game_ids: Vec, - ) -> GlobalResult<()> { - let claims = self.claims()?; - - if claims.as_user().is_ok() { - let (_user, user_ent) = self.user(ctx).await?; - - assert::user_registered(ctx, user_ent.user_id).await?; - - // Find the game's development teams - let dev_team_ids = { - let games_res = op!([ctx] game_get { - game_ids: game_ids - .into_iter() - .map(Into::into) - .collect::>(), - }) - .await?; - ensure!(!games_res.games.is_empty(), "games not found"); - - games_res - .games - .iter() - .map(|g| Ok(unwrap_ref!(g.developer_team_id).as_uuid())) - .collect::>>()? - }; - - // Validate can read teams - self.check_teams_read(ctx, dev_team_ids).await - } else if let Ok(cloud_ent) = claims.as_game_cloud() { ensure_with!( - game_ids.iter().any(|id| id == &cloud_ent.game_id), + service_ent.game_id == game_id, API_FORBIDDEN, - reason = "Game cloud token cannot write to this game", + reason = "Service token cannot write to this game", ); - Ok(()) - } else { - bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User, GameCloud"); - } - } - - /// Validates that the agent can read a given game. - pub async fn check_game_read( - &self, - ctx: &OperationContext<()>, - game_id: Uuid, - ) -> GlobalResult<()> { - self.check_games_read(ctx, vec![game_id]).await - } - - /// Validates that the agent can write to a given game. - pub async fn check_game_write( - &self, - ctx: &OperationContext<()>, - game_id: Uuid, - ) -> GlobalResult<()> { - let claims = self.claims()?; + } else if let Ok(user_ent) = claims.as_user() { + // Get the user + let (user_res, game_res, team_list_res) = tokio::try_join!( + op!([ctx] user_get { + user_ids: vec![user_ent.user_id.into()], + }), + op!([ctx] game_get { + game_ids: vec![game_id.into()], + }), + op!([ctx] user_team_list { + user_ids: vec![user_ent.user_id.into()], + }), + )?; + let user = unwrap!(user_res.users.first()); + let game = unwrap_with!(game_res.games.first(), GAME_NOT_FOUND); + let user_teams = unwrap!(team_list_res.users.first()); + let dev_team_id = unwrap_ref!(game.developer_team_id).as_uuid(); - if claims.as_user().is_ok() { - let (_user, user_ent) = self.user(ctx).await?; + // Allow admin + if user.is_admin { + return Ok(()); + } - assert::user_registered(ctx, user_ent.user_id).await?; + // Verify user is not deleted + ensure_with!(user.delete_complete_ts.is_none(), TOKEN_REVOKED); - // Find the game's development team - let dev_team_id = { - let games_res = op!([ctx] game_get { - game_ids: vec![game_id.into()], - }) - .await?; - let game = unwrap!(games_res.games.first(), "game not found"); + // Validate user is member of team + let is_part_of_team = user_teams + .teams + .iter() + .filter_map(|x| x.team_id) + .any(|x| x.as_uuid() == dev_team_id); + ensure_with!(is_part_of_team, GROUP_NOT_MEMBER); - unwrap_ref!(game.developer_team_id).as_uuid() - }; + // Get team + let team_res = op!([ctx] team_get { + team_ids: vec![dev_team_id.into()], + }) + .await?; + let dev_team = unwrap!(team_res.teams.first()); - // Validate can write to the team - // self.check_team_write(ctx, dev_team_id).await - Ok(()) - } else if let Ok(cloud_ent) = claims.as_game_cloud() { - ensure_eq_with!( - cloud_ent.game_id, - game_id, - API_FORBIDDEN, - reason = "Game cloud token cannot write to this game", + // Check team active + ensure_with!( + dev_team.deactivate_reasons.is_empty(), + GROUP_DEACTIVATED, + reasons = util_team::format_deactivate_reasons(&dev_team.deactivate_reasons)?, ); Ok(()) } else { - bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User, GameCloud"); + bail_with!( + CLAIMS_MISSING_ENTITLEMENT, + entitlements = "User, GameCloud, GameService" + ); } } - - // /// Validates that the given dev team is active. - // pub async fn check_dev_team_active( - // &self, - // ctx: &OperationContext<()>, - // team_id: Uuid, - // ) -> GlobalResult<()> { - // let team_res = op!([ctx] team_get { - // team_ids: vec![team_id.into()], - // }) - // .await?; - // let team = unwrap!(team_res.teams.first()); - - // ensure_with!( - // team.deactivate_reasons.is_empty(), - // GROUP_DEACTIVATED, - // reasons = util_team::format_deactivate_reasons(&team.deactivate_reasons)?, - // ); - - // Ok(()) - // } - - // pub async fn accessible_games( - // &self, - // ctx: &OperationContext<()>, - // ) -> GlobalResult { - // let claims = self.claims()?; - - // let (user_id, team_ids, game_ids) = if claims.as_user().is_ok() { - // let (_, user_ent) = self.user(ctx).await?; - - // // Fetch teams associated with user - // let teams_res = op!([ctx] user_team_list { - // user_ids: vec![user_ent.user_id.into()], - // }) - // .await?; - // let user = unwrap!(teams_res.users.first()); - // let team_ids_proto = user - // .teams - // .iter() - // .filter_map(|t| t.team_id) - // .collect::>(); - // let team_ids = team_ids_proto - // .iter() - // .map(common::Uuid::as_uuid) - // .collect::>(); - - // // Fetch games associated with teams - // let games_res = op!([ctx] game_list_for_team { - // team_ids: team_ids_proto, - // }) - // .await?; - - // let game_ids = games_res - // .teams - // .iter() - // .flat_map(|team| &team.game_ids) - // .map(|id| id.as_uuid()) - // .collect::>(); - - // (Some(user_ent.user_id), team_ids, game_ids) - // } else if let Ok(cloud_ent) = claims.as_game_cloud() { - // (None, Vec::new(), vec![cloud_ent.game_id]) - // } else { - // bail_with!(CLAIMS_MISSING_ENTITLEMENT, entitlements = "User, GameCloud"); - // }; - - // Ok(AccessibleGameIdsResponse { - // user_id, - // team_ids, - // game_ids, - // }) - // } } diff --git a/svc/api/servers/src/route/builds.rs b/svc/api/servers/src/route/builds.rs index 2dbe902e92..4020dbfb99 100644 --- a/svc/api/servers/src/route/builds.rs +++ b/svc/api/servers/src/route/builds.rs @@ -11,23 +11,19 @@ use serde_json::json; use crate::auth::Auth; -// MARK: GET /builds +// MARK: GET /games/{}/builds #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GetQuery { tags: Option, - game_id: Option, } pub async fn get_builds( ctx: Ctx, + game_id: Uuid, _watch_index: WatchIndexQuery, query: GetQuery, -) -> GlobalResult { - let game_id = if let Some(game_id) = query.game_id { - game_id - } else { - ctx.auth().check_game_service_or_cloud_token().await? - }; +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, true).await?; let list_res = op!([ctx] build_list_for_game { game_id: Some(game_id.into()), @@ -83,34 +79,35 @@ pub async fn get_builds( builds.sort_by_key(|(create_ts, _)| *create_ts); builds.reverse(); - Ok(models::ServersListBuildsResponse { + Ok(models::GamesServersListBuildsResponse { builds: builds.into_iter().map(|(_, x)| x).collect::>(), }) } -// MARK: POST /games/{}/versions/builds +// MARK: POST /games/{}/builds/prepare pub async fn create_build( ctx: Ctx, - body: models::ServersCreateBuildRequest, -) -> GlobalResult { - let game_id = ctx.auth().check_game_service_or_cloud_token().await?; + game_id: Uuid, + body: models::GamesServersCreateBuildRequest, +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, false).await?; // TODO: Read and validate image file let multipart_upload = body.multipart_upload.unwrap_or(false); let kind = match body.kind { - None | Some(models::ServersBuildKind::DockerImage) => { + None | Some(models::GamesServersBuildKind::DockerImage) => { backend::build::BuildKind::DockerImage } - Some(models::ServersBuildKind::OciBundle) => backend::build::BuildKind::OciBundle, + Some(models::GamesServersBuildKind::OciBundle) => backend::build::BuildKind::OciBundle, }; let compression = match body.compression { - None | Some(models::ServersBuildCompression::None) => { + None | Some(models::GamesServersBuildCompression::None) => { backend::build::BuildCompression::None } - Some(models::ServersBuildCompression::Lz4) => backend::build::BuildCompression::Lz4, + Some(models::GamesServersBuildCompression::Lz4) => backend::build::BuildCompression::Lz4, }; // Verify that tags are valid @@ -153,7 +150,7 @@ pub async fn create_build( None }; - Ok(models::ServersCreateBuildResponse { + Ok(models::GamesServersCreateBuildResponse { build_id: unwrap_ref!(create_res.build_id).as_uuid(), upload_id: unwrap_ref!(create_res.upload_id).as_uuid(), image_presigned_request, @@ -161,20 +158,28 @@ pub async fn create_build( }) } -// MARK: POST /uploads/{}/complete +// MARK: POST /games/{}/builds/{}/complete pub async fn complete_build( ctx: Ctx, - upload_id: Uuid, + game_id: Uuid, + build_id: Uuid, _body: serde_json::Value, ) -> GlobalResult { - // TODO: use auth module instead - // let claims = ctx.auth().claims()?; - // if claims.as_user().is_err() { - // claims.as_game_cloud()?; - // } + ctx.auth().check_game(ctx.op_ctx(), game_id, false).await?; + + let build_res = op!([ctx] build_get { + build_ids: vec![build_id.into()], + }) + .await?; + let build = unwrap_with!(build_res.builds.first(), BUILDS_BUILD_NOT_FOUND); + + ensure_with!( + unwrap!(build.game_id).as_uuid() == game_id, + BUILDS_BUILD_NOT_FOUND + ); op!([ctx] @dont_log_body upload_complete { - upload_id: Some(upload_id.into()), + upload_id: build.upload_id, bucket: None, }) .await?; diff --git a/svc/api/servers/src/route/logs.rs b/svc/api/servers/src/route/logs.rs index 1a579dc1e1..7d19c3bb12 100644 --- a/svc/api/servers/src/route/logs.rs +++ b/svc/api/servers/src/route/logs.rs @@ -10,34 +10,23 @@ use std::time::Duration; use crate::{assert, auth::Auth}; -// MARK: GET /servers/{server_id}/logs +// MARK: GET /games/{}/servers/{}/logs #[derive(Debug, Deserialize)] pub struct GetServerLogsQuery { pub stream: models::CloudGamesLogStream, - pub game_id: Option, } pub async fn get_logs( ctx: Ctx, + game_id: Uuid, server_id: Uuid, watch_index: WatchIndexQuery, query: GetServerLogsQuery, -) -> GlobalResult { - let game_id = if let Some(game_id) = query.game_id { - game_id - } else { - ctx.auth().check_game_service_or_cloud_token().await? - }; - - // ctx.auth() - // .check_game_read_or_admin(ctx.op_ctx(), game_id) - // .await?; +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, false).await?; - // Get start ts - // If no watch: read logs - // If watch: - // loop read logs from index - // wait until start ts + 1 second + // Validate server belongs to game + assert::server_for_game(&ctx, server_id, game_id).await?; // Determine stream type let stream_type = match query.stream { @@ -48,26 +37,6 @@ pub async fn get_logs( // Timestamp to start the query at let before_nts = util::timestamp::now() * 1_000_000; - // Validate server belongs to game - let _game_ns = assert::server_for_game(&ctx, server_id, game_id).await?; - - // // Get run ID - // let server_id = if let Some(x) = get_server_id(&ctx, game_id, lobby_id).await? { - // x - // } else { - // // Throttle request if watching. This is effectively polling until the lobby is ready. - // if watch_index.to_consumer()?.is_some() { - // tokio::time::sleep(Duration::from_secs(1)).await; - // } - - // // Return empty logs - // return Ok(models::CloudGamesGetLobbyLogsResponse { - // lines: Vec::new(), - // timestamps: Vec::new(), - // watch: WatchResponse::new_as_model(before_nts), - // }); - // }; - // Handle anchor let logs_res = if let Some(anchor) = watch_index.as_i64()? { let query_start = tokio::time::Instant::now(); @@ -157,7 +126,7 @@ pub async fn get_logs( timestamps.reverse(); let watch_nts = logs_res.entries.first().map_or(before_nts, |x| x.nts); - Ok(models::ServersGetServerLogsResponse { + Ok(models::GamesServersGetServerLogsResponse { lines, timestamps, watch: WatchResponse::new_as_model(watch_nts), diff --git a/svc/api/servers/src/route/mod.rs b/svc/api/servers/src/route/mod.rs index e1b6039662..23f2b9c52f 100644 --- a/svc/api/servers/src/route/mod.rs +++ b/svc/api/servers/src/route/mod.rs @@ -23,36 +23,39 @@ pub async fn handle( define_router! { cors: CorsConfigBuilder::hub().build(), routes: { - "" : { + "games" / Uuid / "servers": { GET: servers::list_servers( query: servers::ListQuery, ), POST: servers::create( - body: models::ServersCreateServerRequest, + body: models::GamesServersCreateServerRequest, ), }, - Uuid : { + "games" / Uuid / "servers" / Uuid: { GET: servers::get(), DELETE: servers::destroy( query: servers::DeleteQuery, ), }, - Uuid / "logs" : { + "games" / Uuid / "servers" / Uuid / "logs" : { GET: logs::get_logs( query: logs::GetServerLogsQuery, ), }, - "builds": { + "games" / Uuid / "builds": { GET: builds::get_builds( query: builds::GetQuery, ), - POST: builds::create_build(body: models::ServersCreateBuildRequest), }, - "uploads" / Uuid / "complete": { + "games" / Uuid / "builds" / "prepare": { + POST: builds::create_build(body: models::GamesServersCreateBuildRequest), + }, + + "games" / Uuid / "builds" / Uuid / "complete": { POST: builds::complete_build(body: serde_json::Value), }, }, diff --git a/svc/api/servers/src/route/servers.rs b/svc/api/servers/src/route/servers.rs index f7e7f58e90..42bfa984e6 100644 --- a/svc/api/servers/src/route/servers.rs +++ b/svc/api/servers/src/route/servers.rs @@ -6,15 +6,16 @@ use rivet_operation::prelude::*; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use crate::auth::Auth; +use crate::{assert, auth::Auth}; -// MARK: GET /servers/{server_id} +// MARK: GET /games/{}/servers/{} pub async fn get( ctx: Ctx, + game_id: Uuid, server_id: Uuid, _watch_index: WatchIndexQuery, -) -> GlobalResult { - let game_id = ctx.auth().server()?.game_id; +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, true).await?; // Get the server let get_res = op!([ctx] ds_server_get { @@ -22,24 +23,26 @@ pub async fn get( }) .await?; - let server = models::ServersServer::api_try_from( + let server = models::GamesServersServer::api_try_from( unwrap_with!(get_res.servers.first(), SERVERS_SERVER_NOT_FOUND).clone(), )?; // Validate token can access server ensure_with!(server.game_id == game_id, SERVERS_SERVER_NOT_FOUND); - Ok(models::ServersGetServerResponse { + Ok(models::GamesServersGetServerResponse { server: Box::new(server), }) } -// MARK: POST /servers +// MARK: POST /games/{}/servers pub async fn create( ctx: Ctx, - body: models::ServersCreateServerRequest, -) -> GlobalResult { - let game_id = ctx.auth().server()?.game_id; + game_id: Uuid, + body: models::GamesServersCreateServerRequest, +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, true).await?; + let games = ctx .op(cluster::ops::get_for_game::Input { game_ids: vec![game_id], @@ -65,7 +68,7 @@ pub async fn create( let tags = serde_json::from_value(body.tags.unwrap_or_default())?; - tracing::info!("Creating server with tags: {:?}", tags); + tracing::info!(?tags, "creating server with tags"); let server = op!([ctx] ds_server_create { game_id: Some(game_id.into()), @@ -88,7 +91,7 @@ pub async fn create( internal_port: p.internal_port, routing: Some(if let Some(routing) = p.routing { match *routing { - models::ServersPortRouting { + models::GamesServersPortRouting { game_guard: Some(_), host: None, } => dynamic_servers::server_create::port::Routing::GameGuard( @@ -96,13 +99,13 @@ pub async fn create( protocol: backend::ds::GameGuardProtocol::api_from(p.protocol) as i32, }, ), - models::ServersPortRouting { + models::GamesServersPortRouting { game_guard: None, host: Some(_), } => dynamic_servers::server_create::port::Routing::Host(backend::ds::HostRouting { protocol: backend::ds::HostProtocol::api_try_from(p.protocol)? as i32, }), - models::ServersPortRouting { .. } => { + models::GamesServersPortRouting { .. } => { bail_with!(SERVERS_MUST_SPECIFY_ROUTING_TYPE) } } @@ -117,12 +120,12 @@ pub async fn create( .await? .server; - Ok(models::ServersCreateServerResponse { + Ok(models::GamesServersCreateServerResponse { server: Box::new(unwrap!(server).api_try_into()?), }) } -// MARK: DELETE /servers/{server_id} +// MARK: DELETE /games/{}/servers/{} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DeleteQuery { override_kill_timeout: Option, @@ -130,38 +133,36 @@ pub struct DeleteQuery { pub async fn destroy( ctx: Ctx, + game_id: Uuid, server_id: Uuid, query: DeleteQuery, -) -> GlobalResult { - let server_id = op!([ctx] ds_server_delete { +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, true).await?; + + assert::server_for_game(&ctx, server_id, game_id).await?; + + op!([ctx] ds_server_delete { server_id: Some(server_id.into()), override_kill_timeout_ms: query.override_kill_timeout.unwrap_or_default(), }) - .await? - .server_id; + .await?; - Ok(models::ServersDestroyServerResponse { - server_id: unwrap!(server_id).as_uuid(), - }) + Ok(serde_json::json!({})) } -// MARK: GET /servers/list +// MARK: GET /games/{}/servers #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ListQuery { tags: Option, - game_id: Option, } pub async fn list_servers( ctx: Ctx, + game_id: Uuid, _watch_index: WatchIndexQuery, query: ListQuery, -) -> GlobalResult { - let game_id = if let Some(game_id) = query.game_id { - game_id - } else { - ctx.auth().check_game_service_or_cloud_token().await? - }; +) -> GlobalResult { + ctx.auth().check_game(ctx.op_ctx(), game_id, true).await?; let list_res = op!([ctx] ds_server_list_for_game { game_id: Some(game_id.into()), @@ -178,10 +179,10 @@ pub async fn list_servers( .servers .into_iter() .map(|server| { - let server = models::ServersServer::api_try_from(server)?; + let server = models::GamesServersServer::api_try_from(server)?; Ok(server) }) .collect::>>()?; - Ok(models::ServersListServersResponse { servers }) + Ok(models::GamesServersListServersResponse { servers }) } diff --git a/svc/api/servers/tests/basic.rs b/svc/api/servers/tests/basic.rs index 5b7539a9fe..74f6558c2c 100644 --- a/svc/api/servers/tests/basic.rs +++ b/svc/api/servers/tests/basic.rs @@ -8,6 +8,8 @@ static GLOBAL_INIT: Once = Once::new(); struct Ctx { pub op_ctx: OperationContext<()>, pub ns_auth_token: String, + pub game_id: Uuid, + pub game_id_str: String, pub datacenter_id: Uuid, pub image_id: Uuid, } @@ -50,6 +52,8 @@ impl Ctx { Ok(Ctx { op_ctx, ns_auth_token, + game_id, + game_id_str: game_id.to_string(), datacenter_id, image_id, }) @@ -144,9 +148,10 @@ async fn create_http() -> GlobalResult<()> { let ctx_config = ctx.config(ctx.ns_auth_token.clone())?; - let res = servers_api::servers_create( + let res = games_servers_api::games_servers_create( &ctx_config, - models::ServersCreateServerRequest { + &ctx.game_id_str, + models::GamesServersCreateServerRequest { arguments: None, datacenter: ctx.datacenter_id.to_string(), environment: Some(HashMap::new()), @@ -154,13 +159,13 @@ async fn create_http() -> GlobalResult<()> { kill_timeout: Some(0), webhook_url: None, tags: None, - network: Box::new(models::ServersCreateServerNetworkRequest { - mode: Some(models::ServersNetworkMode::Bridge), + network: Box::new(models::GamesServersCreateServerNetworkRequest { + mode: Some(models::GamesServersNetworkMode::Bridge), ports: vec![( "testing2".to_string(), - models::ServersCreateServerPortRequest { - protocol: models::ServersPortProtocol::Http, - routing: Some(Box::new(models::ServersPortRouting { + models::GamesServersCreateServerPortRequest { + protocol: models::GamesServersPortProtocol::Http, + routing: Some(Box::new(models::GamesServersPortRouting { game_guard: Some(serde_json::Value::Object(serde_json::Map::new())), host: None, })), @@ -171,7 +176,7 @@ async fn create_http() -> GlobalResult<()> { .into_iter() .collect(), }), - resources: Box::new(models::ServersResources { + resources: Box::new(models::GamesServersResources { cpu: 100, memory: 200, }), @@ -187,9 +192,10 @@ async fn list_builds_with_tags() -> GlobalResult<()> { let ctx_config = ctx.config(ctx.ns_auth_token.clone())?; - let res = servers_api::servers_create( + let res = games_servers_api::games_servers_create( &ctx_config, - models::ServersCreateServerRequest { + &ctx.game_id_str, + models::GamesServersCreateServerRequest { arguments: None, datacenter: ctx.datacenter_id.to_string(), environment: Some(HashMap::new()), @@ -197,13 +203,13 @@ async fn list_builds_with_tags() -> GlobalResult<()> { kill_timeout: Some(0), webhook_url: None, tags: None, - network: Box::new(models::ServersCreateServerNetworkRequest { - mode: Some(models::ServersNetworkMode::Bridge), + network: Box::new(models::GamesServersCreateServerNetworkRequest { + mode: Some(models::GamesServersNetworkMode::Bridge), ports: vec![( "testing2".to_string(), - models::ServersCreateServerPortRequest { - protocol: models::ServersPortProtocol::Http, - routing: Some(Box::new(models::ServersPortRouting { + models::GamesServersCreateServerPortRequest { + protocol: models::GamesServersPortProtocol::Http, + routing: Some(Box::new(models::GamesServersPortRouting { game_guard: Some(serde_json::Value::Object(serde_json::Map::new())), host: None, })), @@ -214,7 +220,7 @@ async fn list_builds_with_tags() -> GlobalResult<()> { .into_iter() .collect(), }), - resources: Box::new(models::ServersResources { + resources: Box::new(models::GamesServersResources { cpu: 100, memory: 200, }), diff --git a/svc/pkg/ds/worker/src/workers/mod.rs b/svc/pkg/ds/worker/src/workers/mod.rs index 0e6d4981bf..eee768e610 100644 --- a/svc/pkg/ds/worker/src/workers/mod.rs +++ b/svc/pkg/ds/worker/src/workers/mod.rs @@ -85,7 +85,7 @@ pub async fn webhook_call( // Example of a JSON payload let payload = serde_json::json!({ - "message": match rivet_api::models::ServersServer::api_try_from(server.clone()) { + "message": match rivet_api::models::GamesServersServer::api_try_from(server.clone()) { Ok(server) => server, Err(err) => { tracing::error!(?err, "Could not convert server to API");