From e42b214e168ba2b845ca0dfe73c9a9dc6ba43348 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sun, 24 Nov 2024 16:04:52 -0800 Subject: [PATCH] chore: rename api sdk Rivet -> RivetClient --- .../src/route/game_guard/dynamic_servers.rs | 7 +- .../common/chirp-workflow/core/src/prelude.rs | 2 +- .../common/chirp-workflow/core/src/stub.rs | 12 +- sdks/api/fern/generators.yml | 4 +- sdks/api/full/typescript/src/Client.ts | 8 +- .../src/api/resources/actor/client/Client.ts | 204 +++--- .../requests/CreateActorRequestQuery.ts | 4 +- .../requests/UpgradeActorRequestQuery.ts | 4 +- .../actor/resources/builds/client/Client.ts | 202 +++--- .../requests/PatchBuildTagsRequestQuery.ts | 4 +- .../requests/PrepareBuildRequestQuery.ts | 4 +- .../actor/resources/logs/client/Client.ts | 44 +- .../requests/GetActorLogsRequestQuery.ts | 4 +- .../actor/resources/regions/client/Client.ts | 44 +- .../src/api/resources/auth/client/Client.ts | 2 +- .../auth/resources/identity/client/Client.ts | 2 +- .../identity/resources/email/client/Client.ts | 84 +-- .../auth/resources/tokens/client/Client.ts | 44 +- .../src/api/resources/cloud/client/Client.ts | 40 +- .../cloud/resources/auth/client/Client.ts | 40 +- .../cloud/resources/devices/client/Client.ts | 2 +- .../devices/resources/links/client/Client.ts | 118 ++-- .../client/requests/GetDeviceLinkRequest.ts | 6 +- .../cloud/resources/games/client/Client.ts | 312 ++++----- .../games/resources/avatars/client/Client.ts | 114 ++-- .../games/resources/builds/client/Client.ts | 80 +-- .../games/resources/cdn/client/Client.ts | 80 +-- .../resources/matchmaker/client/Client.ts | 160 ++--- .../client/requests/GetLobbyLogsRequest.ts | 4 +- .../resources/namespaces/client/Client.ts | 612 +++++++++--------- .../resources/analytics/client/Client.ts | 40 +- .../resources/logs/client/Client.ts | 80 +-- .../requests/ListNamespaceLobbiesRequest.ts | 4 +- .../games/resources/tokens/client/Client.ts | 40 +- .../games/resources/versions/client/Client.ts | 156 ++--- .../cloud/resources/groups/client/Client.ts | 44 +- .../cloud/resources/logs/client/Client.ts | 40 +- .../cloud/resources/tiers/client/Client.ts | 42 +- .../cloud/resources/uploads/client/Client.ts | 38 +- .../common/errors/BadRequestError.ts | 6 +- .../resources/common/errors/ForbiddenError.ts | 6 +- .../resources/common/errors/InternalError.ts | 6 +- .../resources/common/errors/NotFoundError.ts | 6 +- .../resources/common/errors/RateLimitError.ts | 6 +- .../common/errors/UnauthorizedError.ts | 6 +- .../src/api/resources/games/client/Client.ts | 2 +- .../resources/environments/client/Client.ts | 2 +- .../resources/tokens/client/Client.ts | 40 +- .../src/api/resources/group/client/Client.ts | 606 ++++++++--------- .../group/resources/invites/client/Client.ts | 116 ++-- .../resources/joinRequests/client/Client.ts | 76 +-- .../api/resources/identity/client/Client.ts | 570 ++++++++-------- .../client/requests/GetProfileRequest.ts | 4 +- .../client/requests/GetSelfProfileRequest.ts | 4 +- .../client/requests/SetGameActivityRequest.ts | 4 +- .../identity/client/requests/SetupRequest.ts | 4 +- .../client/requests/UpdateProfileRequest.ts | 8 +- .../client/requests/UpdateStatusRequest.ts | 4 +- .../client/requests/ValidateProfileRequest.ts | 8 +- .../resources/activities/client/Client.ts | 44 +- .../client/requests/ListActivitiesRequest.ts | 4 +- .../resources/events/client/Client.ts | 44 +- .../client/requests/WatchEventsRequest.ts | 4 +- .../src/api/resources/job/client/Client.ts | 2 +- .../job/resources/run/client/Client.ts | 38 +- .../api/resources/matchmaker/client/Client.ts | 2 +- .../resources/lobbies/client/Client.ts | 304 ++++----- .../client/requests/CreateLobbyRequest.ts | 6 +- .../client/requests/FindLobbyRequest.ts | 4 +- .../client/requests/JoinLobbyRequest.ts | 4 +- .../resources/players/client/Client.ts | 116 ++-- .../resources/regions/client/Client.ts | 40 +- .../src/api/resources/portal/client/Client.ts | 2 +- .../portal/resources/games/client/Client.ts | 44 +- .../api/resources/provision/client/Client.ts | 2 +- .../resources/datacenters/client/Client.ts | 76 +-- .../resources/servers/client/Client.ts | 40 +- .../api/resources/servers/client/Client.ts | 160 ++--- .../servers/resources/builds/client/Client.ts | 198 +++--- .../resources/datacenters/client/Client.ts | 40 +- .../servers/resources/logs/client/Client.ts | 44 +- .../client/requests/GetServerLogsRequest.ts | 4 +- sdks/api/full/typescript/src/environments.ts | 4 +- .../{RivetError.ts => RivetClientError.ts} | 4 +- ...outError.ts => RivetClientTimeoutError.ts} | 4 +- sdks/api/full/typescript/src/errors/index.ts | 4 +- sdks/api/full/typescript/src/index.ts | 8 +- .../requests/PrepareAvatarUploadRequest.ts | 4 +- .../client/requests/SetGameActivityRequest.ts | 4 +- .../identity/client/requests/SetupRequest.ts | 4 +- .../client/requests/SignupForBetaRequest.ts | 4 +- .../client/requests/UpdateProfileRequest.ts | 4 +- .../client/requests/UpdateStatusRequest.ts | 4 +- .../client/requests/ValidateProfileRequest.ts | 4 +- .../client/requests/CreateLobbyRequest.ts | 4 +- .../client/requests/FindLobbyRequest.ts | 4 +- .../client/requests/JoinLobbyRequest.ts | 4 +- .../client/requests/SetLobbyClosedRequest.ts | 4 +- .../client/requests/PlayerConnectedRequest.ts | 4 +- .../requests/PlayerDisconnectedRequest.ts | 4 +- sdks/api/runtime/typescript/src/Client.ts | 8 +- .../src/api/resources/actor/client/Client.ts | 204 +++--- .../requests/CreateActorRequestQuery.ts | 4 +- .../requests/UpgradeActorRequestQuery.ts | 4 +- .../actor/resources/builds/client/Client.ts | 202 +++--- .../requests/PatchBuildTagsRequestQuery.ts | 4 +- .../requests/PrepareBuildRequestQuery.ts | 4 +- .../actor/resources/logs/client/Client.ts | 44 +- .../requests/GetActorLogsRequestQuery.ts | 4 +- .../actor/resources/regions/client/Client.ts | 44 +- .../common/errors/BadRequestError.ts | 6 +- .../resources/common/errors/ForbiddenError.ts | 6 +- .../resources/common/errors/InternalError.ts | 6 +- .../resources/common/errors/NotFoundError.ts | 6 +- .../resources/common/errors/RateLimitError.ts | 6 +- .../common/errors/UnauthorizedError.ts | 6 +- .../runtime/typescript/src/environments.ts | 4 +- .../{RivetError.ts => RivetClientError.ts} | 4 +- ...outError.ts => RivetClientTimeoutError.ts} | 4 +- .../runtime/typescript/src/errors/index.ts | 4 +- sdks/api/runtime/typescript/src/index.ts | 8 +- 121 files changed, 3054 insertions(+), 3041 deletions(-) rename sdks/api/full/typescript/src/errors/{RivetError.ts => RivetClientError.ts} (89%) rename sdks/api/full/typescript/src/errors/{RivetTimeoutError.ts => RivetClientTimeoutError.ts} (50%) rename sdks/api/runtime/typescript/src/errors/{RivetError.ts => RivetClientError.ts} (89%) rename sdks/api/runtime/typescript/src/errors/{RivetTimeoutError.ts => RivetClientTimeoutError.ts} (50%) diff --git a/packages/api/traefik-provider/src/route/game_guard/dynamic_servers.rs b/packages/api/traefik-provider/src/route/game_guard/dynamic_servers.rs index 5734acaa38..9ba6038d5a 100644 --- a/packages/api/traefik-provider/src/route/game_guard/dynamic_servers.rs +++ b/packages/api/traefik-provider/src/route/game_guard/dynamic_servers.rs @@ -311,7 +311,12 @@ fn format_http_rule( let mut rule = "(".to_string(); - let hostname = ds::util::build_ds_hostname(config, proxied_port.server_id, &proxied_port.port_name, proxied_port.datacenter_id)?; + let hostname = ds::util::build_ds_hostname( + config, + proxied_port.server_id, + &proxied_port.port_name, + proxied_port.datacenter_id, + )?; write!(&mut rule, "Host(`{}`)", hostname)?; match authorization { diff --git a/packages/common/chirp-workflow/core/src/prelude.rs b/packages/common/chirp-workflow/core/src/prelude.rs index b6acf54530..5c79b0a589 100644 --- a/packages/common/chirp-workflow/core/src/prelude.rs +++ b/packages/common/chirp-workflow/core/src/prelude.rs @@ -26,7 +26,7 @@ pub use crate::{ operation::Operation as OperationTrait, registry::Registry, signal::{join_signal, Signal as SignalTrait}, - stub::{activity, closure, v, removed}, + stub::{activity, closure, removed, v}, utils::GlobalErrorExt, worker::Worker, workflow::Workflow as WorkflowTrait, diff --git a/packages/common/chirp-workflow/core/src/stub.rs b/packages/common/chirp-workflow/core/src/stub.rs index 9245a00d84..f976fd693c 100644 --- a/packages/common/chirp-workflow/core/src/stub.rs +++ b/packages/common/chirp-workflow/core/src/stub.rs @@ -11,8 +11,8 @@ use global_error::GlobalResult; use crate::{ activity::{Activity, ActivityInput}, ctx::WorkflowCtx, - history::removed::Removed, executable::{AsyncResult, Executable}, + history::removed::Removed, }; // Must wrap all closures being used as executables in this function due to @@ -56,7 +56,10 @@ where I: ActivityInput, ::Activity: Activity, { - ActivityStub { inner: input, version: None } + ActivityStub { + inner: input, + version: None, + } } pub struct VersionStub { @@ -69,7 +72,10 @@ impl VersionStub { I: ActivityInput, ::Activity: Activity, { - ActivityStub { inner: input, version: Some(self.version) } + ActivityStub { + inner: input, + version: Some(self.version), + } } } diff --git a/sdks/api/fern/generators.yml b/sdks/api/fern/generators.yml index f654ba7343..d80011c34d 100644 --- a/sdks/api/fern/generators.yml +++ b/sdks/api/fern/generators.yml @@ -17,7 +17,7 @@ groups: path: ../runtime/typescript/src config: outputSourceFiles: true - namespaceExport: Rivet + namespaceExport: RivetClient defaultTimeoutInSeconds: 180 skipResponseValidation: true allowCustomFetcher: true @@ -41,7 +41,7 @@ groups: path: ../full/typescript/src config: outputSourceFiles: true - namespaceExport: Rivet + namespaceExport: RivetClient defaultTimeoutInSeconds: 180 skipResponseValidation: true allowCustomFetcher: true diff --git a/sdks/api/full/typescript/src/Client.ts b/sdks/api/full/typescript/src/Client.ts index 36b3848acf..c4d93ec989 100644 --- a/sdks/api/full/typescript/src/Client.ts +++ b/sdks/api/full/typescript/src/Client.ts @@ -16,9 +16,9 @@ import { Job } from "./api/resources/job/client/Client"; import { Matchmaker } from "./api/resources/matchmaker/client/Client"; import { Portal } from "./api/resources/portal/client/Client"; -export declare namespace RivetClient { +export declare namespace RivetClientClient { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,8 +33,8 @@ export declare namespace RivetClient { } } -export class RivetClient { - constructor(protected readonly _options: RivetClient.Options = {}) {} +export class RivetClientClient { + constructor(protected readonly _options: RivetClientClient.Options = {}) {} protected _actor: Actor | undefined; diff --git a/sdks/api/full/typescript/src/api/resources/actor/client/Client.ts b/sdks/api/full/typescript/src/api/resources/actor/client/Client.ts index af45819296..044874c07f 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; @@ -14,7 +14,7 @@ import { Regions } from "../resources/regions/client/Client"; export declare namespace Actor { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -36,15 +36,15 @@ export class Actor { * Gets a dynamic actor. * * @param {string} actor - The id of the actor to destroy - * @param {Rivet.actor.ListActorsRequestQuery} request + * @param {RivetClient.actor.ListActorsRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -54,9 +54,9 @@ export class Actor { */ public async get( actor: string, - request: Rivet.actor.ListActorsRequestQuery = {}, + request: RivetClient.actor.ListActorsRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -69,7 +69,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}` ), method: "GET", @@ -99,7 +99,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -159,7 +159,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -168,14 +168,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -184,15 +184,15 @@ export class Actor { /** * Lists all actors associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.actor.GetActorsRequestQuery} request + * @param {RivetClient.actor.GetActorsRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.list({ @@ -204,9 +204,9 @@ export class Actor { * }) */ public async list( - request: Rivet.actor.GetActorsRequestQuery = {}, + request: RivetClient.actor.GetActorsRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, tagsJson, includeDestroyed, cursor } = request; const _queryParams: Record = {}; if (project != null) { @@ -231,7 +231,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/actors" ), method: "GET", @@ -261,7 +261,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -271,7 +271,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -281,7 +281,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -291,7 +291,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -301,7 +301,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -311,7 +311,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -321,7 +321,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -330,14 +330,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -346,15 +346,15 @@ export class Actor { /** * Create a new dynamic actor. * - * @param {Rivet.actor.CreateActorRequestQuery} request + * @param {RivetClient.actor.CreateActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.create({ @@ -390,9 +390,9 @@ export class Actor { * }) */ public async create( - request: Rivet.actor.CreateActorRequestQuery, + request: RivetClient.actor.CreateActorRequestQuery, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -405,7 +405,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/actors" ), method: "POST", @@ -436,7 +436,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -446,7 +446,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -456,7 +456,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -466,7 +466,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -476,7 +476,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -486,7 +486,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -496,7 +496,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -505,14 +505,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -522,15 +522,15 @@ export class Actor { * Destroy a dynamic actor. * * @param {string} actor - The id of the actor to destroy - * @param {Rivet.actor.DestroyActorRequestQuery} request + * @param {RivetClient.actor.DestroyActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.destroy("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -541,9 +541,9 @@ export class Actor { */ public async destroy( actor: string, - request: Rivet.actor.DestroyActorRequestQuery = {}, + request: RivetClient.actor.DestroyActorRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, overrideKillTimeout } = request; const _queryParams: Record = {}; if (project != null) { @@ -560,7 +560,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}` ), method: "DELETE", @@ -590,7 +590,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -600,7 +600,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -610,7 +610,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -620,7 +620,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -630,7 +630,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -640,7 +640,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -650,7 +650,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -659,14 +659,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -676,15 +676,15 @@ export class Actor { * Upgrades a dynamic actor. * * @param {string} actor - The id of the actor to upgrade - * @param {Rivet.actor.UpgradeActorRequestQuery} request + * @param {RivetClient.actor.UpgradeActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.upgrade("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -700,9 +700,9 @@ export class Actor { */ public async upgrade( actor: string, - request: Rivet.actor.UpgradeActorRequestQuery, + request: RivetClient.actor.UpgradeActorRequestQuery, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -715,7 +715,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}/upgrade` ), method: "POST", @@ -746,7 +746,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -756,7 +756,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -766,7 +766,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -776,7 +776,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -786,7 +786,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -796,7 +796,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -806,7 +806,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -815,14 +815,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts b/sdks/api/full/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts index 326c8767da..22d3c322e7 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -41,5 +41,5 @@ import * as Rivet from "../../../../index"; export interface CreateActorRequestQuery { project?: string; environment?: string; - body: Rivet.actor.CreateActorRequest; + body: RivetClient.actor.CreateActorRequest; } diff --git a/sdks/api/full/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts b/sdks/api/full/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts index bc6bf3a228..ef11615a77 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -20,5 +20,5 @@ import * as Rivet from "../../../../index"; export interface UpgradeActorRequestQuery { project?: string; environment?: string; - body: Rivet.actor.UpgradeActorRequest; + body: RivetClient.actor.UpgradeActorRequest; } diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/Client.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/Client.ts index c9d73ee901..bd948cd964 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Builds { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Builds { * Get a build. * * @param {string} build - * @param {Rivet.actor.GetBuildRequestQuery} request + * @param {RivetClient.actor.GetBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -51,9 +51,9 @@ export class Builds { */ public async get( build: string, - request: Rivet.actor.GetBuildRequestQuery = {}, + request: RivetClient.actor.GetBuildRequestQuery = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -66,7 +66,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}` ), method: "GET", @@ -96,7 +96,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +106,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +116,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +126,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +136,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -146,7 +146,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -156,7 +156,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -165,14 +165,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -181,15 +181,15 @@ export class Builds { /** * Lists all builds of the project associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.actor.ListBuildsRequestQuery} request + * @param {RivetClient.actor.ListBuildsRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.list({ @@ -199,9 +199,9 @@ export class Builds { * }) */ public async list( - request: Rivet.actor.ListBuildsRequestQuery = {}, + request: RivetClient.actor.ListBuildsRequestQuery = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, tagsJson } = request; const _queryParams: Record = {}; if (project != null) { @@ -218,7 +218,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/builds" ), method: "GET", @@ -248,7 +248,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -258,7 +258,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -268,7 +268,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -278,7 +278,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -288,7 +288,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -298,7 +298,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -308,7 +308,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -317,14 +317,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -332,15 +332,15 @@ export class Builds { /** * @param {string} build - * @param {Rivet.actor.PatchBuildTagsRequestQuery} request + * @param {RivetClient.actor.PatchBuildTagsRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.patchTags("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -356,9 +356,9 @@ export class Builds { */ public async patchTags( build: string, - request: Rivet.actor.PatchBuildTagsRequestQuery, + request: RivetClient.actor.PatchBuildTagsRequestQuery, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -371,7 +371,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}/tags` ), method: "PATCH", @@ -402,7 +402,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -412,7 +412,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -422,7 +422,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -432,7 +432,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -442,7 +442,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -452,7 +452,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -462,7 +462,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -471,14 +471,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -487,15 +487,15 @@ export class Builds { /** * Creates a new project build for the given project. * - * @param {Rivet.actor.PrepareBuildRequestQuery} request + * @param {RivetClient.actor.PrepareBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.prepare({ @@ -515,9 +515,9 @@ export class Builds { * }) */ public async prepare( - request: Rivet.actor.PrepareBuildRequestQuery, + request: RivetClient.actor.PrepareBuildRequestQuery, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -530,7 +530,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/builds/prepare" ), method: "POST", @@ -561,7 +561,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -571,7 +571,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -581,7 +581,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -591,7 +591,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -601,7 +601,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -611,7 +611,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -621,7 +621,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -630,14 +630,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -647,15 +647,15 @@ export class Builds { * Marks an upload as complete. * * @param {string} build - * @param {Rivet.actor.CompleteBuildRequestQuery} request + * @param {RivetClient.actor.CompleteBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.complete("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -665,7 +665,7 @@ export class Builds { */ public async complete( build: string, - request: Rivet.actor.CompleteBuildRequestQuery = {}, + request: RivetClient.actor.CompleteBuildRequestQuery = {}, requestOptions?: Builds.RequestOptions ): Promise { const { project, environment } = request; @@ -680,7 +680,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}/complete` ), method: "POST", @@ -704,7 +704,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -714,7 +714,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -724,7 +724,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -734,7 +734,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -744,7 +744,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -754,7 +754,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -764,7 +764,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -773,14 +773,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts index ddcc97fd15..009f906b5f 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -20,5 +20,5 @@ import * as Rivet from "../../../../../../index"; export interface PatchBuildTagsRequestQuery { project?: string; environment?: string; - body: Rivet.actor.PatchBuildTagsRequest; + body: RivetClient.actor.PatchBuildTagsRequest; } diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts index 8271a80a5b..97311edbdd 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -25,5 +25,5 @@ import * as Rivet from "../../../../../../index"; export interface PrepareBuildRequestQuery { project?: string; environment?: string; - body: Rivet.actor.PrepareBuildRequest; + body: RivetClient.actor.PrepareBuildRequest; } diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/Client.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/Client.ts index 3a3dddc1df..25acf80df4 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Logs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Logs { * Returns the logs for a given actor. * * @param {string} actor - * @param {Rivet.actor.GetActorLogsRequestQuery} request + * @param {RivetClient.actor.GetActorLogsRequestQuery} request * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.logs.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -53,9 +53,9 @@ export class Logs { */ public async get( actor: string, - request: Rivet.actor.GetActorLogsRequestQuery, + request: RivetClient.actor.GetActorLogsRequestQuery, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const { project, environment, stream, watchIndex } = request; const _queryParams: Record = {}; if (project != null) { @@ -73,7 +73,7 @@ export class Logs { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}/logs` ), method: "GET", @@ -103,7 +103,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -113,7 +113,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -153,7 +153,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -163,7 +163,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -172,14 +172,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts index eb1587c3e1..829efa8b1f 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -16,7 +16,7 @@ import * as Rivet from "../../../../../../index"; export interface GetActorLogsRequestQuery { project?: string; environment?: string; - stream: Rivet.actor.LogStream; + stream: RivetClient.actor.LogStream; /** * A query parameter denoting the requests watch index. */ diff --git a/sdks/api/full/typescript/src/api/resources/actor/resources/regions/client/Client.ts b/sdks/api/full/typescript/src/api/resources/actor/resources/regions/client/Client.ts index 66e8ee02fe..37e5e0322c 100644 --- a/sdks/api/full/typescript/src/api/resources/actor/resources/regions/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/actor/resources/regions/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Regions { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -30,15 +30,15 @@ export class Regions { constructor(protected readonly _options: Regions.Options = {}) {} /** - * @param {Rivet.actor.ListRegionsRequestQuery} request + * @param {RivetClient.actor.ListRegionsRequestQuery} request * @param {Regions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.regions.list({ @@ -47,9 +47,9 @@ export class Regions { * }) */ public async list( - request: Rivet.actor.ListRegionsRequestQuery = {}, + request: RivetClient.actor.ListRegionsRequestQuery = {}, requestOptions?: Regions.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -62,7 +62,7 @@ export class Regions { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/regions" ), method: "GET", @@ -92,7 +92,7 @@ export class Regions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -102,7 +102,7 @@ export class Regions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -112,7 +112,7 @@ export class Regions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -122,7 +122,7 @@ export class Regions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -132,7 +132,7 @@ export class Regions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -142,7 +142,7 @@ export class Regions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -152,7 +152,7 @@ export class Regions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -161,14 +161,14 @@ export class Regions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/auth/client/Client.ts b/sdks/api/full/typescript/src/api/resources/auth/client/Client.ts index df7e1a3832..61e4fe3b5d 100644 --- a/sdks/api/full/typescript/src/api/resources/auth/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/auth/client/Client.ts @@ -9,7 +9,7 @@ import { Tokens } from "../resources/tokens/client/Client"; export declare namespace Auth { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/auth/resources/identity/client/Client.ts b/sdks/api/full/typescript/src/api/resources/auth/resources/identity/client/Client.ts index 4342ad1312..69b1518fa6 100644 --- a/sdks/api/full/typescript/src/api/resources/auth/resources/identity/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/auth/resources/identity/client/Client.ts @@ -8,7 +8,7 @@ import { Email } from "../resources/email/client/Client"; export declare namespace Identity { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/auth/resources/identity/resources/email/client/Client.ts b/sdks/api/full/typescript/src/api/resources/auth/resources/identity/resources/email/client/Client.ts index c5e986fabd..2d20e18293 100644 --- a/sdks/api/full/typescript/src/api/resources/auth/resources/identity/resources/email/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/auth/resources/identity/resources/email/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import * as serializers from "../../../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Email { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,15 +32,15 @@ export class Email { /** * Starts the verification process for linking an email to your identity. * - * @param {Rivet.auth.identity.StartEmailVerificationRequest} request + * @param {RivetClient.auth.identity.StartEmailVerificationRequest} request * @param {Email.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.auth.identity.email.startEmailVerification({ @@ -57,12 +57,12 @@ export class Email { * }) */ public async startEmailVerification( - request: Rivet.auth.identity.StartEmailVerificationRequest, + request: RivetClient.auth.identity.StartEmailVerificationRequest, requestOptions?: Email.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/auth/identity/email/start-verification" ), method: "POST", @@ -94,7 +94,7 @@ export class Email { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -104,7 +104,7 @@ export class Email { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -114,7 +114,7 @@ export class Email { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -124,7 +124,7 @@ export class Email { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -134,7 +134,7 @@ export class Email { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -144,7 +144,7 @@ export class Email { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -154,7 +154,7 @@ export class Email { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -163,14 +163,14 @@ export class Email { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -179,15 +179,15 @@ export class Email { /** * Completes the email verification process. * - * @param {Rivet.auth.identity.CompleteEmailVerificationRequest} request + * @param {RivetClient.auth.identity.CompleteEmailVerificationRequest} request * @param {Email.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.auth.identity.email.completeEmailVerification({ @@ -196,12 +196,12 @@ export class Email { * }) */ public async completeEmailVerification( - request: Rivet.auth.identity.CompleteEmailVerificationRequest, + request: RivetClient.auth.identity.CompleteEmailVerificationRequest, requestOptions?: Email.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/auth/identity/email/complete-verification" ), method: "POST", @@ -233,7 +233,7 @@ export class Email { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -243,7 +243,7 @@ export class Email { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -253,7 +253,7 @@ export class Email { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -263,7 +263,7 @@ export class Email { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -273,7 +273,7 @@ export class Email { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -283,7 +283,7 @@ export class Email { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -293,7 +293,7 @@ export class Email { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -302,14 +302,14 @@ export class Email { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/auth/resources/tokens/client/Client.ts b/sdks/api/full/typescript/src/api/resources/auth/resources/tokens/client/Client.ts index 96db59a411..c1fce84cad 100644 --- a/sdks/api/full/typescript/src/api/resources/auth/resources/tokens/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/auth/resources/tokens/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import * as serializers from "../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; export declare namespace Tokens { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,15 +32,15 @@ export class Tokens { /** * Refreshes the current identity's token and sets authentication headers. * - * @param {Rivet.auth.RefreshIdentityTokenRequest} request + * @param {RivetClient.auth.RefreshIdentityTokenRequest} request * @param {Tokens.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.auth.tokens.refreshIdentityToken({ @@ -48,12 +48,12 @@ export class Tokens { * }) */ public async refreshIdentityToken( - request: Rivet.auth.RefreshIdentityTokenRequest, + request: RivetClient.auth.RefreshIdentityTokenRequest, requestOptions?: Tokens.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/auth/tokens/identity" ), method: "POST", @@ -85,7 +85,7 @@ export class Tokens { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -95,7 +95,7 @@ export class Tokens { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -105,7 +105,7 @@ export class Tokens { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -115,7 +115,7 @@ export class Tokens { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -125,7 +125,7 @@ export class Tokens { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -135,7 +135,7 @@ export class Tokens { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -145,7 +145,7 @@ export class Tokens { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -154,14 +154,14 @@ export class Tokens { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/client/Client.ts index d85dba4bdc..9c86d4296c 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; @@ -18,7 +18,7 @@ import { Uploads } from "../resources/uploads/client/Client"; export declare namespace Cloud { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -41,20 +41,20 @@ export class Cloud { * * @param {Cloud.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.bootstrap() */ - public async bootstrap(requestOptions?: Cloud.RequestOptions): Promise { + public async bootstrap(requestOptions?: Cloud.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/bootstrap" ), method: "GET", @@ -83,7 +83,7 @@ export class Cloud { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -93,7 +93,7 @@ export class Cloud { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -103,7 +103,7 @@ export class Cloud { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -113,7 +113,7 @@ export class Cloud { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Cloud { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Cloud { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Cloud { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -152,14 +152,14 @@ export class Cloud { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/auth/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/auth/client/Client.ts index ccce4c0b36..8bf483e54e 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/auth/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/auth/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Auth { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -34,20 +34,20 @@ export class Auth { * * @param {Auth.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.auth.inspect() */ - public async inspect(requestOptions?: Auth.RequestOptions): Promise { + public async inspect(requestOptions?: Auth.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/auth/inspect" ), method: "GET", @@ -76,7 +76,7 @@ export class Auth { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -86,7 +86,7 @@ export class Auth { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -96,7 +96,7 @@ export class Auth { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +106,7 @@ export class Auth { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +116,7 @@ export class Auth { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +126,7 @@ export class Auth { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +136,7 @@ export class Auth { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -145,14 +145,14 @@ export class Auth { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/client/Client.ts index bac2133e14..29e6519f90 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/client/Client.ts @@ -8,7 +8,7 @@ import { Links } from "../resources/links/client/Client"; export declare namespace Devices { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/Client.ts index 6102028261..5a2553b22e 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Links { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,22 +32,22 @@ export class Links { /** * @param {Links.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.devices.links.prepare() */ public async prepare( requestOptions?: Links.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/devices/links" ), method: "POST", @@ -76,7 +76,7 @@ export class Links { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -86,7 +86,7 @@ export class Links { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -96,7 +96,7 @@ export class Links { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +106,7 @@ export class Links { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +116,7 @@ export class Links { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +126,7 @@ export class Links { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +136,7 @@ export class Links { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -145,29 +145,29 @@ export class Links { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } } /** - * @param {Rivet.cloud.devices.GetDeviceLinkRequest} request + * @param {RivetClient.cloud.devices.GetDeviceLinkRequest} request * @param {Links.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.devices.links.get({ @@ -176,9 +176,9 @@ export class Links { * }) */ public async get( - request: Rivet.cloud.devices.GetDeviceLinkRequest, + request: RivetClient.cloud.devices.GetDeviceLinkRequest, requestOptions?: Links.RequestOptions - ): Promise { + ): Promise { const { deviceLinkToken, watchIndex } = request; const _queryParams: Record = {}; _queryParams["device_link_token"] = deviceLinkToken; @@ -188,7 +188,7 @@ export class Links { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/devices/links" ), method: "GET", @@ -218,7 +218,7 @@ export class Links { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -228,7 +228,7 @@ export class Links { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -238,7 +238,7 @@ export class Links { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -248,7 +248,7 @@ export class Links { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -258,7 +258,7 @@ export class Links { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -268,7 +268,7 @@ export class Links { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -278,7 +278,7 @@ export class Links { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -287,29 +287,29 @@ export class Links { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } } /** - * @param {Rivet.cloud.devices.CompleteDeviceLinkRequest} request + * @param {RivetClient.cloud.devices.CompleteDeviceLinkRequest} request * @param {Links.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.devices.links.complete({ @@ -318,12 +318,12 @@ export class Links { * }) */ public async complete( - request: Rivet.cloud.devices.CompleteDeviceLinkRequest, + request: RivetClient.cloud.devices.CompleteDeviceLinkRequest, requestOptions?: Links.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/devices/links/complete" ), method: "POST", @@ -349,7 +349,7 @@ export class Links { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -359,7 +359,7 @@ export class Links { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -369,7 +369,7 @@ export class Links { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -379,7 +379,7 @@ export class Links { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -389,7 +389,7 @@ export class Links { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -399,7 +399,7 @@ export class Links { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -409,7 +409,7 @@ export class Links { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -418,14 +418,14 @@ export class Links { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/requests/GetDeviceLinkRequest.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/requests/GetDeviceLinkRequest.ts index 0a364cb254..51bba82cc4 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/requests/GetDeviceLinkRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/devices/resources/links/client/requests/GetDeviceLinkRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../../../index"; +import * as RivetClient from "../../../../../../../../index"; /** * @example @@ -12,6 +12,6 @@ import * as Rivet from "../../../../../../../../index"; * } */ export interface GetDeviceLinkRequest { - deviceLinkToken: Rivet.Jwt; - watchIndex?: Rivet.WatchQuery; + deviceLinkToken: RivetClient.Jwt; + watchIndex?: RivetClient.WatchQuery; } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/client/Client.ts index 044e8f45a4..a2975d4e5c 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; @@ -18,7 +18,7 @@ import { Versions } from "../resources/versions/client/Client"; export declare namespace Games { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -39,15 +39,15 @@ export class Games { /** * Returns a list of games in which the current identity is a group member of its development team. * - * @param {Rivet.cloud.games.GetGamesRequest} request + * @param {RivetClient.cloud.games.GetGamesRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.getGames({ @@ -55,9 +55,9 @@ export class Games { * }) */ public async getGames( - request: Rivet.cloud.games.GetGamesRequest = {}, + request: RivetClient.cloud.games.GetGamesRequest = {}, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -66,7 +66,7 @@ export class Games { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/games" ), method: "GET", @@ -96,7 +96,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +106,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +116,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +126,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +136,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -146,7 +146,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -156,7 +156,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -165,14 +165,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -181,15 +181,15 @@ export class Games { /** * Creates a new game. * - * @param {Rivet.cloud.games.CreateGameRequest} request + * @param {RivetClient.cloud.games.CreateGameRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.createGame({ @@ -199,12 +199,12 @@ export class Games { * }) */ public async createGame( - request: Rivet.cloud.games.CreateGameRequest, + request: RivetClient.cloud.games.CreateGameRequest, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/games" ), method: "POST", @@ -234,7 +234,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -244,7 +244,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -254,7 +254,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -264,7 +264,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -274,7 +274,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -284,7 +284,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -294,7 +294,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -303,14 +303,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -319,15 +319,15 @@ export class Games { /** * Validates information used to create a new game. * - * @param {Rivet.cloud.games.ValidateGameRequest} request + * @param {RivetClient.cloud.games.ValidateGameRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.validateGame({ @@ -336,12 +336,12 @@ export class Games { * }) */ public async validateGame( - request: Rivet.cloud.games.ValidateGameRequest, + request: RivetClient.cloud.games.ValidateGameRequest, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/games/validate" ), method: "POST", @@ -371,7 +371,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -381,7 +381,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -391,7 +391,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -401,7 +401,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -411,7 +411,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -421,7 +421,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -431,7 +431,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -440,14 +440,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -457,15 +457,15 @@ export class Games { * Returns a game by its game id. * * @param {string} gameId - * @param {Rivet.cloud.games.GetGameByIdRequest} request + * @param {RivetClient.cloud.games.GetGameByIdRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.getGameById("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -474,9 +474,9 @@ export class Games { */ public async getGameById( gameId: string, - request: Rivet.cloud.games.GetGameByIdRequest = {}, + request: RivetClient.cloud.games.GetGameByIdRequest = {}, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -485,7 +485,7 @@ export class Games { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}` ), method: "GET", @@ -515,7 +515,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -525,7 +525,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -535,7 +535,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -545,7 +545,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -555,7 +555,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -565,7 +565,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -575,7 +575,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -584,14 +584,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -601,15 +601,15 @@ export class Games { * Prepares a game banner image upload. * * @param {string} gameId - * @param {Rivet.cloud.games.GameBannerUploadPrepareRequest} request + * @param {RivetClient.cloud.games.GameBannerUploadPrepareRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.gameBannerUploadPrepare("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -620,12 +620,12 @@ export class Games { */ public async gameBannerUploadPrepare( gameId: string, - request: Rivet.cloud.games.GameBannerUploadPrepareRequest, + request: RivetClient.cloud.games.GameBannerUploadPrepareRequest, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/banner-upload/prepare` ), method: "POST", @@ -657,7 +657,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -667,7 +667,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -677,7 +677,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -687,7 +687,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -697,7 +697,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -707,7 +707,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -717,7 +717,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -726,14 +726,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -746,12 +746,12 @@ export class Games { * @param {string} uploadId * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.gameBannerUploadComplete("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -763,7 +763,7 @@ export class Games { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/banner-upload/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -786,7 +786,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -796,7 +796,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -806,7 +806,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -816,7 +816,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -826,7 +826,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -836,7 +836,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -846,7 +846,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -855,14 +855,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -872,15 +872,15 @@ export class Games { * Prepares a game logo image upload. * * @param {string} gameId - * @param {Rivet.cloud.games.GameLogoUploadPrepareRequest} request + * @param {RivetClient.cloud.games.GameLogoUploadPrepareRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.gameLogoUploadPrepare("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -891,12 +891,12 @@ export class Games { */ public async gameLogoUploadPrepare( gameId: string, - request: Rivet.cloud.games.GameLogoUploadPrepareRequest, + request: RivetClient.cloud.games.GameLogoUploadPrepareRequest, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/logo-upload/prepare` ), method: "POST", @@ -928,7 +928,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -938,7 +938,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -948,7 +948,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -958,7 +958,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -968,7 +968,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -978,7 +978,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -988,7 +988,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -997,14 +997,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1017,12 +1017,12 @@ export class Games { * @param {string} uploadId * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.gameLogoUploadComplete("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1034,7 +1034,7 @@ export class Games { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/logo-upload/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -1057,7 +1057,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1067,7 +1067,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1077,7 +1077,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1087,7 +1087,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1097,7 +1097,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1107,7 +1107,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1117,7 +1117,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1126,14 +1126,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/avatars/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/avatars/client/Client.ts index f6675189dd..88e947c92c 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/avatars/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/avatars/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Avatars { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Avatars { * @param {string} gameId * @param {Avatars.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.avatars.listGameCustomAvatars("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Avatars { public async listGameCustomAvatars( gameId: string, requestOptions?: Avatars.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/avatars` ), method: "GET", @@ -80,7 +80,7 @@ export class Avatars { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Avatars { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Avatars { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Avatars { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Avatars { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Avatars { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Avatars { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Avatars { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -167,15 +167,15 @@ export class Avatars { * Complete upload with `rivet.api.cloud#CompleteCustomAvatarUpload`. * * @param {string} gameId - * @param {Rivet.cloud.games.PrepareCustomAvatarUploadRequest} request + * @param {RivetClient.cloud.games.PrepareCustomAvatarUploadRequest} request * @param {Avatars.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.avatars.prepareCustomAvatarUpload("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -186,12 +186,12 @@ export class Avatars { */ public async prepareCustomAvatarUpload( gameId: string, - request: Rivet.cloud.games.PrepareCustomAvatarUploadRequest, + request: RivetClient.cloud.games.PrepareCustomAvatarUploadRequest, requestOptions?: Avatars.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/prepare` ), method: "POST", @@ -223,7 +223,7 @@ export class Avatars { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -233,7 +233,7 @@ export class Avatars { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -243,7 +243,7 @@ export class Avatars { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -253,7 +253,7 @@ export class Avatars { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -263,7 +263,7 @@ export class Avatars { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -273,7 +273,7 @@ export class Avatars { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -283,7 +283,7 @@ export class Avatars { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -292,14 +292,14 @@ export class Avatars { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -312,12 +312,12 @@ export class Avatars { * @param {string} uploadId * @param {Avatars.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.avatars.completeCustomAvatarUpload("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -329,7 +329,7 @@ export class Avatars { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/avatar-upload/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -352,7 +352,7 @@ export class Avatars { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -362,7 +362,7 @@ export class Avatars { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -372,7 +372,7 @@ export class Avatars { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -382,7 +382,7 @@ export class Avatars { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -392,7 +392,7 @@ export class Avatars { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -402,7 +402,7 @@ export class Avatars { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -412,7 +412,7 @@ export class Avatars { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -421,14 +421,14 @@ export class Avatars { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/builds/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/builds/client/Client.ts index 02a8bdb628..3d9fb5b496 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/builds/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/builds/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Builds { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Builds { * @param {string} gameId * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.builds.listGameBuilds("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Builds { public async listGameBuilds( gameId: string, 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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/builds` ), method: "GET", @@ -80,7 +80,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -166,15 +166,15 @@ export class Builds { * Creates a new game build for the given game. * * @param {string} gameId - * @param {Rivet.cloud.games.CreateGameBuildRequest} request + * @param {RivetClient.cloud.games.CreateGameBuildRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.builds.createGameBuild("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -192,12 +192,12 @@ export class Builds { */ public async createGameBuild( gameId: string, - request: Rivet.cloud.games.CreateGameBuildRequest, + request: RivetClient.cloud.games.CreateGameBuildRequest, 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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/builds` ), method: "POST", @@ -229,7 +229,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -239,7 +239,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -249,7 +249,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -259,7 +259,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -269,7 +269,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -279,7 +279,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -289,7 +289,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -298,14 +298,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/cdn/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/cdn/client/Client.ts index 4aa0ade6ac..f0f8ac7698 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/cdn/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/cdn/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Cdn { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Cdn { * @param {string} gameId * @param {Cdn.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.cdn.listGameCdnSites("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Cdn { public async listGameCdnSites( gameId: string, requestOptions?: Cdn.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/cdn/sites` ), method: "GET", @@ -80,7 +80,7 @@ export class Cdn { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Cdn { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Cdn { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Cdn { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Cdn { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Cdn { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Cdn { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Cdn { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -166,15 +166,15 @@ export class Cdn { * Creates a new CDN site for the given game. * * @param {string} gameId - * @param {Rivet.cloud.games.CreateGameCdnSiteRequest} request + * @param {RivetClient.cloud.games.CreateGameCdnSiteRequest} request * @param {Cdn.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.cdn.createGameCdnSite("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -188,12 +188,12 @@ export class Cdn { */ public async createGameCdnSite( gameId: string, - request: Rivet.cloud.games.CreateGameCdnSiteRequest, + request: RivetClient.cloud.games.CreateGameCdnSiteRequest, requestOptions?: Cdn.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/cdn/sites` ), method: "POST", @@ -225,7 +225,7 @@ export class Cdn { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -235,7 +235,7 @@ export class Cdn { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -245,7 +245,7 @@ export class Cdn { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -255,7 +255,7 @@ export class Cdn { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -265,7 +265,7 @@ export class Cdn { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -275,7 +275,7 @@ export class Cdn { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -285,7 +285,7 @@ export class Cdn { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -294,14 +294,14 @@ export class Cdn { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/Client.ts index 5b9050e6a5..55aeb3dfdc 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import * as serializers from "../../../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Matchmaker { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Matchmaker { * Exports lobby history over a given query time span. * * @param {string} gameId - * @param {Rivet.cloud.games.ExportMatchmakerLobbyHistoryRequest} request + * @param {RivetClient.cloud.games.ExportMatchmakerLobbyHistoryRequest} request * @param {Matchmaker.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.matchmaker.exportMatchmakerLobbyHistory("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -51,12 +51,12 @@ export class Matchmaker { */ public async exportMatchmakerLobbyHistory( gameId: string, - request: Rivet.cloud.games.ExportMatchmakerLobbyHistoryRequest, + request: RivetClient.cloud.games.ExportMatchmakerLobbyHistoryRequest, requestOptions?: Matchmaker.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/matchmaker/lobbies/export-history` ), method: "POST", @@ -88,7 +88,7 @@ export class Matchmaker { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -98,7 +98,7 @@ export class Matchmaker { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -108,7 +108,7 @@ export class Matchmaker { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -118,7 +118,7 @@ export class Matchmaker { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -128,7 +128,7 @@ export class Matchmaker { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -138,7 +138,7 @@ export class Matchmaker { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -148,7 +148,7 @@ export class Matchmaker { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -157,14 +157,14 @@ export class Matchmaker { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -177,12 +177,12 @@ export class Matchmaker { * @param {string} lobbyId * @param {Matchmaker.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.matchmaker.deleteMatchmakerLobby("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -191,10 +191,10 @@ export class Matchmaker { gameId: string, lobbyId: string, requestOptions?: Matchmaker.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/matchmaker/lobbies/${encodeURIComponent(lobbyId)}` ), method: "DELETE", @@ -223,7 +223,7 @@ export class Matchmaker { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -233,7 +233,7 @@ export class Matchmaker { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -243,7 +243,7 @@ export class Matchmaker { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -253,7 +253,7 @@ export class Matchmaker { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -263,7 +263,7 @@ export class Matchmaker { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -273,7 +273,7 @@ export class Matchmaker { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -283,7 +283,7 @@ export class Matchmaker { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -292,14 +292,14 @@ export class Matchmaker { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -310,15 +310,15 @@ export class Matchmaker { * * @param {string} gameId * @param {string} lobbyId - * @param {Rivet.cloud.games.GetLobbyLogsRequest} request + * @param {RivetClient.cloud.games.GetLobbyLogsRequest} request * @param {Matchmaker.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.matchmaker.getLobbyLogs("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -329,9 +329,9 @@ export class Matchmaker { public async getLobbyLogs( gameId: string, lobbyId: string, - request: Rivet.cloud.games.GetLobbyLogsRequest, + request: RivetClient.cloud.games.GetLobbyLogsRequest, requestOptions?: Matchmaker.RequestOptions - ): Promise { + ): Promise { const { stream, watchIndex } = request; const _queryParams: Record = {}; _queryParams["stream"] = stream; @@ -341,7 +341,7 @@ export class Matchmaker { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/matchmaker/lobbies/${encodeURIComponent(lobbyId)}/logs` ), method: "GET", @@ -371,7 +371,7 @@ export class Matchmaker { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -381,7 +381,7 @@ export class Matchmaker { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -391,7 +391,7 @@ export class Matchmaker { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -401,7 +401,7 @@ export class Matchmaker { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -411,7 +411,7 @@ export class Matchmaker { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -421,7 +421,7 @@ export class Matchmaker { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -431,7 +431,7 @@ export class Matchmaker { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -440,14 +440,14 @@ export class Matchmaker { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -458,15 +458,15 @@ export class Matchmaker { * * @param {string} gameId * @param {string} lobbyId - * @param {Rivet.cloud.games.ExportLobbyLogsRequest} request + * @param {RivetClient.cloud.games.ExportLobbyLogsRequest} request * @param {Matchmaker.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.matchmaker.exportLobbyLogs("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -476,12 +476,12 @@ export class Matchmaker { public async exportLobbyLogs( gameId: string, lobbyId: string, - request: Rivet.cloud.games.ExportLobbyLogsRequest, + request: RivetClient.cloud.games.ExportLobbyLogsRequest, requestOptions?: Matchmaker.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/matchmaker/lobbies/${encodeURIComponent( lobbyId )}/logs/export` @@ -515,7 +515,7 @@ export class Matchmaker { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -525,7 +525,7 @@ export class Matchmaker { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -535,7 +535,7 @@ export class Matchmaker { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -545,7 +545,7 @@ export class Matchmaker { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -555,7 +555,7 @@ export class Matchmaker { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -565,7 +565,7 @@ export class Matchmaker { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -575,7 +575,7 @@ export class Matchmaker { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -584,14 +584,14 @@ export class Matchmaker { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/requests/GetLobbyLogsRequest.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/requests/GetLobbyLogsRequest.ts index e3f2ef6c6e..a524210b92 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/requests/GetLobbyLogsRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/matchmaker/client/requests/GetLobbyLogsRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../../../index"; +import * as RivetClient from "../../../../../../../../index"; /** * @example @@ -12,7 +12,7 @@ import * as Rivet from "../../../../../../../../index"; * } */ export interface GetLobbyLogsRequest { - stream: Rivet.cloud.games.LogStream; + stream: RivetClient.cloud.games.LogStream; /** * A query parameter denoting the requests watch index. */ diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/client/Client.ts index 59abd6997c..a2921e2dab 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import * as serializers from "../../../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../../../errors/index"; @@ -13,7 +13,7 @@ import { Logs } from "../resources/logs/client/Client"; export declare namespace Namespaces { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,15 +35,15 @@ export class Namespaces { * Creates a new namespace for the given game. * * @param {string} gameId - * @param {Rivet.cloud.games.namespaces.CreateGameNamespaceRequest} request + * @param {RivetClient.cloud.games.namespaces.CreateGameNamespaceRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.createGameNamespace("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -54,12 +54,12 @@ export class Namespaces { */ public async createGameNamespace( gameId: string, - request: Rivet.cloud.games.namespaces.CreateGameNamespaceRequest, + request: RivetClient.cloud.games.namespaces.CreateGameNamespaceRequest, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces` ), method: "POST", @@ -91,7 +91,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -141,7 +141,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -151,7 +151,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -160,14 +160,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -177,15 +177,15 @@ export class Namespaces { * Validates information used to create a new game namespace. * * @param {string} gameId - * @param {Rivet.cloud.games.namespaces.ValidateGameNamespaceRequest} request + * @param {RivetClient.cloud.games.namespaces.ValidateGameNamespaceRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.validateGameNamespace("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -195,12 +195,12 @@ export class Namespaces { */ public async validateGameNamespace( gameId: string, - request: Rivet.cloud.games.namespaces.ValidateGameNamespaceRequest, + request: RivetClient.cloud.games.namespaces.ValidateGameNamespaceRequest, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/validate` ), method: "POST", @@ -232,7 +232,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -242,7 +242,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -252,7 +252,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -262,7 +262,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -272,7 +272,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -282,7 +282,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -292,7 +292,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -301,14 +301,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -321,12 +321,12 @@ export class Namespaces { * @param {string} namespaceId * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.getGameNamespaceById("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -335,10 +335,10 @@ export class Namespaces { gameId: string, namespaceId: string, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}` ), method: "GET", @@ -367,7 +367,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -377,7 +377,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -387,7 +387,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -397,7 +397,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -407,7 +407,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -417,7 +417,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -427,7 +427,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -436,14 +436,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -454,15 +454,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.UpdateNamespaceCdnAuthUserRequest} request + * @param {RivetClient.cloud.games.namespaces.UpdateNamespaceCdnAuthUserRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.updateNamespaceCdnAuthUser("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -473,12 +473,12 @@ export class Namespaces { public async updateNamespaceCdnAuthUser( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.UpdateNamespaceCdnAuthUserRequest, + request: RivetClient.cloud.games.namespaces.UpdateNamespaceCdnAuthUserRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/auth-user` ), method: "POST", @@ -504,7 +504,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -514,7 +514,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -524,7 +524,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -534,7 +534,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -544,7 +544,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -554,7 +554,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -564,7 +564,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -573,14 +573,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -594,12 +594,12 @@ export class Namespaces { * @param {string} user - A user name. * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.removeNamespaceCdnAuthUser("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "string") @@ -612,7 +612,7 @@ export class Namespaces { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/auth-user/${encodeURIComponent(user)}` @@ -637,7 +637,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -647,7 +647,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -657,7 +657,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -667,7 +667,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -677,7 +677,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -687,7 +687,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -697,7 +697,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -706,14 +706,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -724,15 +724,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.SetNamespaceCdnAuthTypeRequest} request + * @param {RivetClient.cloud.games.namespaces.SetNamespaceCdnAuthTypeRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.setNamespaceCdnAuthType("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -742,12 +742,12 @@ export class Namespaces { public async setNamespaceCdnAuthType( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.SetNamespaceCdnAuthTypeRequest, + request: RivetClient.cloud.games.namespaces.SetNamespaceCdnAuthTypeRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/cdn-auth` ), method: "PUT", @@ -773,7 +773,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -783,7 +783,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -793,7 +793,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -803,7 +803,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -813,7 +813,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -823,7 +823,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -833,7 +833,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -842,14 +842,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -860,15 +860,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.ToggleNamespaceDomainPublicAuthRequest} request + * @param {RivetClient.cloud.games.namespaces.ToggleNamespaceDomainPublicAuthRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.toggleNamespaceDomainPublicAuth("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -878,12 +878,12 @@ export class Namespaces { public async toggleNamespaceDomainPublicAuth( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.ToggleNamespaceDomainPublicAuthRequest, + request: RivetClient.cloud.games.namespaces.ToggleNamespaceDomainPublicAuthRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/domain-public-auth` @@ -911,7 +911,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -921,7 +921,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -931,7 +931,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -941,7 +941,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -951,7 +951,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -961,7 +961,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -971,7 +971,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -980,14 +980,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -998,15 +998,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.AddNamespaceDomainRequest} request + * @param {RivetClient.cloud.games.namespaces.AddNamespaceDomainRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.addNamespaceDomain("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1016,12 +1016,12 @@ export class Namespaces { public async addNamespaceDomain( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.AddNamespaceDomainRequest, + request: RivetClient.cloud.games.namespaces.AddNamespaceDomainRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/domains` ), method: "POST", @@ -1047,7 +1047,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1057,7 +1057,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1067,7 +1067,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1077,7 +1077,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1087,7 +1087,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1097,7 +1097,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1107,7 +1107,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1116,14 +1116,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1137,12 +1137,12 @@ export class Namespaces { * @param {string} domain - A valid domain name (no protocol). * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.removeNamespaceDomain("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "string") @@ -1155,7 +1155,7 @@ export class Namespaces { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/domains/${encodeURIComponent(domain)}` @@ -1180,7 +1180,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1190,7 +1190,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1200,7 +1200,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1210,7 +1210,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1220,7 +1220,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1230,7 +1230,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1240,7 +1240,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1249,14 +1249,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1267,15 +1267,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.UpdateGameNamespaceMatchmakerConfigRequest} request + * @param {RivetClient.cloud.games.namespaces.UpdateGameNamespaceMatchmakerConfigRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.updateGameNamespaceMatchmakerConfig("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1286,12 +1286,12 @@ export class Namespaces { public async updateGameNamespaceMatchmakerConfig( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.UpdateGameNamespaceMatchmakerConfigRequest, + request: RivetClient.cloud.games.namespaces.UpdateGameNamespaceMatchmakerConfigRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/mm-config` ), method: "POST", @@ -1317,7 +1317,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1327,7 +1327,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1337,7 +1337,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1347,7 +1347,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1357,7 +1357,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1367,7 +1367,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1377,7 +1377,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1386,14 +1386,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1404,15 +1404,15 @@ export class Namespaces { * * @param {string} gameId - A universally unique identifier. * @param {string} namespaceId - A universally unique identifier. - * @param {Rivet.cloud.games.namespaces.GetGameNamespaceVersionHistoryRequest} request + * @param {RivetClient.cloud.games.namespaces.GetGameNamespaceVersionHistoryRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.getGameNamespaceVersionHistoryList("string", "string", { @@ -1423,9 +1423,9 @@ export class Namespaces { public async getGameNamespaceVersionHistoryList( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.GetGameNamespaceVersionHistoryRequest = {}, + request: RivetClient.cloud.games.namespaces.GetGameNamespaceVersionHistoryRequest = {}, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const { anchor, limit } = request; const _queryParams: Record = {}; if (anchor != null) { @@ -1438,7 +1438,7 @@ export class Namespaces { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/version-history` @@ -1473,7 +1473,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1483,7 +1483,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1493,7 +1493,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1503,7 +1503,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1513,7 +1513,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1523,7 +1523,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1533,7 +1533,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1542,14 +1542,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1560,15 +1560,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.ValidateGameNamespaceMatchmakerConfigRequest} request + * @param {RivetClient.cloud.games.namespaces.ValidateGameNamespaceMatchmakerConfigRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.validateGameNamespaceMatchmakerConfig("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1579,12 +1579,12 @@ export class Namespaces { public async validateGameNamespaceMatchmakerConfig( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.ValidateGameNamespaceMatchmakerConfigRequest, + request: RivetClient.cloud.games.namespaces.ValidateGameNamespaceMatchmakerConfigRequest, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/mm-config/validate` @@ -1621,7 +1621,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1631,7 +1631,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1641,7 +1641,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1651,7 +1651,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1661,7 +1661,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1671,7 +1671,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1681,7 +1681,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1690,14 +1690,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1708,15 +1708,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.CreateGameNamespaceTokenDevelopmentRequest} request + * @param {RivetClient.cloud.games.namespaces.CreateGameNamespaceTokenDevelopmentRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.createGameNamespaceTokenDevelopment("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1739,12 +1739,12 @@ export class Namespaces { public async createGameNamespaceTokenDevelopment( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.CreateGameNamespaceTokenDevelopmentRequest, + request: RivetClient.cloud.games.namespaces.CreateGameNamespaceTokenDevelopmentRequest, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/tokens/development` @@ -1781,7 +1781,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1791,7 +1791,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1801,7 +1801,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1811,7 +1811,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1821,7 +1821,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1831,7 +1831,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1841,7 +1841,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1850,14 +1850,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1868,15 +1868,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.ValidateGameNamespaceTokenDevelopmentRequest} request + * @param {RivetClient.cloud.games.namespaces.ValidateGameNamespaceTokenDevelopmentRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.validateGameNamespaceTokenDevelopment("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1892,12 +1892,12 @@ export class Namespaces { public async validateGameNamespaceTokenDevelopment( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.ValidateGameNamespaceTokenDevelopmentRequest, + request: RivetClient.cloud.games.namespaces.ValidateGameNamespaceTokenDevelopmentRequest, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/tokens/development/validate` @@ -1934,7 +1934,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1944,7 +1944,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1954,7 +1954,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1964,7 +1964,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1974,7 +1974,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1984,7 +1984,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1994,7 +1994,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2003,14 +2003,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -2023,12 +2023,12 @@ export class Namespaces { * @param {string} namespaceId * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.createGameNamespaceTokenPublic("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -2037,10 +2037,10 @@ export class Namespaces { gameId: string, namespaceId: string, requestOptions?: Namespaces.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/tokens/public` ), method: "POST", @@ -2072,7 +2072,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2082,7 +2082,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2092,7 +2092,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2102,7 +2102,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2112,7 +2112,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2122,7 +2122,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2132,7 +2132,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2141,14 +2141,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -2159,15 +2159,15 @@ export class Namespaces { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.UpdateGameNamespaceVersionRequest} request + * @param {RivetClient.cloud.games.namespaces.UpdateGameNamespaceVersionRequest} request * @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.updateGameNamespaceVersion("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -2177,12 +2177,12 @@ export class Namespaces { public async updateGameNamespaceVersion( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.UpdateGameNamespaceVersionRequest, + request: RivetClient.cloud.games.namespaces.UpdateGameNamespaceVersionRequest, requestOptions?: Namespaces.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/version` ), method: "PUT", @@ -2208,7 +2208,7 @@ export class Namespaces { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2218,7 +2218,7 @@ export class Namespaces { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2228,7 +2228,7 @@ export class Namespaces { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2238,7 +2238,7 @@ export class Namespaces { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2248,7 +2248,7 @@ export class Namespaces { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2258,7 +2258,7 @@ export class Namespaces { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2268,7 +2268,7 @@ export class Namespaces { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2277,14 +2277,14 @@ export class Namespaces { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/analytics/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/analytics/client/Client.ts index ddcfbadc6d..b1cf99247c 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/analytics/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/analytics/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../../../environments"; import * as core from "../../../../../../../../../../core"; -import * as Rivet from "../../../../../../../../../index"; +import * as RivetClient from "../../../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../../../errors/index"; export declare namespace Analytics { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -36,12 +36,12 @@ export class Analytics { * @param {string} namespaceId * @param {Analytics.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.analytics.getAnalyticsMatchmakerLive("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -50,10 +50,10 @@ export class Analytics { gameId: string, namespaceId: string, requestOptions?: Analytics.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/analytics/matchmaker/live` @@ -84,7 +84,7 @@ export class Analytics { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -94,7 +94,7 @@ export class Analytics { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -104,7 +104,7 @@ export class Analytics { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -114,7 +114,7 @@ export class Analytics { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -124,7 +124,7 @@ export class Analytics { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -134,7 +134,7 @@ export class Analytics { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -144,7 +144,7 @@ export class Analytics { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -153,14 +153,14 @@ export class Analytics { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/Client.ts index 3d9aa4d901..ba048cbf1a 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../../../environments"; import * as core from "../../../../../../../../../../core"; -import * as Rivet from "../../../../../../../../../index"; +import * as RivetClient from "../../../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../../../errors/index"; export declare namespace Logs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -34,15 +34,15 @@ export class Logs { * * @param {string} gameId * @param {string} namespaceId - * @param {Rivet.cloud.games.namespaces.ListNamespaceLobbiesRequest} request + * @param {RivetClient.cloud.games.namespaces.ListNamespaceLobbiesRequest} request * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.logs.listNamespaceLobbies("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -52,9 +52,9 @@ export class Logs { public async listNamespaceLobbies( gameId: string, namespaceId: string, - request: Rivet.cloud.games.namespaces.ListNamespaceLobbiesRequest = {}, + request: RivetClient.cloud.games.namespaces.ListNamespaceLobbiesRequest = {}, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const { beforeCreateTs } = request; const _queryParams: Record = {}; if (beforeCreateTs != null) { @@ -63,7 +63,7 @@ export class Logs { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent(namespaceId)}/logs/lobbies` ), method: "GET", @@ -93,7 +93,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -103,7 +103,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -113,7 +113,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -153,7 +153,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -162,14 +162,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -183,12 +183,12 @@ export class Logs { * @param {string} lobbyId * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.namespaces.logs.getNamespaceLobby("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -198,10 +198,10 @@ export class Logs { namespaceId: string, lobbyId: string, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/namespaces/${encodeURIComponent( namespaceId )}/logs/lobbies/${encodeURIComponent(lobbyId)}` @@ -232,7 +232,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -242,7 +242,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -252,7 +252,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -262,7 +262,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -272,7 +272,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -282,7 +282,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -292,7 +292,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -301,14 +301,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/requests/ListNamespaceLobbiesRequest.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/requests/ListNamespaceLobbiesRequest.ts index 549ad65e1d..c902d52d26 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/requests/ListNamespaceLobbiesRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/namespaces/resources/logs/client/requests/ListNamespaceLobbiesRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../../../../../index"; +import * as RivetClient from "../../../../../../../../../../index"; /** * @example @@ -14,5 +14,5 @@ export interface ListNamespaceLobbiesRequest { /** * Returns lobbies created before this timestamp. */ - beforeCreateTs?: Rivet.Timestamp; + beforeCreateTs?: RivetClient.Timestamp; } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/tokens/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/tokens/client/Client.ts index b60443c36c..c5563f761a 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/tokens/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/tokens/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Tokens { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Tokens { * @param {string} gameId * @param {Tokens.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.tokens.createCloudToken("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Tokens { public async createCloudToken( gameId: string, requestOptions?: Tokens.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/tokens/cloud` ), method: "POST", @@ -80,7 +80,7 @@ export class Tokens { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Tokens { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Tokens { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Tokens { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Tokens { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Tokens { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Tokens { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Tokens { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/versions/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/versions/client/Client.ts index 6a02acf8d8..327b00509f 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/versions/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/games/resources/versions/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import * as serializers from "../../../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Versions { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Versions { * Creates a new game version. * * @param {string} gameId - * @param {Rivet.cloud.games.CreateGameVersionRequest} request + * @param {RivetClient.cloud.games.CreateGameVersionRequest} request * @param {Versions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.versions.createGameVersion("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -108,12 +108,12 @@ export class Versions { */ public async createGameVersion( gameId: string, - request: Rivet.cloud.games.CreateGameVersionRequest, + request: RivetClient.cloud.games.CreateGameVersionRequest, requestOptions?: Versions.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/versions` ), method: "POST", @@ -145,7 +145,7 @@ export class Versions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -155,7 +155,7 @@ export class Versions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -165,7 +165,7 @@ export class Versions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -175,7 +175,7 @@ export class Versions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -185,7 +185,7 @@ export class Versions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -195,7 +195,7 @@ export class Versions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -205,7 +205,7 @@ export class Versions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -214,14 +214,14 @@ export class Versions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -233,12 +233,12 @@ export class Versions { * @param {string} gameId * @param {Versions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.versions.reserveVersionName("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -246,10 +246,10 @@ export class Versions { public async reserveVersionName( gameId: string, requestOptions?: Versions.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/versions/reserve-name` ), method: "POST", @@ -278,7 +278,7 @@ export class Versions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -288,7 +288,7 @@ export class Versions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -298,7 +298,7 @@ export class Versions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -308,7 +308,7 @@ export class Versions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -318,7 +318,7 @@ export class Versions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -328,7 +328,7 @@ export class Versions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -338,7 +338,7 @@ export class Versions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -347,14 +347,14 @@ export class Versions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -364,15 +364,15 @@ export class Versions { * Validates information used to create a new game version. * * @param {string} gameId - * @param {Rivet.cloud.games.ValidateGameVersionRequest} request + * @param {RivetClient.cloud.games.ValidateGameVersionRequest} request * @param {Versions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.versions.validateGameVersion("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -439,12 +439,12 @@ export class Versions { */ public async validateGameVersion( gameId: string, - request: Rivet.cloud.games.ValidateGameVersionRequest, + request: RivetClient.cloud.games.ValidateGameVersionRequest, requestOptions?: Versions.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/versions/validate` ), method: "POST", @@ -476,7 +476,7 @@ export class Versions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -486,7 +486,7 @@ export class Versions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -496,7 +496,7 @@ export class Versions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -506,7 +506,7 @@ export class Versions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -516,7 +516,7 @@ export class Versions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -526,7 +526,7 @@ export class Versions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -536,7 +536,7 @@ export class Versions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -545,14 +545,14 @@ export class Versions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -565,12 +565,12 @@ export class Versions { * @param {string} versionId * @param {Versions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.games.versions.getGameVersionById("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -579,10 +579,10 @@ export class Versions { gameId: string, versionId: string, requestOptions?: Versions.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/games/${encodeURIComponent(gameId)}/versions/${encodeURIComponent(versionId)}` ), method: "GET", @@ -611,7 +611,7 @@ export class Versions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -621,7 +621,7 @@ export class Versions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -631,7 +631,7 @@ export class Versions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -641,7 +641,7 @@ export class Versions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -651,7 +651,7 @@ export class Versions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -661,7 +661,7 @@ export class Versions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -671,7 +671,7 @@ export class Versions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -680,14 +680,14 @@ export class Versions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/groups/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/groups/client/Client.ts index 7758cbdc72..3d9e7e3edf 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/groups/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/groups/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import * as serializers from "../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; export declare namespace Groups { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,15 +32,15 @@ export class Groups { /** * Validates information used to create a new group. * - * @param {Rivet.cloud.ValidateGroupRequest} request + * @param {RivetClient.cloud.ValidateGroupRequest} request * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.groups.validate({ @@ -48,12 +48,12 @@ export class Groups { * }) */ public async validate( - request: Rivet.cloud.ValidateGroupRequest, + request: RivetClient.cloud.ValidateGroupRequest, requestOptions?: Groups.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/groups/validate" ), method: "POST", @@ -83,7 +83,7 @@ export class Groups { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -93,7 +93,7 @@ export class Groups { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -103,7 +103,7 @@ export class Groups { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -113,7 +113,7 @@ export class Groups { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Groups { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Groups { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Groups { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -152,14 +152,14 @@ export class Groups { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/logs/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/logs/client/Client.ts index 38f8445de8..4328ddae60 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/logs/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/logs/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Logs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Logs { * @param {string} rayId * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.logs.getRayPerfLogs("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Logs { public async getRayPerfLogs( rayId: string, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/rays/${encodeURIComponent(rayId)}/perf` ), method: "GET", @@ -80,7 +80,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/tiers/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/tiers/client/Client.ts index 986bfda6e1..0868ce974c 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/tiers/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/tiers/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Tiers { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -34,20 +34,22 @@ export class Tiers { * * @param {Tiers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.tiers.getRegionTiers() */ - public async getRegionTiers(requestOptions?: Tiers.RequestOptions): Promise { + public async getRegionTiers( + requestOptions?: Tiers.RequestOptions + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/cloud/region-tiers" ), method: "GET", @@ -76,7 +78,7 @@ export class Tiers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -86,7 +88,7 @@ export class Tiers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -96,7 +98,7 @@ export class Tiers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +108,7 @@ export class Tiers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +118,7 @@ export class Tiers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +128,7 @@ export class Tiers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +138,7 @@ export class Tiers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -145,14 +147,14 @@ export class Tiers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/cloud/resources/uploads/client/Client.ts b/sdks/api/full/typescript/src/api/resources/cloud/resources/uploads/client/Client.ts index 0b59c5dd4c..e664431741 100644 --- a/sdks/api/full/typescript/src/api/resources/cloud/resources/uploads/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/cloud/resources/uploads/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; export declare namespace Uploads { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Uploads { * @param {string} uploadId * @param {Uploads.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.cloud.uploads.completeUpload("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,7 +48,7 @@ export class Uploads { public async completeUpload(uploadId: string, requestOptions?: Uploads.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/cloud/uploads/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -71,7 +71,7 @@ export class Uploads { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -81,7 +81,7 @@ export class Uploads { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -91,7 +91,7 @@ export class Uploads { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Uploads { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Uploads { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Uploads { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Uploads { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -140,14 +140,14 @@ export class Uploads { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/BadRequestError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/BadRequestError.ts index 862667ba25..ffad9c50a9 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/BadRequestError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/BadRequestError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class BadRequestError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class BadRequestError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "BadRequestError", statusCode: 400, diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/ForbiddenError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/ForbiddenError.ts index ba42772a32..0f2c422ec0 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/ForbiddenError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/ForbiddenError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class ForbiddenError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class ForbiddenError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "ForbiddenError", statusCode: 403, diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/InternalError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/InternalError.ts index 1bc1140f5b..5b1c7ec877 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/InternalError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/InternalError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class InternalError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class InternalError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "InternalError", statusCode: 500, diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/NotFoundError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/NotFoundError.ts index 67c2019811..34c812321b 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/NotFoundError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/NotFoundError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class NotFoundError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class NotFoundError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "NotFoundError", statusCode: 404, diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/RateLimitError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/RateLimitError.ts index 64591f50c9..e30033560c 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/RateLimitError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/RateLimitError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class RateLimitError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class RateLimitError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "RateLimitError", statusCode: 429, diff --git a/sdks/api/full/typescript/src/api/resources/common/errors/UnauthorizedError.ts b/sdks/api/full/typescript/src/api/resources/common/errors/UnauthorizedError.ts index 5b522ed874..ad122ea5cf 100644 --- a/sdks/api/full/typescript/src/api/resources/common/errors/UnauthorizedError.ts +++ b/sdks/api/full/typescript/src/api/resources/common/errors/UnauthorizedError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class UnauthorizedError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class UnauthorizedError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "UnauthorizedError", statusCode: 408, diff --git a/sdks/api/full/typescript/src/api/resources/games/client/Client.ts b/sdks/api/full/typescript/src/api/resources/games/client/Client.ts index 980768de9b..49f6ae4129 100644 --- a/sdks/api/full/typescript/src/api/resources/games/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/games/client/Client.ts @@ -8,7 +8,7 @@ import { Environments } from "../resources/environments/client/Client"; export declare namespace Games { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/games/resources/environments/client/Client.ts b/sdks/api/full/typescript/src/api/resources/games/resources/environments/client/Client.ts index c84751626e..4c3bcb07b1 100644 --- a/sdks/api/full/typescript/src/api/resources/games/resources/environments/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/games/resources/environments/client/Client.ts @@ -8,7 +8,7 @@ import { Tokens } from "../resources/tokens/client/Client"; export declare namespace Environments { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/games/resources/environments/resources/tokens/client/Client.ts b/sdks/api/full/typescript/src/api/resources/games/resources/environments/resources/tokens/client/Client.ts index 4bee8975b3..7a9c8fef63 100644 --- a/sdks/api/full/typescript/src/api/resources/games/resources/environments/resources/tokens/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/games/resources/environments/resources/tokens/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; -import * as Rivet from "../../../../../../../index"; +import * as RivetClient from "../../../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../../../serialization/index"; import * as errors from "../../../../../../../../errors/index"; export declare namespace Tokens { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -36,12 +36,12 @@ export class Tokens { * @param {string} environmentId * @param {Tokens.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.games.environments.tokens.createServiceToken("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -50,10 +50,10 @@ export class Tokens { gameId: string, environmentId: string, requestOptions?: Tokens.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/tokens/service` ), method: "POST", @@ -82,7 +82,7 @@ export class Tokens { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -92,7 +92,7 @@ export class Tokens { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -102,7 +102,7 @@ export class Tokens { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -112,7 +112,7 @@ export class Tokens { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -122,7 +122,7 @@ export class Tokens { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -132,7 +132,7 @@ export class Tokens { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -142,7 +142,7 @@ export class Tokens { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -151,14 +151,14 @@ export class Tokens { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/group/client/Client.ts b/sdks/api/full/typescript/src/api/resources/group/client/Client.ts index 412fdc12e4..239de92cfa 100644 --- a/sdks/api/full/typescript/src/api/resources/group/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/group/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; @@ -13,7 +13,7 @@ import { JoinRequests } from "../resources/joinRequests/client/Client"; export declare namespace Group { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -34,15 +34,15 @@ export class Group { /** * Returns a list of suggested groups. * - * @param {Rivet.group.ListSuggestedRequest} request + * @param {RivetClient.group.ListSuggestedRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.listSuggested({ @@ -50,9 +50,9 @@ export class Group { * }) */ public async listSuggested( - request: Rivet.group.ListSuggestedRequest = {}, + request: RivetClient.group.ListSuggestedRequest = {}, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -61,7 +61,7 @@ export class Group { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/group/groups" ), method: "GET", @@ -91,7 +91,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -141,7 +141,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -151,7 +151,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -160,14 +160,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -176,15 +176,15 @@ export class Group { /** * Creates a new group. * - * @param {Rivet.group.CreateRequest} request + * @param {RivetClient.group.CreateRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.create({ @@ -192,12 +192,12 @@ export class Group { * }) */ public async create( - request: Rivet.group.CreateRequest, + request: RivetClient.group.CreateRequest, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/group/groups" ), method: "POST", @@ -227,7 +227,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -237,7 +237,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -247,7 +247,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -257,7 +257,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -267,7 +267,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -277,7 +277,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -287,7 +287,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -296,14 +296,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -313,15 +313,15 @@ export class Group { * Prepares an avatar image upload. * Complete upload with `rivet.api.group#CompleteAvatarUpload`. * - * @param {Rivet.group.PrepareAvatarUploadRequest} request + * @param {RivetClient.group.PrepareAvatarUploadRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.prepareAvatarUpload({ @@ -331,12 +331,12 @@ export class Group { * }) */ public async prepareAvatarUpload( - request: Rivet.group.PrepareAvatarUploadRequest, + request: RivetClient.group.PrepareAvatarUploadRequest, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/group/groups/avatar-upload/prepare" ), method: "POST", @@ -368,7 +368,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -378,7 +378,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -388,7 +388,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -398,7 +398,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -408,7 +408,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -418,7 +418,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -428,7 +428,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -437,14 +437,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -453,15 +453,15 @@ export class Group { /** * Validate contents of group profile. Use to provide immediate feedback on profile changes before committing them. * - * @param {Rivet.group.ValidateProfileRequest} request + * @param {RivetClient.group.ValidateProfileRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.validateProfile({ @@ -471,12 +471,12 @@ export class Group { * }) */ public async validateProfile( - request: Rivet.group.ValidateProfileRequest, + request: RivetClient.group.ValidateProfileRequest, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/group/groups/profile/validate" ), method: "POST", @@ -506,7 +506,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -516,7 +516,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -526,7 +526,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -536,7 +536,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -546,7 +546,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -556,7 +556,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -566,7 +566,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -575,14 +575,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -597,12 +597,12 @@ export class Group { * @param {string} uploadId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.completeAvatarUpload("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -614,7 +614,7 @@ export class Group { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/avatar-upload/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -637,7 +637,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -647,7 +647,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -657,7 +657,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -667,7 +667,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -677,7 +677,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -687,7 +687,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -697,7 +697,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -706,14 +706,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -723,15 +723,15 @@ export class Group { * Returns a group's bans. Must have valid permissions to view. * * @param {string} groupId - * @param {Rivet.group.GetBansRequest} request + * @param {RivetClient.group.GetBansRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.getBans("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -742,9 +742,9 @@ export class Group { */ public async getBans( groupId: string, - request: Rivet.group.GetBansRequest = {}, + request: RivetClient.group.GetBansRequest = {}, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const { anchor, count, watchIndex } = request; const _queryParams: Record = {}; if (anchor != null) { @@ -761,7 +761,7 @@ export class Group { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/bans` ), method: "GET", @@ -791,7 +791,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -801,7 +801,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -811,7 +811,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -821,7 +821,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -831,7 +831,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -841,7 +841,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -851,7 +851,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -860,14 +860,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -880,12 +880,12 @@ export class Group { * @param {string} identityId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.banIdentity("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -897,7 +897,7 @@ export class Group { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/bans/${encodeURIComponent(identityId)}` ), method: "POST", @@ -920,7 +920,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -930,7 +930,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -940,7 +940,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -950,7 +950,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -960,7 +960,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -970,7 +970,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -980,7 +980,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -989,14 +989,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1009,12 +1009,12 @@ export class Group { * @param {string} identityId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.unbanIdentity("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1026,7 +1026,7 @@ export class Group { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/bans/${encodeURIComponent(identityId)}` ), method: "DELETE", @@ -1049,7 +1049,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1059,7 +1059,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1069,7 +1069,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1079,7 +1079,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1089,7 +1089,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1099,7 +1099,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1109,7 +1109,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1118,14 +1118,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1135,15 +1135,15 @@ export class Group { * Returns a group's join requests. Must have valid permissions to view. * * @param {string} groupId - * @param {Rivet.group.GetJoinRequestsRequest} request + * @param {RivetClient.group.GetJoinRequestsRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.getJoinRequests("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1154,9 +1154,9 @@ export class Group { */ public async getJoinRequests( groupId: string, - request: Rivet.group.GetJoinRequestsRequest = {}, + request: RivetClient.group.GetJoinRequestsRequest = {}, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const { anchor, count, watchIndex } = request; const _queryParams: Record = {}; if (anchor != null) { @@ -1173,7 +1173,7 @@ export class Group { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/join-requests` ), method: "GET", @@ -1203,7 +1203,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1213,7 +1213,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1223,7 +1223,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1233,7 +1233,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1243,7 +1243,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1253,7 +1253,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1263,7 +1263,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1272,14 +1272,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1292,12 +1292,12 @@ export class Group { * @param {string} identityId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.kickMember("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1305,7 +1305,7 @@ export class Group { public async kickMember(groupId: string, identityId: string, requestOptions?: Group.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/kick/${encodeURIComponent(identityId)}` ), method: "POST", @@ -1328,7 +1328,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1338,7 +1338,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1348,7 +1348,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1358,7 +1358,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1368,7 +1368,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1378,7 +1378,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1388,7 +1388,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1397,14 +1397,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1416,12 +1416,12 @@ export class Group { * @param {string} groupId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.leave("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1429,7 +1429,7 @@ export class Group { public async leave(groupId: string, requestOptions?: Group.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/leave` ), method: "POST", @@ -1452,7 +1452,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1462,7 +1462,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1472,7 +1472,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1482,7 +1482,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1492,7 +1492,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1502,7 +1502,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1512,7 +1512,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1521,14 +1521,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1538,15 +1538,15 @@ export class Group { * Returns a group's members. * * @param {string} groupId - * @param {Rivet.group.GetMembersRequest} request + * @param {RivetClient.group.GetMembersRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.getMembers("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1557,9 +1557,9 @@ export class Group { */ public async getMembers( groupId: string, - request: Rivet.group.GetMembersRequest = {}, + request: RivetClient.group.GetMembersRequest = {}, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const { anchor, count, watchIndex } = request; const _queryParams: Record = {}; if (anchor != null) { @@ -1576,7 +1576,7 @@ export class Group { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/members` ), method: "GET", @@ -1606,7 +1606,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1616,7 +1616,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1626,7 +1626,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1636,7 +1636,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1646,7 +1646,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1656,7 +1656,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1666,7 +1666,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1675,14 +1675,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1692,15 +1692,15 @@ export class Group { * Returns a group profile. * * @param {string} groupId - * @param {Rivet.group.GetProfileRequest} request + * @param {RivetClient.group.GetProfileRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.getProfile("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1709,9 +1709,9 @@ export class Group { */ public async getProfile( groupId: string, - request: Rivet.group.GetProfileRequest = {}, + request: RivetClient.group.GetProfileRequest = {}, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -1720,7 +1720,7 @@ export class Group { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/profile` ), method: "GET", @@ -1750,7 +1750,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1760,7 +1760,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1770,7 +1770,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1780,7 +1780,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1790,7 +1790,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1800,7 +1800,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1810,7 +1810,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1819,14 +1819,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1834,15 +1834,15 @@ export class Group { /** * @param {string} groupId - * @param {Rivet.group.UpdateProfileRequest} request + * @param {RivetClient.group.UpdateProfileRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.updateProfile("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -1853,12 +1853,12 @@ export class Group { */ public async updateProfile( groupId: string, - request: Rivet.group.UpdateProfileRequest, + request: RivetClient.group.UpdateProfileRequest, requestOptions?: Group.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/profile` ), method: "POST", @@ -1882,7 +1882,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1892,7 +1892,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1902,7 +1902,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1912,7 +1912,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1922,7 +1922,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1932,7 +1932,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1942,7 +1942,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1951,14 +1951,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1968,12 +1968,12 @@ export class Group { * @param {string} groupId * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.getSummary("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1981,10 +1981,10 @@ export class Group { public async getSummary( groupId: string, requestOptions?: Group.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/summary` ), method: "GET", @@ -2013,7 +2013,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2023,7 +2023,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2033,7 +2033,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2043,7 +2043,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2053,7 +2053,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2063,7 +2063,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2073,7 +2073,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2082,14 +2082,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -2099,15 +2099,15 @@ export class Group { * Transfers ownership of a group to another identity. * * @param {string} groupId - * @param {Rivet.group.TransferOwnershipRequest} request + * @param {RivetClient.group.TransferOwnershipRequest} request * @param {Group.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.transferOwnership("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -2116,12 +2116,12 @@ export class Group { */ public async transferOwnership( groupId: string, - request: Rivet.group.TransferOwnershipRequest, + request: RivetClient.group.TransferOwnershipRequest, requestOptions?: Group.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/transfer-owner` ), method: "POST", @@ -2145,7 +2145,7 @@ export class Group { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2155,7 +2155,7 @@ export class Group { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2165,7 +2165,7 @@ export class Group { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2175,7 +2175,7 @@ export class Group { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2185,7 +2185,7 @@ export class Group { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2195,7 +2195,7 @@ export class Group { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2205,7 +2205,7 @@ export class Group { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2214,14 +2214,14 @@ export class Group { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/group/resources/invites/client/Client.ts b/sdks/api/full/typescript/src/api/resources/group/resources/invites/client/Client.ts index d1d9c7bcbe..4be651ecf9 100644 --- a/sdks/api/full/typescript/src/api/resources/group/resources/invites/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/group/resources/invites/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Invites { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Invites { * @param {string} groupInviteCode - Provided by `rivet.api.group#CreateInviteResponse$code`. * @param {Invites.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.invites.getInvite("string") @@ -48,10 +48,10 @@ export class Invites { public async getInvite( groupInviteCode: string, requestOptions?: Invites.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/invites/${encodeURIComponent(groupInviteCode)}` ), method: "GET", @@ -80,7 +80,7 @@ export class Invites { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Invites { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Invites { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Invites { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Invites { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Invites { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Invites { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Invites { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -168,12 +168,12 @@ export class Invites { * @param {string} groupInviteCode - Provided by `rivet.api.group#CreateInviteResponse$code`. * @param {Invites.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.invites.consumeInvite("string") @@ -181,10 +181,10 @@ export class Invites { public async consumeInvite( groupInviteCode: string, requestOptions?: Invites.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/invites/${encodeURIComponent(groupInviteCode)}/consume` ), method: "POST", @@ -213,7 +213,7 @@ export class Invites { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -223,7 +223,7 @@ export class Invites { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -233,7 +233,7 @@ export class Invites { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -243,7 +243,7 @@ export class Invites { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -253,7 +253,7 @@ export class Invites { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -263,7 +263,7 @@ export class Invites { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -273,7 +273,7 @@ export class Invites { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -282,14 +282,14 @@ export class Invites { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -299,15 +299,15 @@ export class Invites { * Creates a group invite. Can be shared with other identities to let them join this group. * * @param {string} groupId - * @param {Rivet.group.CreateInviteRequest} request + * @param {RivetClient.group.CreateInviteRequest} request * @param {Invites.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.invites.createInvite("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -317,12 +317,12 @@ export class Invites { */ public async createInvite( groupId: string, - request: Rivet.group.CreateInviteRequest, + request: RivetClient.group.CreateInviteRequest, requestOptions?: Invites.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/invites` ), method: "POST", @@ -352,7 +352,7 @@ export class Invites { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -362,7 +362,7 @@ export class Invites { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -372,7 +372,7 @@ export class Invites { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -382,7 +382,7 @@ export class Invites { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -392,7 +392,7 @@ export class Invites { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -402,7 +402,7 @@ export class Invites { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -412,7 +412,7 @@ export class Invites { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -421,14 +421,14 @@ export class Invites { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/group/resources/joinRequests/client/Client.ts b/sdks/api/full/typescript/src/api/resources/group/resources/joinRequests/client/Client.ts index eb858e1592..286ba24b72 100644 --- a/sdks/api/full/typescript/src/api/resources/group/resources/joinRequests/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/group/resources/joinRequests/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; export declare namespace JoinRequests { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class JoinRequests { * @param {string} groupId * @param {JoinRequests.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.joinRequests.createJoinRequest("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,7 +48,7 @@ export class JoinRequests { public async createJoinRequest(groupId: string, requestOptions?: JoinRequests.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/join-request` ), method: "POST", @@ -71,7 +71,7 @@ export class JoinRequests { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -81,7 +81,7 @@ export class JoinRequests { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -91,7 +91,7 @@ export class JoinRequests { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class JoinRequests { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class JoinRequests { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class JoinRequests { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class JoinRequests { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -140,14 +140,14 @@ export class JoinRequests { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -158,15 +158,15 @@ export class JoinRequests { * * @param {string} groupId * @param {string} identityId - * @param {Rivet.group.ResolveJoinRequestRequest} request + * @param {RivetClient.group.ResolveJoinRequestRequest} request * @param {JoinRequests.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.group.joinRequests.resolveJoinRequest("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -176,12 +176,12 @@ export class JoinRequests { public async resolveJoinRequest( groupId: string, identityId: string, - request: Rivet.group.ResolveJoinRequestRequest, + request: RivetClient.group.ResolveJoinRequestRequest, requestOptions?: JoinRequests.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/group/groups/${encodeURIComponent(groupId)}/join-request/${encodeURIComponent(identityId)}` ), method: "POST", @@ -205,7 +205,7 @@ export class JoinRequests { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -215,7 +215,7 @@ export class JoinRequests { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -225,7 +225,7 @@ export class JoinRequests { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -235,7 +235,7 @@ export class JoinRequests { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -245,7 +245,7 @@ export class JoinRequests { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -255,7 +255,7 @@ export class JoinRequests { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -265,7 +265,7 @@ export class JoinRequests { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -274,14 +274,14 @@ export class JoinRequests { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/Client.ts b/sdks/api/full/typescript/src/api/resources/identity/client/Client.ts index d0663c55d9..71db47ce8c 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import * as serializers from "../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../errors/index"; @@ -13,7 +13,7 @@ import { Events } from "../resources/events/client/Client"; export declare namespace Identity { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -40,15 +40,15 @@ export class Identity { * 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. * - * @param {Rivet.identity.SetupRequest} request + * @param {RivetClient.identity.SetupRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.setup({ @@ -56,12 +56,12 @@ export class Identity { * }) */ public async setup( - request: Rivet.identity.SetupRequest = {}, + request: RivetClient.identity.SetupRequest = {}, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities" ), method: "POST", @@ -91,7 +91,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -141,7 +141,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -151,7 +151,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -160,14 +160,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -177,15 +177,15 @@ export class Identity { * Fetches an identity profile. * * @param {string} identityId - * @param {Rivet.identity.GetProfileRequest} request + * @param {RivetClient.identity.GetProfileRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.getProfile("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -194,9 +194,9 @@ export class Identity { */ public async getProfile( identityId: string, - request: Rivet.identity.GetProfileRequest = {}, + request: RivetClient.identity.GetProfileRequest = {}, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -205,7 +205,7 @@ export class Identity { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/identity/identities/${encodeURIComponent(identityId)}/profile` ), method: "GET", @@ -235,7 +235,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -245,7 +245,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -255,7 +255,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -265,7 +265,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -275,7 +275,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -285,7 +285,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -295,7 +295,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -304,14 +304,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -320,15 +320,15 @@ export class Identity { /** * Fetches the current identity's profile. * - * @param {Rivet.identity.GetSelfProfileRequest} request + * @param {RivetClient.identity.GetSelfProfileRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.getSelfProfile({ @@ -336,9 +336,9 @@ export class Identity { * }) */ public async getSelfProfile( - request: Rivet.identity.GetSelfProfileRequest = {}, + request: RivetClient.identity.GetSelfProfileRequest = {}, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -347,7 +347,7 @@ export class Identity { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/profile" ), method: "GET", @@ -377,7 +377,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -387,7 +387,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -397,7 +397,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -407,7 +407,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -417,7 +417,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -427,7 +427,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -437,7 +437,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -446,14 +446,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -462,15 +462,15 @@ export class Identity { /** * Fetches a list of identity handles. * - * @param {Rivet.identity.GetHandlesRequest} request + * @param {RivetClient.identity.GetHandlesRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.getHandles({ @@ -478,9 +478,9 @@ export class Identity { * }) */ public async getHandles( - request: Rivet.identity.GetHandlesRequest, + request: RivetClient.identity.GetHandlesRequest, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const { identityIds } = request; const _queryParams: Record = {}; if (Array.isArray(identityIds)) { @@ -491,7 +491,7 @@ export class Identity { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/batch/handle" ), method: "GET", @@ -521,7 +521,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -531,7 +531,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -541,7 +541,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -551,7 +551,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -561,7 +561,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -571,7 +571,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -581,7 +581,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -590,14 +590,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -606,15 +606,15 @@ export class Identity { /** * Fetches a list of identity summaries. * - * @param {Rivet.identity.GetSummariesRequest} request + * @param {RivetClient.identity.GetSummariesRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.getSummaries({ @@ -622,9 +622,9 @@ export class Identity { * }) */ public async getSummaries( - request: Rivet.identity.GetSummariesRequest, + request: RivetClient.identity.GetSummariesRequest, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const { identityIds } = request; const _queryParams: Record = {}; if (Array.isArray(identityIds)) { @@ -635,7 +635,7 @@ export class Identity { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/batch/summary" ), method: "GET", @@ -665,7 +665,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -675,7 +675,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -685,7 +685,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -695,7 +695,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -705,7 +705,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -715,7 +715,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -725,7 +725,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -734,14 +734,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -750,15 +750,15 @@ export class Identity { /** * Updates profile of the current identity. * - * @param {Rivet.identity.UpdateProfileRequest} request + * @param {RivetClient.identity.UpdateProfileRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.updateProfile({ @@ -768,12 +768,12 @@ export class Identity { * }) */ public async updateProfile( - request: Rivet.identity.UpdateProfileRequest = {}, + request: RivetClient.identity.UpdateProfileRequest = {}, requestOptions?: Identity.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/profile" ), method: "POST", @@ -797,7 +797,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -807,7 +807,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -817,7 +817,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -827,7 +827,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -837,7 +837,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -847,7 +847,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -857,7 +857,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -866,14 +866,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -882,15 +882,15 @@ export class Identity { /** * Validate contents of identity profile. Use to provide immediate feedback on profile changes before committing them. * - * @param {Rivet.identity.ValidateProfileRequest} request + * @param {RivetClient.identity.ValidateProfileRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.validateProfile({ @@ -900,12 +900,12 @@ export class Identity { * }) */ public async validateProfile( - request: Rivet.identity.ValidateProfileRequest = {}, + request: RivetClient.identity.ValidateProfileRequest = {}, requestOptions?: Identity.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/profile/validate" ), method: "POST", @@ -929,7 +929,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -939,7 +939,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -949,7 +949,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -959,7 +959,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -969,7 +969,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -979,7 +979,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -989,7 +989,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -998,14 +998,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1014,15 +1014,15 @@ export class Identity { /** * Sets the current identity's game activity. This activity will automatically be removed when the identity goes offline. * - * @param {Rivet.identity.SetGameActivityRequest} request + * @param {RivetClient.identity.SetGameActivityRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.setGameActivity({ @@ -1038,12 +1038,12 @@ export class Identity { * }) */ public async setGameActivity( - request: Rivet.identity.SetGameActivityRequest, + request: RivetClient.identity.SetGameActivityRequest, requestOptions?: Identity.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/activity" ), method: "POST", @@ -1067,7 +1067,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1077,7 +1077,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1087,7 +1087,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1097,7 +1097,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1107,7 +1107,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1117,7 +1117,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1127,7 +1127,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1136,14 +1136,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1154,12 +1154,12 @@ export class Identity { * * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.removeGameActivity() @@ -1167,7 +1167,7 @@ export class Identity { public async removeGameActivity(requestOptions?: Identity.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/activity" ), method: "DELETE", @@ -1190,7 +1190,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1200,7 +1200,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1210,7 +1210,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1220,7 +1220,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1230,7 +1230,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1240,7 +1240,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1250,7 +1250,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1259,14 +1259,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1275,15 +1275,15 @@ export class Identity { /** * Updates the current identity's status. * - * @param {Rivet.identity.UpdateStatusRequest} request + * @param {RivetClient.identity.UpdateStatusRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.updateStatus({ @@ -1291,12 +1291,12 @@ export class Identity { * }) */ public async updateStatus( - request: Rivet.identity.UpdateStatusRequest, + request: RivetClient.identity.UpdateStatusRequest, requestOptions?: Identity.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/identities/self/status" ), method: "POST", @@ -1320,7 +1320,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1330,7 +1330,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1340,7 +1340,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1350,7 +1350,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1360,7 +1360,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1370,7 +1370,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1380,7 +1380,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1389,14 +1389,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1405,15 +1405,15 @@ export class Identity { /** * Prepares an avatar image upload. Complete upload with `CompleteIdentityAvatarUpload`. * - * @param {Rivet.identity.PrepareAvatarUploadRequest} request + * @param {RivetClient.identity.PrepareAvatarUploadRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.prepareAvatarUpload({ @@ -1423,12 +1423,12 @@ export class Identity { * }) */ public async prepareAvatarUpload( - request: Rivet.identity.PrepareAvatarUploadRequest, + request: RivetClient.identity.PrepareAvatarUploadRequest, requestOptions?: Identity.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/avatar-upload/prepare" ), method: "POST", @@ -1460,7 +1460,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1470,7 +1470,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1480,7 +1480,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1490,7 +1490,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1500,7 +1500,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1510,7 +1510,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1520,7 +1520,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1529,14 +1529,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1548,12 +1548,12 @@ export class Identity { * @param {string} uploadId * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.completeAvatarUpload("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -1561,7 +1561,7 @@ export class Identity { public async completeAvatarUpload(uploadId: string, requestOptions?: Identity.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/identity/identities/avatar-upload/${encodeURIComponent(uploadId)}/complete` ), method: "POST", @@ -1584,7 +1584,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1594,7 +1594,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1604,7 +1604,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1614,7 +1614,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1624,7 +1624,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1634,7 +1634,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1644,7 +1644,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1653,14 +1653,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1669,15 +1669,15 @@ export class Identity { /** * Completes an avatar image upload. Must be called after the file upload process completes. * - * @param {Rivet.identity.SignupForBetaRequest} request + * @param {RivetClient.identity.SignupForBetaRequest} request * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.signupForBeta({ @@ -1689,12 +1689,12 @@ export class Identity { * }) */ public async signupForBeta( - request: Rivet.identity.SignupForBetaRequest, + request: RivetClient.identity.SignupForBetaRequest, requestOptions?: Identity.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/beta-signup" ), method: "POST", @@ -1718,7 +1718,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1728,7 +1728,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1738,7 +1738,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1748,7 +1748,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1758,7 +1758,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1768,7 +1768,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1778,7 +1778,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1787,14 +1787,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1803,12 +1803,12 @@ export class Identity { /** * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.markDeletion() @@ -1816,7 +1816,7 @@ export class Identity { public async markDeletion(requestOptions?: Identity.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/delete-request" ), method: "POST", @@ -1839,7 +1839,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1849,7 +1849,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1859,7 +1859,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1869,7 +1869,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1879,7 +1879,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1889,7 +1889,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1899,7 +1899,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1908,14 +1908,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1924,12 +1924,12 @@ export class Identity { /** * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.unmarkDeletion() @@ -1937,7 +1937,7 @@ export class Identity { public async unmarkDeletion(requestOptions?: Identity.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/identities/self/delete-request" ), method: "DELETE", @@ -1960,7 +1960,7 @@ export class Identity { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1970,7 +1970,7 @@ export class Identity { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1980,7 +1980,7 @@ export class Identity { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1990,7 +1990,7 @@ export class Identity { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2000,7 +2000,7 @@ export class Identity { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2010,7 +2010,7 @@ export class Identity { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -2020,7 +2020,7 @@ export class Identity { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -2029,14 +2029,14 @@ export class Identity { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetProfileRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetProfileRequest.ts index 2dbd92a507..a7b43d57ea 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetProfileRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetProfileRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../index"; * } */ export interface GetProfileRequest { - watchIndex?: Rivet.WatchQuery; + watchIndex?: RivetClient.WatchQuery; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetSelfProfileRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetSelfProfileRequest.ts index 5a65e2ed33..5e07562351 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetSelfProfileRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/GetSelfProfileRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../index"; * } */ export interface GetSelfProfileRequest { - watchIndex?: Rivet.WatchQuery; + watchIndex?: RivetClient.WatchQuery; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetGameActivityRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetGameActivityRequest.ts index e587527e55..d7ab97409a 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetGameActivityRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetGameActivityRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -19,5 +19,5 @@ import * as Rivet from "../../../../index"; * } */ export interface SetGameActivityRequest { - gameActivity: Rivet.identity.UpdateGameActivity; + gameActivity: RivetClient.identity.UpdateGameActivity; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetupRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetupRequest.ts index 681abff0f8..54ec883369 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetupRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/SetupRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../index"; * } */ export interface SetupRequest { - existingIdentityToken?: Rivet.Jwt; + existingIdentityToken?: RivetClient.Jwt; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateProfileRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateProfileRequest.ts index b638183f9f..04eb497642 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateProfileRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateProfileRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -13,7 +13,7 @@ import * as Rivet from "../../../../index"; * } */ export interface UpdateProfileRequest { - displayName?: Rivet.DisplayName; - accountNumber?: Rivet.AccountNumber; - bio?: Rivet.Bio; + displayName?: RivetClient.DisplayName; + accountNumber?: RivetClient.AccountNumber; + bio?: RivetClient.Bio; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateStatusRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateStatusRequest.ts index 109cfb619d..f4d8c2d5a7 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateStatusRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/UpdateStatusRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../index"; * } */ export interface UpdateStatusRequest { - status: Rivet.identity.Status; + status: RivetClient.identity.Status; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/client/requests/ValidateProfileRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/client/requests/ValidateProfileRequest.ts index 8e667267ea..5e953a8588 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/client/requests/ValidateProfileRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/client/requests/ValidateProfileRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -13,7 +13,7 @@ import * as Rivet from "../../../../index"; * } */ export interface ValidateProfileRequest { - displayName?: Rivet.DisplayName; - accountNumber?: Rivet.AccountNumber; - bio?: Rivet.Bio; + displayName?: RivetClient.DisplayName; + accountNumber?: RivetClient.AccountNumber; + bio?: RivetClient.Bio; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/Client.ts b/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/Client.ts index 101379bdf4..4e298c7f06 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Activities { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,15 +32,15 @@ export class Activities { /** * Returns an overview of all players currently online or in game. * - * @param {Rivet.identity.ListActivitiesRequest} request + * @param {RivetClient.identity.ListActivitiesRequest} request * @param {Activities.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.activities.list({ @@ -48,9 +48,9 @@ export class Activities { * }) */ public async list( - request: Rivet.identity.ListActivitiesRequest = {}, + request: RivetClient.identity.ListActivitiesRequest = {}, requestOptions?: Activities.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -59,7 +59,7 @@ export class Activities { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/activities" ), method: "GET", @@ -89,7 +89,7 @@ export class Activities { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -99,7 +99,7 @@ export class Activities { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Activities { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Activities { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Activities { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Activities { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Activities { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -158,14 +158,14 @@ export class Activities { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/requests/ListActivitiesRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/requests/ListActivitiesRequest.ts index 29062a8142..785eb665b0 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/requests/ListActivitiesRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/resources/activities/client/requests/ListActivitiesRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../../../index"; * } */ export interface ListActivitiesRequest { - watchIndex?: Rivet.WatchQuery; + watchIndex?: RivetClient.WatchQuery; } diff --git a/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/Client.ts b/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/Client.ts index 89e6f66598..d014076410 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Events { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,15 +32,15 @@ export class Events { /** * Returns all events relative to the current identity. * - * @param {Rivet.identity.WatchEventsRequest} request + * @param {RivetClient.identity.WatchEventsRequest} request * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.identity.events.watch({ @@ -48,9 +48,9 @@ export class Events { * }) */ public async watch( - request: Rivet.identity.WatchEventsRequest = {}, + request: RivetClient.identity.WatchEventsRequest = {}, requestOptions?: Events.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -59,7 +59,7 @@ export class Events { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/identity/events/live" ), method: "GET", @@ -89,7 +89,7 @@ export class Events { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -99,7 +99,7 @@ export class Events { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Events { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Events { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Events { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Events { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Events { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -158,14 +158,14 @@ export class Events { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/requests/WatchEventsRequest.ts b/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/requests/WatchEventsRequest.ts index 99eb2b3e29..5234e2ee06 100644 --- a/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/requests/WatchEventsRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/identity/resources/events/client/requests/WatchEventsRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -11,5 +11,5 @@ import * as Rivet from "../../../../../../index"; * } */ export interface WatchEventsRequest { - watchIndex?: Rivet.WatchQuery; + watchIndex?: RivetClient.WatchQuery; } diff --git a/sdks/api/full/typescript/src/api/resources/job/client/Client.ts b/sdks/api/full/typescript/src/api/resources/job/client/Client.ts index bc58c7f954..0ff5f5a4e5 100644 --- a/sdks/api/full/typescript/src/api/resources/job/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/job/client/Client.ts @@ -8,7 +8,7 @@ import { Run } from "../resources/run/client/Client"; export declare namespace Job { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/job/resources/run/client/Client.ts b/sdks/api/full/typescript/src/api/resources/job/resources/run/client/Client.ts index 213c2d8a74..9c92cfbf3f 100644 --- a/sdks/api/full/typescript/src/api/resources/job/resources/run/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/job/resources/run/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; export declare namespace Run { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -32,12 +32,12 @@ export class Run { /** * @param {Run.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.job.run.cleanup() @@ -45,7 +45,7 @@ export class Run { public async cleanup(requestOptions?: Run.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/job/runs/cleanup" ), method: "POST", @@ -68,7 +68,7 @@ export class Run { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -78,7 +78,7 @@ export class Run { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -88,7 +88,7 @@ export class Run { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -98,7 +98,7 @@ export class Run { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -108,7 +108,7 @@ export class Run { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -118,7 +118,7 @@ export class Run { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -128,7 +128,7 @@ export class Run { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -137,14 +137,14 @@ export class Run { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/client/Client.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/client/Client.ts index 9fedc06a1a..feb194bb90 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/client/Client.ts @@ -10,7 +10,7 @@ import { Regions } from "../resources/regions/client/Client"; export declare namespace Matchmaker { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/Client.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/Client.ts index ecefa8b54a..3a483cbf64 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; export declare namespace Lobbies { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,12 +35,12 @@ export class Lobbies { * * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.ready() @@ -48,7 +48,7 @@ export class Lobbies { public async ready(requestOptions?: Lobbies.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/ready" ), method: "POST", @@ -71,7 +71,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -81,7 +81,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -91,7 +91,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -140,14 +140,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -164,15 +164,15 @@ export class Lobbies { * 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. * - * @param {Rivet.matchmaker.SetLobbyClosedRequest} request + * @param {RivetClient.matchmaker.SetLobbyClosedRequest} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.setClosed({ @@ -180,12 +180,12 @@ export class Lobbies { * }) */ public async setClosed( - request: Rivet.matchmaker.SetLobbyClosedRequest, + request: RivetClient.matchmaker.SetLobbyClosedRequest, requestOptions?: Lobbies.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/closed" ), method: "PUT", @@ -211,7 +211,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -221,7 +221,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -231,7 +231,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -241,7 +241,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -251,7 +251,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -261,7 +261,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -271,7 +271,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -280,14 +280,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -304,12 +304,12 @@ export class Lobbies { * @param {unknown} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.setState({ @@ -319,7 +319,7 @@ export class Lobbies { public async setState(request?: unknown, requestOptions?: Lobbies.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/state" ), method: "PUT", @@ -348,7 +348,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -358,7 +358,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -368,7 +368,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -378,7 +378,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -388,7 +388,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -398,7 +398,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -408,7 +408,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -417,14 +417,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -441,12 +441,12 @@ export class Lobbies { * @param {string} lobbyId * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.getState("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -454,7 +454,7 @@ export class Lobbies { public async getState(lobbyId: string, requestOptions?: Lobbies.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/matchmaker/lobbies/${encodeURIComponent(lobbyId)}/state` ), method: "GET", @@ -483,7 +483,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -493,7 +493,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -503,7 +503,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -513,7 +513,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -523,7 +523,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -533,7 +533,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -543,7 +543,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -552,14 +552,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -576,15 +576,15 @@ export class Lobbies { * for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) * can be used for general authentication. * - * @param {Rivet.matchmaker.FindLobbyRequest} request + * @param {RivetClient.matchmaker.FindLobbyRequest} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.find({ @@ -610,13 +610,13 @@ export class Lobbies { * }) */ public async find( - request: Rivet.matchmaker.FindLobbyRequest, + request: RivetClient.matchmaker.FindLobbyRequest, requestOptions?: Lobbies.RequestOptions - ): Promise { + ): Promise { const { origin, ..._body } = request; const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/find" ), method: "POST", @@ -647,7 +647,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -657,7 +657,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -667,7 +667,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -677,7 +677,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -687,7 +687,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -697,7 +697,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -707,7 +707,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -716,14 +716,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -740,15 +740,15 @@ export class Lobbies { * for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) * can be used for general authentication. * - * @param {Rivet.matchmaker.JoinLobbyRequest} request + * @param {RivetClient.matchmaker.JoinLobbyRequest} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.join({ @@ -767,12 +767,12 @@ export class Lobbies { * }) */ public async join( - request: Rivet.matchmaker.JoinLobbyRequest, + request: RivetClient.matchmaker.JoinLobbyRequest, requestOptions?: Lobbies.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/join" ), method: "POST", @@ -802,7 +802,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -812,7 +812,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -822,7 +822,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -832,7 +832,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -842,7 +842,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -852,7 +852,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -862,7 +862,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -871,14 +871,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -893,15 +893,15 @@ export class Lobbies { * for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) * can be used for general authentication. * - * @param {Rivet.matchmaker.CreateLobbyRequest} request + * @param {RivetClient.matchmaker.CreateLobbyRequest} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.create({ @@ -929,12 +929,12 @@ export class Lobbies { * }) */ public async create( - request: Rivet.matchmaker.CreateLobbyRequest, + request: RivetClient.matchmaker.CreateLobbyRequest, requestOptions?: Lobbies.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/create" ), method: "POST", @@ -964,7 +964,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -974,7 +974,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -984,7 +984,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -994,7 +994,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1004,7 +1004,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1014,7 +1014,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1024,7 +1024,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1033,14 +1033,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -1055,15 +1055,15 @@ export class Lobbies { * for mock responses and a [public namespace token](/docs/general/concepts/token-types#namespace-public) * can be used for general authentication. * - * @param {Rivet.matchmaker.ListLobbiesRequest} request + * @param {RivetClient.matchmaker.ListLobbiesRequest} request * @param {Lobbies.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.lobbies.list({ @@ -1071,9 +1071,9 @@ export class Lobbies { * }) */ public async list( - request: Rivet.matchmaker.ListLobbiesRequest = {}, + request: RivetClient.matchmaker.ListLobbiesRequest = {}, requestOptions?: Lobbies.RequestOptions - ): Promise { + ): Promise { const { includeState } = request; const _queryParams: Record = {}; if (includeState != null) { @@ -1082,7 +1082,7 @@ export class Lobbies { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/lobbies/list" ), method: "GET", @@ -1112,7 +1112,7 @@ export class Lobbies { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1122,7 +1122,7 @@ export class Lobbies { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1132,7 +1132,7 @@ export class Lobbies { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1142,7 +1142,7 @@ export class Lobbies { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1152,7 +1152,7 @@ export class Lobbies { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1162,7 +1162,7 @@ export class Lobbies { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -1172,7 +1172,7 @@ export class Lobbies { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -1181,14 +1181,14 @@ export class Lobbies { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts index f4547feb13..da9c9ce54e 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -33,10 +33,10 @@ import * as Rivet from "../../../../../../index"; export interface CreateLobbyRequest { gameMode: string; region?: string; - publicity?: Rivet.matchmaker.CustomLobbyPublicity; + publicity?: RivetClient.matchmaker.CustomLobbyPublicity; tags?: Record; maxPlayers?: number; lobbyConfig?: unknown; - captcha?: Rivet.captcha.Config; + captcha?: RivetClient.captcha.Config; verificationData?: unknown; } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts index 729be8a158..ef1910e36d 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -35,6 +35,6 @@ export interface FindLobbyRequest { preventAutoCreateLobby?: boolean; tags?: Record; maxPlayers?: number; - captcha?: Rivet.captcha.Config; + captcha?: RivetClient.captcha.Config; verificationData?: unknown; } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts index a6efde4869..eecc12de1c 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -23,6 +23,6 @@ import * as Rivet from "../../../../../../index"; */ export interface JoinLobbyRequest { lobbyId: string; - captcha?: Rivet.captcha.Config; + captcha?: RivetClient.captcha.Config; verificationData?: unknown; } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/players/client/Client.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/players/client/Client.ts index 6e02861eee..3aa1a5cc93 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/players/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/players/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import * as serializers from "../../../../../../serialization/index"; import urlJoin from "url-join"; import * as errors from "../../../../../../errors/index"; export declare namespace Players { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -66,15 +66,15 @@ export class Players { * once the socket opens. As mentioned above, nothing else should happen until * the player token is validated. * - * @param {Rivet.matchmaker.PlayerConnectedRequest} request + * @param {RivetClient.matchmaker.PlayerConnectedRequest} request * @param {Players.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.players.connected({ @@ -82,12 +82,12 @@ export class Players { * }) */ public async connected( - request: Rivet.matchmaker.PlayerConnectedRequest, + request: RivetClient.matchmaker.PlayerConnectedRequest, requestOptions?: Players.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/players/connected" ), method: "POST", @@ -113,7 +113,7 @@ export class Players { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Players { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Players { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Players { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -153,7 +153,7 @@ export class Players { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -163,7 +163,7 @@ export class Players { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -173,7 +173,7 @@ export class Players { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -182,14 +182,14 @@ export class Players { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -198,15 +198,15 @@ export class Players { /** * 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. * - * @param {Rivet.matchmaker.PlayerDisconnectedRequest} request + * @param {RivetClient.matchmaker.PlayerDisconnectedRequest} request * @param {Players.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.players.disconnected({ @@ -214,12 +214,12 @@ export class Players { * }) */ public async disconnected( - request: Rivet.matchmaker.PlayerDisconnectedRequest, + request: RivetClient.matchmaker.PlayerDisconnectedRequest, requestOptions?: Players.RequestOptions ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/players/disconnected" ), method: "POST", @@ -245,7 +245,7 @@ export class Players { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -255,7 +255,7 @@ export class Players { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -265,7 +265,7 @@ export class Players { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -275,7 +275,7 @@ export class Players { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -285,7 +285,7 @@ export class Players { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -295,7 +295,7 @@ export class Players { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -305,7 +305,7 @@ export class Players { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -314,14 +314,14 @@ export class Players { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -332,22 +332,22 @@ export class Players { * * @param {Players.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.players.getStatistics() */ public async getStatistics( requestOptions?: Players.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/players/statistics" ), method: "GET", @@ -376,7 +376,7 @@ export class Players { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -386,7 +386,7 @@ export class Players { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -396,7 +396,7 @@ export class Players { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -406,7 +406,7 @@ export class Players { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -416,7 +416,7 @@ export class Players { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -426,7 +426,7 @@ export class Players { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -436,7 +436,7 @@ export class Players { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -445,14 +445,14 @@ export class Players { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/regions/client/Client.ts b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/regions/client/Client.ts index e18c001ea0..cf767d11a5 100644 --- a/sdks/api/full/typescript/src/api/resources/matchmaker/resources/regions/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/matchmaker/resources/regions/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Regions { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -36,20 +36,20 @@ export class Regions { * * @param {Regions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.matchmaker.regions.list() */ - public async list(requestOptions?: Regions.RequestOptions): Promise { + public async list(requestOptions?: Regions.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/matchmaker/regions" ), method: "GET", @@ -78,7 +78,7 @@ export class Regions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -88,7 +88,7 @@ export class Regions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -98,7 +98,7 @@ export class Regions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -108,7 +108,7 @@ export class Regions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -118,7 +118,7 @@ export class Regions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -128,7 +128,7 @@ export class Regions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -138,7 +138,7 @@ export class Regions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -147,14 +147,14 @@ export class Regions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/portal/client/Client.ts b/sdks/api/full/typescript/src/api/resources/portal/client/Client.ts index 4c4d214da8..709ea15ad1 100644 --- a/sdks/api/full/typescript/src/api/resources/portal/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/portal/client/Client.ts @@ -8,7 +8,7 @@ import { Games } from "../resources/games/client/Client"; export declare namespace Portal { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/portal/resources/games/client/Client.ts b/sdks/api/full/typescript/src/api/resources/portal/resources/games/client/Client.ts index 0601a3a2e3..fc5ea704f3 100644 --- a/sdks/api/full/typescript/src/api/resources/portal/resources/games/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/portal/resources/games/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Games { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Games { * Returns a game profile. * * @param {string} gameNameId - 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. - * @param {Rivet.portal.GetGameProfileRequest} request + * @param {RivetClient.portal.GetGameProfileRequest} request * @param {Games.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.portal.games.getGameProfile("string", { @@ -50,9 +50,9 @@ export class Games { */ public async getGameProfile( gameNameId: string, - request: Rivet.portal.GetGameProfileRequest = {}, + request: RivetClient.portal.GetGameProfileRequest = {}, requestOptions?: Games.RequestOptions - ): Promise { + ): Promise { const { watchIndex } = request; const _queryParams: Record = {}; if (watchIndex != null) { @@ -61,7 +61,7 @@ export class Games { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/portal/games/${encodeURIComponent(gameNameId)}/profile` ), method: "GET", @@ -91,7 +91,7 @@ export class Games { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -101,7 +101,7 @@ export class Games { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -111,7 +111,7 @@ export class Games { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -121,7 +121,7 @@ export class Games { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -131,7 +131,7 @@ export class Games { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -141,7 +141,7 @@ export class Games { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -151,7 +151,7 @@ export class Games { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -160,14 +160,14 @@ export class Games { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/provision/client/Client.ts b/sdks/api/full/typescript/src/api/resources/provision/client/Client.ts index 74a5c0b069..c43ac4c045 100644 --- a/sdks/api/full/typescript/src/api/resources/provision/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/provision/client/Client.ts @@ -9,7 +9,7 @@ import { Servers } from "../resources/servers/client/Client"; export declare namespace Provision { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } diff --git a/sdks/api/full/typescript/src/api/resources/provision/resources/datacenters/client/Client.ts b/sdks/api/full/typescript/src/api/resources/provision/resources/datacenters/client/Client.ts index 5f5ee7a1db..16d9010c7f 100644 --- a/sdks/api/full/typescript/src/api/resources/provision/resources/datacenters/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/provision/resources/datacenters/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Datacenters { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,12 +33,12 @@ export class Datacenters { * @param {string} datacenterId * @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.provision.datacenters.getTls("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -46,10 +46,10 @@ export class Datacenters { public async getTls( datacenterId: string, requestOptions?: Datacenters.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/datacenters/${encodeURIComponent(datacenterId)}/tls` ), method: "GET", @@ -78,7 +78,7 @@ export class Datacenters { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -88,7 +88,7 @@ export class Datacenters { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -98,7 +98,7 @@ export class Datacenters { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -108,7 +108,7 @@ export class Datacenters { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -118,7 +118,7 @@ export class Datacenters { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -128,7 +128,7 @@ export class Datacenters { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -138,7 +138,7 @@ export class Datacenters { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -147,14 +147,14 @@ export class Datacenters { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -164,12 +164,12 @@ export class Datacenters { * @param {string} datacenterId * @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.provision.datacenters.getServers("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -177,10 +177,10 @@ export class Datacenters { public async getServers( datacenterId: string, requestOptions?: Datacenters.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/datacenters/${encodeURIComponent(datacenterId)}/servers` ), method: "GET", @@ -209,7 +209,7 @@ export class Datacenters { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -219,7 +219,7 @@ export class Datacenters { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -229,7 +229,7 @@ export class Datacenters { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -239,7 +239,7 @@ export class Datacenters { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -249,7 +249,7 @@ export class Datacenters { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -259,7 +259,7 @@ export class Datacenters { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -269,7 +269,7 @@ export class Datacenters { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -278,14 +278,14 @@ export class Datacenters { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/provision/resources/servers/client/Client.ts b/sdks/api/full/typescript/src/api/resources/provision/resources/servers/client/Client.ts index 893da771a9..865fe59e1d 100644 --- a/sdks/api/full/typescript/src/api/resources/provision/resources/servers/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/provision/resources/servers/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Servers { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,12 +33,12 @@ export class Servers { * @param {string} ip * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.provision.servers.getInfo("string") @@ -46,10 +46,10 @@ export class Servers { public async getInfo( ip: 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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/servers/${encodeURIComponent(ip)}` ), method: "GET", @@ -78,7 +78,7 @@ export class Servers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -88,7 +88,7 @@ export class Servers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -98,7 +98,7 @@ export class Servers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -108,7 +108,7 @@ export class Servers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -118,7 +118,7 @@ export class Servers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -128,7 +128,7 @@ export class Servers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -138,7 +138,7 @@ export class Servers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -147,14 +147,14 @@ export class Servers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/servers/client/Client.ts b/sdks/api/full/typescript/src/api/resources/servers/client/Client.ts index 179d952b64..78bf55a673 100644 --- a/sdks/api/full/typescript/src/api/resources/servers/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/servers/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; @@ -14,7 +14,7 @@ import { Logs } from "../resources/logs/client/Client"; export declare namespace Servers { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -40,12 +40,12 @@ export class Servers { * @param {string} serverId - The id of the server to destroy * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -55,10 +55,10 @@ export class Servers { environmentId: 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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/servers/${encodeURIComponent(serverId)}` @@ -89,7 +89,7 @@ export class Servers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -99,7 +99,7 @@ export class Servers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Servers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Servers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Servers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Servers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Servers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -158,14 +158,14 @@ export class Servers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -176,15 +176,15 @@ export class Servers { * * @param {string} gameId * @param {string} environmentId - * @param {Rivet.servers.GetServersRequest} request + * @param {RivetClient.servers.GetServersRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.list("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -196,9 +196,9 @@ export class Servers { public async list( gameId: string, environmentId: string, - request: Rivet.servers.GetServersRequest = {}, + request: RivetClient.servers.GetServersRequest = {}, requestOptions?: Servers.RequestOptions - ): Promise { + ): Promise { const { tagsJson, includeDestroyed, cursor } = request; const _queryParams: Record = {}; if (tagsJson != null) { @@ -215,7 +215,7 @@ export class Servers { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/servers` ), method: "GET", @@ -245,7 +245,7 @@ export class Servers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -255,7 +255,7 @@ export class Servers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -265,7 +265,7 @@ export class Servers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -275,7 +275,7 @@ export class Servers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -285,7 +285,7 @@ export class Servers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -295,7 +295,7 @@ export class Servers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -305,7 +305,7 @@ export class Servers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -314,14 +314,14 @@ export class Servers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -332,15 +332,15 @@ export class Servers { * * @param {string} gameId * @param {string} environmentId - * @param {Rivet.servers.CreateServerRequest} request + * @param {RivetClient.servers.CreateServerRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.create("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -380,12 +380,12 @@ export class Servers { public async create( gameId: string, environmentId: string, - request: Rivet.servers.CreateServerRequest, + request: RivetClient.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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/servers` ), method: "POST", @@ -415,7 +415,7 @@ export class Servers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -425,7 +425,7 @@ export class Servers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -435,7 +435,7 @@ export class Servers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -445,7 +445,7 @@ export class Servers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -455,7 +455,7 @@ export class Servers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -465,7 +465,7 @@ export class Servers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -475,7 +475,7 @@ export class Servers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -484,14 +484,14 @@ export class Servers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -503,15 +503,15 @@ export class Servers { * @param {string} gameId * @param {string} environmentId * @param {string} serverId - The id of the server to destroy - * @param {Rivet.servers.DestroyServerRequest} request + * @param {RivetClient.servers.DestroyServerRequest} request * @param {Servers.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.destroy("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -522,9 +522,9 @@ export class Servers { gameId: string, environmentId: string, serverId: string, - request: Rivet.servers.DestroyServerRequest = {}, + request: RivetClient.servers.DestroyServerRequest = {}, requestOptions?: Servers.RequestOptions - ): Promise { + ): Promise { const { overrideKillTimeout } = request; const _queryParams: Record = {}; if (overrideKillTimeout != null) { @@ -533,7 +533,7 @@ export class Servers { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/servers/${encodeURIComponent(serverId)}` @@ -565,7 +565,7 @@ export class Servers { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -575,7 +575,7 @@ export class Servers { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -585,7 +585,7 @@ export class Servers { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -595,7 +595,7 @@ export class Servers { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -605,7 +605,7 @@ export class Servers { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -615,7 +615,7 @@ export class Servers { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -625,7 +625,7 @@ export class Servers { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -634,14 +634,14 @@ export class Servers { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts b/sdks/api/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts index 65dbd9dab9..1610321f33 100644 --- a/sdks/api/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/servers/resources/builds/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Builds { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,15 +35,15 @@ export class Builds { * @param {string} gameId * @param {string} environmentId * @param {string} buildId - * @param {Rivet.servers.GetBuildRequest} request + * @param {RivetClient.servers.GetBuildRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.builds.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -54,9 +54,9 @@ export class Builds { gameId: string, environmentId: string, buildId: string, - request: Rivet.servers.GetBuildRequest = {}, + request: RivetClient.servers.GetBuildRequest = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { tagsJson } = request; const _queryParams: Record = {}; if (tagsJson != null) { @@ -65,7 +65,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/builds/${encodeURIComponent(buildId)}` @@ -97,7 +97,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -107,7 +107,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -117,7 +117,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -127,7 +127,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -137,7 +137,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -147,7 +147,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -157,7 +157,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -166,14 +166,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -184,15 +184,15 @@ export class Builds { * * @param {string} gameId * @param {string} environmentId - * @param {Rivet.servers.ListBuildsRequest} request + * @param {RivetClient.servers.ListBuildsRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.builds.list("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -202,9 +202,9 @@ export class Builds { public async list( gameId: string, environmentId: string, - request: Rivet.servers.ListBuildsRequest = {}, + request: RivetClient.servers.ListBuildsRequest = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { tagsJson } = request; const _queryParams: Record = {}; if (tagsJson != null) { @@ -213,7 +213,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/builds` ), method: "GET", @@ -243,7 +243,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -253,7 +253,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -263,7 +263,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -273,7 +273,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -283,7 +283,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -293,7 +293,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -303,7 +303,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -312,14 +312,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -329,15 +329,15 @@ export class Builds { * @param {string} gameId * @param {string} environmentId * @param {string} buildId - * @param {Rivet.servers.PatchBuildTagsRequest} request + * @param {RivetClient.servers.PatchBuildTagsRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.builds.patchTags("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -351,12 +351,12 @@ export class Builds { gameId: string, environmentId: string, buildId: string, - request: Rivet.servers.PatchBuildTagsRequest, + request: RivetClient.servers.PatchBuildTagsRequest, 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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/builds/${encodeURIComponent(buildId)}/tags` @@ -388,7 +388,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -398,7 +398,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -408,7 +408,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -418,7 +418,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -428,7 +428,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -438,7 +438,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -448,7 +448,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -457,14 +457,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -475,15 +475,15 @@ export class Builds { * * @param {string} gameId * @param {string} environmentId - * @param {Rivet.servers.CreateBuildRequest} request + * @param {RivetClient.servers.CreateBuildRequest} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.builds.prepare("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -503,12 +503,12 @@ export class Builds { public async prepare( gameId: string, environmentId: string, - request: Rivet.servers.CreateBuildRequest, + request: RivetClient.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, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/builds/prepare` ), method: "POST", @@ -538,7 +538,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -548,7 +548,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -558,7 +558,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -568,7 +568,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -578,7 +578,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -588,7 +588,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -598,7 +598,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -607,14 +607,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -628,12 +628,12 @@ export class Builds { * @param {string} buildId * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.builds.complete("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -646,7 +646,7 @@ export class Builds { ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/builds/${encodeURIComponent(buildId)}/complete` @@ -671,7 +671,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -681,7 +681,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -691,7 +691,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -701,7 +701,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -711,7 +711,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -721,7 +721,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -731,7 +731,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -740,14 +740,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/servers/resources/datacenters/client/Client.ts b/sdks/api/full/typescript/src/api/resources/servers/resources/datacenters/client/Client.ts index 96c1a3cc4f..b77128957f 100644 --- a/sdks/api/full/typescript/src/api/resources/servers/resources/datacenters/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/servers/resources/datacenters/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Datacenters { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -34,12 +34,12 @@ export class Datacenters { * @param {string} environmentId * @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.datacenters.list("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") @@ -48,10 +48,10 @@ export class Datacenters { gameId: string, environmentId: string, requestOptions?: Datacenters.RequestOptions - ): Promise { + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent(environmentId)}/datacenters` ), method: "GET", @@ -80,7 +80,7 @@ export class Datacenters { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -90,7 +90,7 @@ export class Datacenters { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -100,7 +100,7 @@ export class Datacenters { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -110,7 +110,7 @@ export class Datacenters { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -120,7 +120,7 @@ export class Datacenters { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -130,7 +130,7 @@ export class Datacenters { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -140,7 +140,7 @@ export class Datacenters { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -149,14 +149,14 @@ export class Datacenters { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts b/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts index e29c33a09b..b6175edaba 100644 --- a/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts +++ b/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Logs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } @@ -35,15 +35,15 @@ export class Logs { * @param {string} gameId * @param {string} environmentId * @param {string} serverId - * @param {Rivet.servers.GetServerLogsRequest} request + * @param {RivetClient.servers.GetServerLogsRequest} request * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.servers.logs.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -55,9 +55,9 @@ export class Logs { gameId: string, environmentId: string, serverId: string, - request: Rivet.servers.GetServerLogsRequest, + request: RivetClient.servers.GetServerLogsRequest, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const { stream, watchIndex } = request; const _queryParams: Record = {}; _queryParams["stream"] = stream; @@ -67,7 +67,7 @@ export class Logs { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/games/${encodeURIComponent(gameId)}/environments/${encodeURIComponent( environmentId )}/servers/${encodeURIComponent(serverId)}/logs` @@ -99,7 +99,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -159,7 +159,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -168,14 +168,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts b/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts index 4585514678..9651657241 100644 --- a/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts +++ b/sdks/api/full/typescript/src/api/resources/servers/resources/logs/client/requests/GetServerLogsRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -12,7 +12,7 @@ import * as Rivet from "../../../../../../index"; * } */ export interface GetServerLogsRequest { - stream: Rivet.servers.LogStream; + stream: RivetClient.servers.LogStream; /** * A query parameter denoting the requests watch index. */ diff --git a/sdks/api/full/typescript/src/environments.ts b/sdks/api/full/typescript/src/environments.ts index a326fd6df4..0c0ad87a2a 100644 --- a/sdks/api/full/typescript/src/environments.ts +++ b/sdks/api/full/typescript/src/environments.ts @@ -2,8 +2,8 @@ * This file was auto-generated by Fern from our API Definition. */ -export const RivetEnvironment = { +export const RivetClientEnvironment = { Production: "https://api.rivet.gg", } as const; -export type RivetEnvironment = typeof RivetEnvironment.Production; +export type RivetClientEnvironment = typeof RivetClientEnvironment.Production; diff --git a/sdks/api/full/typescript/src/errors/RivetError.ts b/sdks/api/full/typescript/src/errors/RivetClientError.ts similarity index 89% rename from sdks/api/full/typescript/src/errors/RivetError.ts rename to sdks/api/full/typescript/src/errors/RivetClientError.ts index d9dce7d75c..1f26f73c1a 100644 --- a/sdks/api/full/typescript/src/errors/RivetError.ts +++ b/sdks/api/full/typescript/src/errors/RivetClientError.ts @@ -2,13 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -export class RivetError extends Error { +export class RivetClientError extends Error { readonly statusCode?: number; readonly body?: unknown; constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { super(buildMessage({ message, statusCode, body })); - Object.setPrototypeOf(this, RivetError.prototype); + Object.setPrototypeOf(this, RivetClientError.prototype); if (statusCode != null) { this.statusCode = statusCode; } diff --git a/sdks/api/full/typescript/src/errors/RivetTimeoutError.ts b/sdks/api/full/typescript/src/errors/RivetClientTimeoutError.ts similarity index 50% rename from sdks/api/full/typescript/src/errors/RivetTimeoutError.ts rename to sdks/api/full/typescript/src/errors/RivetClientTimeoutError.ts index 13ec56e1ff..1f36d8c893 100644 --- a/sdks/api/full/typescript/src/errors/RivetTimeoutError.ts +++ b/sdks/api/full/typescript/src/errors/RivetClientTimeoutError.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export class RivetTimeoutError extends Error { +export class RivetClientTimeoutError extends Error { constructor() { super("Timeout"); - Object.setPrototypeOf(this, RivetTimeoutError.prototype); + Object.setPrototypeOf(this, RivetClientTimeoutError.prototype); } } diff --git a/sdks/api/full/typescript/src/errors/index.ts b/sdks/api/full/typescript/src/errors/index.ts index 486b4fe258..625b82849c 100644 --- a/sdks/api/full/typescript/src/errors/index.ts +++ b/sdks/api/full/typescript/src/errors/index.ts @@ -1,2 +1,2 @@ -export { RivetError } from "./RivetError"; -export { RivetTimeoutError } from "./RivetTimeoutError"; +export { RivetClientError } from "./RivetClientError"; +export { RivetClientTimeoutError } from "./RivetClientTimeoutError"; diff --git a/sdks/api/full/typescript/src/index.ts b/sdks/api/full/typescript/src/index.ts index 9e457779dd..798feaa09d 100644 --- a/sdks/api/full/typescript/src/index.ts +++ b/sdks/api/full/typescript/src/index.ts @@ -1,4 +1,4 @@ -export * as Rivet from "./api"; -export { RivetClient } from "./Client"; -export { RivetEnvironment } from "./environments"; -export { RivetError, RivetTimeoutError } from "./errors"; +export * as RivetClient from "./api"; +export { RivetClientClient } from "./Client"; +export { RivetClientEnvironment } from "./environments"; +export { RivetClientError, RivetClientTimeoutError } from "./errors"; diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/PrepareAvatarUploadRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/PrepareAvatarUploadRequest.ts index 579f1a5259..9d8aa6f184 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/PrepareAvatarUploadRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/PrepareAvatarUploadRequest.ts @@ -3,12 +3,12 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; export const PrepareAvatarUploadRequest: core.serialization.Schema< serializers.identity.PrepareAvatarUploadRequest.Raw, - Rivet.identity.PrepareAvatarUploadRequest + RivetClient.identity.PrepareAvatarUploadRequest > = core.serialization.object({ path: core.serialization.string(), mime: core.serialization.string(), diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetGameActivityRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetGameActivityRequest.ts index 9ee2fbf3b9..5ea87d99e7 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetGameActivityRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetGameActivityRequest.ts @@ -3,13 +3,13 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; import { UpdateGameActivity } from "../../resources/common/types/UpdateGameActivity"; export const SetGameActivityRequest: core.serialization.Schema< serializers.identity.SetGameActivityRequest.Raw, - Rivet.identity.SetGameActivityRequest + RivetClient.identity.SetGameActivityRequest > = core.serialization.object({ gameActivity: core.serialization.property("game_activity", UpdateGameActivity), }); diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetupRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetupRequest.ts index 391e60d0de..305a44d548 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetupRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SetupRequest.ts @@ -3,13 +3,13 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; import { Jwt } from "../../../common/types/Jwt"; export const SetupRequest: core.serialization.Schema< serializers.identity.SetupRequest.Raw, - Rivet.identity.SetupRequest + RivetClient.identity.SetupRequest > = core.serialization.object({ existingIdentityToken: core.serialization.property("existing_identity_token", Jwt.optional()), }); diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SignupForBetaRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SignupForBetaRequest.ts index 082755586a..a690ceb142 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SignupForBetaRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/SignupForBetaRequest.ts @@ -3,12 +3,12 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; export const SignupForBetaRequest: core.serialization.Schema< serializers.identity.SignupForBetaRequest.Raw, - Rivet.identity.SignupForBetaRequest + RivetClient.identity.SignupForBetaRequest > = core.serialization.object({ name: core.serialization.string(), companyName: core.serialization.property("company_name", core.serialization.string().optional()), diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateProfileRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateProfileRequest.ts index d130133795..fcaeda8ccb 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateProfileRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateProfileRequest.ts @@ -3,7 +3,7 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; import { DisplayName } from "../../../common/types/DisplayName"; import { AccountNumber } from "../../../common/types/AccountNumber"; @@ -11,7 +11,7 @@ import { Bio } from "../../../common/types/Bio"; export const UpdateProfileRequest: core.serialization.Schema< serializers.identity.UpdateProfileRequest.Raw, - Rivet.identity.UpdateProfileRequest + RivetClient.identity.UpdateProfileRequest > = core.serialization.object({ displayName: core.serialization.property("display_name", DisplayName.optional()), accountNumber: core.serialization.property("account_number", AccountNumber.optional()), diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateStatusRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateStatusRequest.ts index 4273db2c55..a0484fa7a5 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateStatusRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/UpdateStatusRequest.ts @@ -3,13 +3,13 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; import { Status } from "../../resources/common/types/Status"; export const UpdateStatusRequest: core.serialization.Schema< serializers.identity.UpdateStatusRequest.Raw, - Rivet.identity.UpdateStatusRequest + RivetClient.identity.UpdateStatusRequest > = core.serialization.object({ status: Status, }); diff --git a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/ValidateProfileRequest.ts b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/ValidateProfileRequest.ts index 968adf33ed..648f6e8ff0 100644 --- a/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/ValidateProfileRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/identity/client/requests/ValidateProfileRequest.ts @@ -3,7 +3,7 @@ */ import * as serializers from "../../../../index"; -import * as Rivet from "../../../../../api/index"; +import * as RivetClient from "../../../../../api/index"; import * as core from "../../../../../core"; import { DisplayName } from "../../../common/types/DisplayName"; import { AccountNumber } from "../../../common/types/AccountNumber"; @@ -11,7 +11,7 @@ import { Bio } from "../../../common/types/Bio"; export const ValidateProfileRequest: core.serialization.Schema< serializers.identity.ValidateProfileRequest.Raw, - Rivet.identity.ValidateProfileRequest + RivetClient.identity.ValidateProfileRequest > = core.serialization.object({ displayName: core.serialization.property("display_name", DisplayName.optional()), accountNumber: core.serialization.property("account_number", AccountNumber.optional()), diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts index 8b23636030..4d4f7199a2 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/CreateLobbyRequest.ts @@ -3,14 +3,14 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; import { CustomLobbyPublicity } from "../../../common/types/CustomLobbyPublicity"; import { Config } from "../../../../../captcha/resources/config/types/Config"; export const CreateLobbyRequest: core.serialization.Schema< serializers.matchmaker.CreateLobbyRequest.Raw, - Rivet.matchmaker.CreateLobbyRequest + RivetClient.matchmaker.CreateLobbyRequest > = core.serialization.object({ gameMode: core.serialization.property("game_mode", core.serialization.string()), region: core.serialization.string().optional(), diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts index b92a64c2da..21aa587bfb 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/FindLobbyRequest.ts @@ -3,13 +3,13 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; import { Config } from "../../../../../captcha/resources/config/types/Config"; export const FindLobbyRequest: core.serialization.Schema< serializers.matchmaker.FindLobbyRequest.Raw, - Omit + Omit > = core.serialization.object({ gameModes: core.serialization.property("game_modes", core.serialization.list(core.serialization.string())), regions: core.serialization.list(core.serialization.string()).optional(), diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts index 904b2df9bf..01e431a9d5 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/JoinLobbyRequest.ts @@ -3,13 +3,13 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; import { Config } from "../../../../../captcha/resources/config/types/Config"; export const JoinLobbyRequest: core.serialization.Schema< serializers.matchmaker.JoinLobbyRequest.Raw, - Rivet.matchmaker.JoinLobbyRequest + RivetClient.matchmaker.JoinLobbyRequest > = core.serialization.object({ lobbyId: core.serialization.property("lobby_id", core.serialization.string()), captcha: Config.optional(), diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/SetLobbyClosedRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/SetLobbyClosedRequest.ts index dc16f64f1f..4840e6af47 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/SetLobbyClosedRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/lobbies/client/requests/SetLobbyClosedRequest.ts @@ -3,12 +3,12 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; export const SetLobbyClosedRequest: core.serialization.Schema< serializers.matchmaker.SetLobbyClosedRequest.Raw, - Rivet.matchmaker.SetLobbyClosedRequest + RivetClient.matchmaker.SetLobbyClosedRequest > = core.serialization.object({ isClosed: core.serialization.property("is_closed", core.serialization.boolean()), }); diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerConnectedRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerConnectedRequest.ts index 9a01e7e1a9..ba8a335c75 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerConnectedRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerConnectedRequest.ts @@ -3,12 +3,12 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; export const PlayerConnectedRequest: core.serialization.Schema< serializers.matchmaker.PlayerConnectedRequest.Raw, - Rivet.matchmaker.PlayerConnectedRequest + RivetClient.matchmaker.PlayerConnectedRequest > = core.serialization.object({ playerToken: core.serialization.property("player_token", core.serialization.string()), }); diff --git a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerDisconnectedRequest.ts b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerDisconnectedRequest.ts index 4af2aab40d..42b98e890d 100644 --- a/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerDisconnectedRequest.ts +++ b/sdks/api/full/typescript/src/serialization/resources/matchmaker/resources/players/client/requests/PlayerDisconnectedRequest.ts @@ -3,12 +3,12 @@ */ import * as serializers from "../../../../../../index"; -import * as Rivet from "../../../../../../../api/index"; +import * as RivetClient from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; export const PlayerDisconnectedRequest: core.serialization.Schema< serializers.matchmaker.PlayerDisconnectedRequest.Raw, - Rivet.matchmaker.PlayerDisconnectedRequest + RivetClient.matchmaker.PlayerDisconnectedRequest > = core.serialization.object({ playerToken: core.serialization.property("player_token", core.serialization.string()), }); diff --git a/sdks/api/runtime/typescript/src/Client.ts b/sdks/api/runtime/typescript/src/Client.ts index 729bdb3662..4e4ce24852 100644 --- a/sdks/api/runtime/typescript/src/Client.ts +++ b/sdks/api/runtime/typescript/src/Client.ts @@ -6,9 +6,9 @@ import * as environments from "./environments"; import * as core from "./core"; import { Actor } from "./api/resources/actor/client/Client"; -export declare namespace RivetClient { +export declare namespace RivetClientClient { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token: core.Supplier; fetcher?: core.FetchFunction; } @@ -23,8 +23,8 @@ export declare namespace RivetClient { } } -export class RivetClient { - constructor(protected readonly _options: RivetClient.Options) {} +export class RivetClientClient { + constructor(protected readonly _options: RivetClientClient.Options) {} protected _actor: Actor | undefined; diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/client/Client.ts b/sdks/api/runtime/typescript/src/api/resources/actor/client/Client.ts index 84cffae1c2..6ba24388b8 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/client/Client.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/client/Client.ts @@ -4,7 +4,7 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; import * as errors from "../../../../errors/index"; @@ -14,7 +14,7 @@ import { Regions } from "../resources/regions/client/Client"; export declare namespace Actor { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token: core.Supplier; fetcher?: core.FetchFunction; } @@ -36,15 +36,15 @@ export class Actor { * Gets a dynamic actor. * * @param {string} actor - The id of the actor to destroy - * @param {Rivet.actor.ListActorsRequestQuery} request + * @param {RivetClient.actor.ListActorsRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -54,9 +54,9 @@ export class Actor { */ public async get( actor: string, - request: Rivet.actor.ListActorsRequestQuery = {}, + request: RivetClient.actor.ListActorsRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -69,7 +69,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}` ), method: "GET", @@ -99,7 +99,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -109,7 +109,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -119,7 +119,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -129,7 +129,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -139,7 +139,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -149,7 +149,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -159,7 +159,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -168,14 +168,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -184,15 +184,15 @@ export class Actor { /** * Lists all actors associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.actor.GetActorsRequestQuery} request + * @param {RivetClient.actor.GetActorsRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.list({ @@ -204,9 +204,9 @@ export class Actor { * }) */ public async list( - request: Rivet.actor.GetActorsRequestQuery = {}, + request: RivetClient.actor.GetActorsRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, tagsJson, includeDestroyed, cursor } = request; const _queryParams: Record = {}; if (project != null) { @@ -231,7 +231,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/actors" ), method: "GET", @@ -261,7 +261,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -271,7 +271,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -281,7 +281,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -291,7 +291,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -301,7 +301,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -311,7 +311,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -321,7 +321,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -330,14 +330,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -346,15 +346,15 @@ export class Actor { /** * Create a new dynamic actor. * - * @param {Rivet.actor.CreateActorRequestQuery} request + * @param {RivetClient.actor.CreateActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.create({ @@ -390,9 +390,9 @@ export class Actor { * }) */ public async create( - request: Rivet.actor.CreateActorRequestQuery, + request: RivetClient.actor.CreateActorRequestQuery, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -405,7 +405,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/actors" ), method: "POST", @@ -436,7 +436,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -446,7 +446,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -456,7 +456,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -466,7 +466,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -476,7 +476,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -486,7 +486,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -496,7 +496,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -505,14 +505,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -522,15 +522,15 @@ export class Actor { * Destroy a dynamic actor. * * @param {string} actor - The id of the actor to destroy - * @param {Rivet.actor.DestroyActorRequestQuery} request + * @param {RivetClient.actor.DestroyActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.destroy("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -541,9 +541,9 @@ export class Actor { */ public async destroy( actor: string, - request: Rivet.actor.DestroyActorRequestQuery = {}, + request: RivetClient.actor.DestroyActorRequestQuery = {}, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, overrideKillTimeout } = request; const _queryParams: Record = {}; if (project != null) { @@ -560,7 +560,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}` ), method: "DELETE", @@ -590,7 +590,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -600,7 +600,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -610,7 +610,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -620,7 +620,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -630,7 +630,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -640,7 +640,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -650,7 +650,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -659,14 +659,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -676,15 +676,15 @@ export class Actor { * Upgrades a dynamic actor. * * @param {string} actor - The id of the actor to upgrade - * @param {Rivet.actor.UpgradeActorRequestQuery} request + * @param {RivetClient.actor.UpgradeActorRequestQuery} request * @param {Actor.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.upgrade("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -700,9 +700,9 @@ export class Actor { */ public async upgrade( actor: string, - request: Rivet.actor.UpgradeActorRequestQuery, + request: RivetClient.actor.UpgradeActorRequestQuery, requestOptions?: Actor.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -715,7 +715,7 @@ export class Actor { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}/upgrade` ), method: "POST", @@ -746,7 +746,7 @@ export class Actor { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -756,7 +756,7 @@ export class Actor { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -766,7 +766,7 @@ export class Actor { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -776,7 +776,7 @@ export class Actor { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -786,7 +786,7 @@ export class Actor { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -796,7 +796,7 @@ export class Actor { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -806,7 +806,7 @@ export class Actor { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -815,14 +815,14 @@ export class Actor { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts b/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts index 326c8767da..22d3c322e7 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/CreateActorRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -41,5 +41,5 @@ import * as Rivet from "../../../../index"; export interface CreateActorRequestQuery { project?: string; environment?: string; - body: Rivet.actor.CreateActorRequest; + body: RivetClient.actor.CreateActorRequest; } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts b/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts index bc6bf3a228..ef11615a77 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/client/requests/UpgradeActorRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../index"; +import * as RivetClient from "../../../../index"; /** * @example @@ -20,5 +20,5 @@ import * as Rivet from "../../../../index"; export interface UpgradeActorRequestQuery { project?: string; environment?: string; - body: Rivet.actor.UpgradeActorRequest; + body: RivetClient.actor.UpgradeActorRequest; } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/Client.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/Client.ts index a39d734be4..a0d701a0d8 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/Client.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Builds { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Builds { * Get a build. * * @param {string} build - * @param {Rivet.actor.GetBuildRequestQuery} request + * @param {RivetClient.actor.GetBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -51,9 +51,9 @@ export class Builds { */ public async get( build: string, - request: Rivet.actor.GetBuildRequestQuery = {}, + request: RivetClient.actor.GetBuildRequestQuery = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -66,7 +66,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}` ), method: "GET", @@ -96,7 +96,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -106,7 +106,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -116,7 +116,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -126,7 +126,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -136,7 +136,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -146,7 +146,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -156,7 +156,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -165,14 +165,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -181,15 +181,15 @@ export class Builds { /** * Lists all builds of the project associated with the token used. Can be filtered by tags in the query string. * - * @param {Rivet.actor.ListBuildsRequestQuery} request + * @param {RivetClient.actor.ListBuildsRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.list({ @@ -199,9 +199,9 @@ export class Builds { * }) */ public async list( - request: Rivet.actor.ListBuildsRequestQuery = {}, + request: RivetClient.actor.ListBuildsRequestQuery = {}, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, tagsJson } = request; const _queryParams: Record = {}; if (project != null) { @@ -218,7 +218,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/builds" ), method: "GET", @@ -248,7 +248,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -258,7 +258,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -268,7 +268,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -278,7 +278,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -288,7 +288,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -298,7 +298,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -308,7 +308,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -317,14 +317,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -332,15 +332,15 @@ export class Builds { /** * @param {string} build - * @param {Rivet.actor.PatchBuildTagsRequestQuery} request + * @param {RivetClient.actor.PatchBuildTagsRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.patchTags("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -356,9 +356,9 @@ export class Builds { */ public async patchTags( build: string, - request: Rivet.actor.PatchBuildTagsRequestQuery, + request: RivetClient.actor.PatchBuildTagsRequestQuery, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -371,7 +371,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}/tags` ), method: "PATCH", @@ -402,7 +402,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -412,7 +412,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -422,7 +422,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -432,7 +432,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -442,7 +442,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -452,7 +452,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -462,7 +462,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -471,14 +471,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -487,15 +487,15 @@ export class Builds { /** * Creates a new project build for the given project. * - * @param {Rivet.actor.PrepareBuildRequestQuery} request + * @param {RivetClient.actor.PrepareBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.prepare({ @@ -515,9 +515,9 @@ export class Builds { * }) */ public async prepare( - request: Rivet.actor.PrepareBuildRequestQuery, + request: RivetClient.actor.PrepareBuildRequestQuery, requestOptions?: Builds.RequestOptions - ): Promise { + ): Promise { const { project, environment, body: _body } = request; const _queryParams: Record = {}; if (project != null) { @@ -530,7 +530,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/builds/prepare" ), method: "POST", @@ -561,7 +561,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -571,7 +571,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -581,7 +581,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -591,7 +591,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -601,7 +601,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -611,7 +611,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -621,7 +621,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -630,14 +630,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } @@ -647,15 +647,15 @@ export class Builds { * Marks an upload as complete. * * @param {string} build - * @param {Rivet.actor.CompleteBuildRequestQuery} request + * @param {RivetClient.actor.CompleteBuildRequestQuery} request * @param {Builds.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.builds.complete("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -665,7 +665,7 @@ export class Builds { */ public async complete( build: string, - request: Rivet.actor.CompleteBuildRequestQuery = {}, + request: RivetClient.actor.CompleteBuildRequestQuery = {}, requestOptions?: Builds.RequestOptions ): Promise { const { project, environment } = request; @@ -680,7 +680,7 @@ export class Builds { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/builds/${encodeURIComponent(build)}/complete` ), method: "POST", @@ -704,7 +704,7 @@ export class Builds { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -714,7 +714,7 @@ export class Builds { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -724,7 +724,7 @@ export class Builds { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -734,7 +734,7 @@ export class Builds { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -744,7 +744,7 @@ export class Builds { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -754,7 +754,7 @@ export class Builds { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -764,7 +764,7 @@ export class Builds { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -773,14 +773,14 @@ export class Builds { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts index ddcc97fd15..009f906b5f 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PatchBuildTagsRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -20,5 +20,5 @@ import * as Rivet from "../../../../../../index"; export interface PatchBuildTagsRequestQuery { project?: string; environment?: string; - body: Rivet.actor.PatchBuildTagsRequest; + body: RivetClient.actor.PatchBuildTagsRequest; } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts index 8271a80a5b..97311edbdd 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/builds/client/requests/PrepareBuildRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -25,5 +25,5 @@ import * as Rivet from "../../../../../../index"; export interface PrepareBuildRequestQuery { project?: string; environment?: string; - body: Rivet.actor.PrepareBuildRequest; + body: RivetClient.actor.PrepareBuildRequest; } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/Client.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/Client.ts index ea418175ba..350d2f1242 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/Client.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Logs { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token: core.Supplier; fetcher?: core.FetchFunction; } @@ -33,15 +33,15 @@ export class Logs { * Returns the logs for a given actor. * * @param {string} actor - * @param {Rivet.actor.GetActorLogsRequestQuery} request + * @param {RivetClient.actor.GetActorLogsRequestQuery} request * @param {Logs.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.logs.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", { @@ -53,9 +53,9 @@ export class Logs { */ public async get( actor: string, - request: Rivet.actor.GetActorLogsRequestQuery, + request: RivetClient.actor.GetActorLogsRequestQuery, requestOptions?: Logs.RequestOptions - ): Promise { + ): Promise { const { project, environment, stream, watchIndex } = request; const _queryParams: Record = {}; if (project != null) { @@ -73,7 +73,7 @@ export class Logs { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, `/actors/${encodeURIComponent(actor)}/logs` ), method: "GET", @@ -103,7 +103,7 @@ export class Logs { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -113,7 +113,7 @@ export class Logs { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -123,7 +123,7 @@ export class Logs { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -133,7 +133,7 @@ export class Logs { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -143,7 +143,7 @@ export class Logs { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -153,7 +153,7 @@ export class Logs { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -163,7 +163,7 @@ export class Logs { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -172,14 +172,14 @@ export class Logs { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts index eb1587c3e1..829efa8b1f 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/logs/client/requests/GetActorLogsRequestQuery.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Rivet from "../../../../../../index"; +import * as RivetClient from "../../../../../../index"; /** * @example @@ -16,7 +16,7 @@ import * as Rivet from "../../../../../../index"; export interface GetActorLogsRequestQuery { project?: string; environment?: string; - stream: Rivet.actor.LogStream; + stream: RivetClient.actor.LogStream; /** * A query parameter denoting the requests watch index. */ diff --git a/sdks/api/runtime/typescript/src/api/resources/actor/resources/regions/client/Client.ts b/sdks/api/runtime/typescript/src/api/resources/actor/resources/regions/client/Client.ts index 6ca7610eab..04b33d1ba3 100644 --- a/sdks/api/runtime/typescript/src/api/resources/actor/resources/regions/client/Client.ts +++ b/sdks/api/runtime/typescript/src/api/resources/actor/resources/regions/client/Client.ts @@ -4,14 +4,14 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Rivet from "../../../../../index"; +import * as RivetClient from "../../../../../index"; import urlJoin from "url-join"; import * as serializers from "../../../../../../serialization/index"; import * as errors from "../../../../../../errors/index"; export declare namespace Regions { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token: core.Supplier; fetcher?: core.FetchFunction; } @@ -30,15 +30,15 @@ export class Regions { constructor(protected readonly _options: Regions.Options) {} /** - * @param {Rivet.actor.ListRegionsRequestQuery} request + * @param {RivetClient.actor.ListRegionsRequestQuery} request * @param {Regions.RequestOptions} requestOptions - Request-specific configuration. * - * @throws {@link Rivet.InternalError} - * @throws {@link Rivet.RateLimitError} - * @throws {@link Rivet.ForbiddenError} - * @throws {@link Rivet.UnauthorizedError} - * @throws {@link Rivet.NotFoundError} - * @throws {@link Rivet.BadRequestError} + * @throws {@link RivetClient.InternalError} + * @throws {@link RivetClient.RateLimitError} + * @throws {@link RivetClient.ForbiddenError} + * @throws {@link RivetClient.UnauthorizedError} + * @throws {@link RivetClient.NotFoundError} + * @throws {@link RivetClient.BadRequestError} * * @example * await client.actor.regions.list({ @@ -47,9 +47,9 @@ export class Regions { * }) */ public async list( - request: Rivet.actor.ListRegionsRequestQuery = {}, + request: RivetClient.actor.ListRegionsRequestQuery = {}, requestOptions?: Regions.RequestOptions - ): Promise { + ): Promise { const { project, environment } = request; const _queryParams: Record = {}; if (project != null) { @@ -62,7 +62,7 @@ export class Regions { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.RivetEnvironment.Production, + (await core.Supplier.get(this._options.environment)) ?? environments.RivetClientEnvironment.Production, "/regions" ), method: "GET", @@ -92,7 +92,7 @@ export class Regions { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { case 500: - throw new Rivet.InternalError( + throw new RivetClient.InternalError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -102,7 +102,7 @@ export class Regions { }) ); case 429: - throw new Rivet.RateLimitError( + throw new RivetClient.RateLimitError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -112,7 +112,7 @@ export class Regions { }) ); case 403: - throw new Rivet.ForbiddenError( + throw new RivetClient.ForbiddenError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -122,7 +122,7 @@ export class Regions { }) ); case 408: - throw new Rivet.UnauthorizedError( + throw new RivetClient.UnauthorizedError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -132,7 +132,7 @@ export class Regions { }) ); case 404: - throw new Rivet.NotFoundError( + throw new RivetClient.NotFoundError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -142,7 +142,7 @@ export class Regions { }) ); case 400: - throw new Rivet.BadRequestError( + throw new RivetClient.BadRequestError( serializers.ErrorBody.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, @@ -152,7 +152,7 @@ export class Regions { }) ); default: - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -161,14 +161,14 @@ export class Regions { switch (_response.error.reason) { case "non-json": - throw new errors.RivetError({ + throw new errors.RivetClientError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.RivetTimeoutError(); + throw new errors.RivetClientTimeoutError(); case "unknown": - throw new errors.RivetError({ + throw new errors.RivetClientError({ message: _response.error.errorMessage, }); } diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/BadRequestError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/BadRequestError.ts index 862667ba25..ffad9c50a9 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/BadRequestError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/BadRequestError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class BadRequestError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class BadRequestError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "BadRequestError", statusCode: 400, diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/ForbiddenError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/ForbiddenError.ts index ba42772a32..0f2c422ec0 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/ForbiddenError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/ForbiddenError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class ForbiddenError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class ForbiddenError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "ForbiddenError", statusCode: 403, diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/InternalError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/InternalError.ts index 1bc1140f5b..5b1c7ec877 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/InternalError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/InternalError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class InternalError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class InternalError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "InternalError", statusCode: 500, diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/NotFoundError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/NotFoundError.ts index 67c2019811..34c812321b 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/NotFoundError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/NotFoundError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class NotFoundError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class NotFoundError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "NotFoundError", statusCode: 404, diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/RateLimitError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/RateLimitError.ts index 64591f50c9..e30033560c 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/RateLimitError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/RateLimitError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class RateLimitError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class RateLimitError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "RateLimitError", statusCode: 429, diff --git a/sdks/api/runtime/typescript/src/api/resources/common/errors/UnauthorizedError.ts b/sdks/api/runtime/typescript/src/api/resources/common/errors/UnauthorizedError.ts index 5b522ed874..ad122ea5cf 100644 --- a/sdks/api/runtime/typescript/src/api/resources/common/errors/UnauthorizedError.ts +++ b/sdks/api/runtime/typescript/src/api/resources/common/errors/UnauthorizedError.ts @@ -3,10 +3,10 @@ */ import * as errors from "../../../../errors/index"; -import * as Rivet from "../../../index"; +import * as RivetClient from "../../../index"; -export class UnauthorizedError extends errors.RivetError { - constructor(body: Rivet.ErrorBody) { +export class UnauthorizedError extends errors.RivetClientError { + constructor(body: RivetClient.ErrorBody) { super({ message: "UnauthorizedError", statusCode: 408, diff --git a/sdks/api/runtime/typescript/src/environments.ts b/sdks/api/runtime/typescript/src/environments.ts index a326fd6df4..0c0ad87a2a 100644 --- a/sdks/api/runtime/typescript/src/environments.ts +++ b/sdks/api/runtime/typescript/src/environments.ts @@ -2,8 +2,8 @@ * This file was auto-generated by Fern from our API Definition. */ -export const RivetEnvironment = { +export const RivetClientEnvironment = { Production: "https://api.rivet.gg", } as const; -export type RivetEnvironment = typeof RivetEnvironment.Production; +export type RivetClientEnvironment = typeof RivetClientEnvironment.Production; diff --git a/sdks/api/runtime/typescript/src/errors/RivetError.ts b/sdks/api/runtime/typescript/src/errors/RivetClientError.ts similarity index 89% rename from sdks/api/runtime/typescript/src/errors/RivetError.ts rename to sdks/api/runtime/typescript/src/errors/RivetClientError.ts index d9dce7d75c..1f26f73c1a 100644 --- a/sdks/api/runtime/typescript/src/errors/RivetError.ts +++ b/sdks/api/runtime/typescript/src/errors/RivetClientError.ts @@ -2,13 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -export class RivetError extends Error { +export class RivetClientError extends Error { readonly statusCode?: number; readonly body?: unknown; constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { super(buildMessage({ message, statusCode, body })); - Object.setPrototypeOf(this, RivetError.prototype); + Object.setPrototypeOf(this, RivetClientError.prototype); if (statusCode != null) { this.statusCode = statusCode; } diff --git a/sdks/api/runtime/typescript/src/errors/RivetTimeoutError.ts b/sdks/api/runtime/typescript/src/errors/RivetClientTimeoutError.ts similarity index 50% rename from sdks/api/runtime/typescript/src/errors/RivetTimeoutError.ts rename to sdks/api/runtime/typescript/src/errors/RivetClientTimeoutError.ts index 13ec56e1ff..1f36d8c893 100644 --- a/sdks/api/runtime/typescript/src/errors/RivetTimeoutError.ts +++ b/sdks/api/runtime/typescript/src/errors/RivetClientTimeoutError.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export class RivetTimeoutError extends Error { +export class RivetClientTimeoutError extends Error { constructor() { super("Timeout"); - Object.setPrototypeOf(this, RivetTimeoutError.prototype); + Object.setPrototypeOf(this, RivetClientTimeoutError.prototype); } } diff --git a/sdks/api/runtime/typescript/src/errors/index.ts b/sdks/api/runtime/typescript/src/errors/index.ts index 486b4fe258..625b82849c 100644 --- a/sdks/api/runtime/typescript/src/errors/index.ts +++ b/sdks/api/runtime/typescript/src/errors/index.ts @@ -1,2 +1,2 @@ -export { RivetError } from "./RivetError"; -export { RivetTimeoutError } from "./RivetTimeoutError"; +export { RivetClientError } from "./RivetClientError"; +export { RivetClientTimeoutError } from "./RivetClientTimeoutError"; diff --git a/sdks/api/runtime/typescript/src/index.ts b/sdks/api/runtime/typescript/src/index.ts index 9e457779dd..798feaa09d 100644 --- a/sdks/api/runtime/typescript/src/index.ts +++ b/sdks/api/runtime/typescript/src/index.ts @@ -1,4 +1,4 @@ -export * as Rivet from "./api"; -export { RivetClient } from "./Client"; -export { RivetEnvironment } from "./environments"; -export { RivetError, RivetTimeoutError } from "./errors"; +export * as RivetClient from "./api"; +export { RivetClientClient } from "./Client"; +export { RivetClientEnvironment } from "./environments"; +export { RivetClientError, RivetClientTimeoutError } from "./errors";