Skip to content

Latest commit

 

History

History
302 lines (205 loc) · 34.8 KB

File metadata and controls

302 lines (205 loc) · 34.8 KB

OrganizationsV1

(organizationsV1)

Available Operations

getOrgs

Returns an unsorted list of all organizations that you are a member of (an accepted membership invite). An organization is uniquely identified by an orgId.

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  const result = await hathoraCloud.organizationsV1.getOrgs();

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.OrgsPage>

Errors

Error Object Status Code Content Type
errors.ApiError 401,404,429 application/json
errors.SDKError 4xx-5xx /

inviteUser

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  const result = await hathoraCloud.organizationsV1.inviteUser("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39", {
    userEmail: "<value>",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description Example
orgId string ✔️ N/A [object Object]
createUserInvite components.CreateUserInvite ✔️ N/A
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.OrgPermission>

Errors

Error Object Status Code Content Type
errors.ApiError 401,422,429 application/json
errors.SDKError 4xx-5xx /

rescindInvite

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  await hathoraCloud.organizationsV1.rescindInvite("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39", {
    userEmail: "<value>",
  });

  
}

run();

Parameters

Parameter Type Required Description Example
orgId string ✔️ N/A [object Object]
rescindUserInvite components.RescindUserInvite ✔️ N/A
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.ApiError 401,404,429,500 application/json
errors.SDKError 4xx-5xx /

getOrgPendingInvites

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  const result = await hathoraCloud.organizationsV1.getOrgPendingInvites("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description Example
orgId string ✔️ N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.OrgInvitesPage>

Errors

Error Object Status Code Content Type
errors.ApiError 401,429 application/json
errors.SDKError 4xx-5xx /

getUserPendingInvites

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  const result = await hathoraCloud.organizationsV1.getUserPendingInvites();

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.OrgInvitesPage>

Errors

Error Object Status Code Content Type
errors.ApiError 401,429 application/json
errors.SDKError 4xx-5xx /

acceptInvite

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  await hathoraCloud.organizationsV1.acceptInvite("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

  
}

run();

Parameters

Parameter Type Required Description Example
orgId string ✔️ N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.ApiError 401,404,429 application/json
errors.SDKError 4xx-5xx /

rejectInvite

Example Usage

import { HathoraCloud } from "@hathora/cloud-sdk-typescript";

const hathoraCloud = new HathoraCloud({
  hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
  appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
  await hathoraCloud.organizationsV1.rejectInvite("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

  
}

run();

Parameters

Parameter Type Required Description Example
orgId string ✔️ N/A [object Object]
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.ApiError 401,404,429 application/json
errors.SDKError 4xx-5xx /