Skip to content

Latest commit

 

History

History
537 lines (367 loc) · 44.8 KB

README.md

File metadata and controls

537 lines (367 loc) · 44.8 KB

AccessGroups

(accessGroups)

Overview

Available Operations

  • read - Reads an access group
  • update - Update an access group
  • delete - Deletes an access group
  • listMembers - List members of an access group
  • list - List access groups for a team, project or member
  • create - Creates an access group
  • listProjects - List projects of an access group

read

Allows to read an access group

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.read("<value>");
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsRead } from "@simplesagar/vercel/funcs/accessGroupsRead.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsRead(vercel, "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
idOrName string ✔️ N/A
teamId string The Team identifier to perform the request on behalf of.
slug string The Team slug to perform the request on behalf of.
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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ReadAccessGroupResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

update

Allows to update an access group metadata

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.update("<value>");
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsUpdate } from "@simplesagar/vercel/funcs/accessGroupsUpdate.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsUpdate(vercel, "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
idOrName string ✔️ N/A
teamId string The Team identifier to perform the request on behalf of.
slug string The Team slug to perform the request on behalf of.
requestBody models.UpdateAccessGroupRequestBody 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.AccessGroup>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

delete

Allows to delete an access group

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.accessGroups.delete("<value>");
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsDelete } from "@simplesagar/vercel/funcs/accessGroupsDelete.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsDelete(vercel, "<value>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
idOrName string ✔️ N/A
teamId string The Team identifier to perform the request on behalf of.
slug string The Team slug to perform the request on behalf of.
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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

listMembers

List members of an access group

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.listMembers({
    idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
  });
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsListMembers } from "@simplesagar/vercel/funcs/accessGroupsListMembers.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsListMembers(vercel, {
    idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request models.ListAccessGroupMembersRequest ✔️ The request object to use for the request.
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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListAccessGroupMembersResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

list

List access groups

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.list({});
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsList } from "@simplesagar/vercel/funcs/accessGroupsList.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsList(vercel, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request models.ListAccessGroupsRequest ✔️ The request object to use for the request.
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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListAccessGroupsResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

create

Allows to create an access group

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.create();
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsCreate } from "@simplesagar/vercel/funcs/accessGroupsCreate.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsCreate(vercel);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
teamId string The Team identifier to perform the request on behalf of.
slug string The Team slug to perform the request on behalf of.
requestBody models.CreateAccessGroupRequestBody 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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.CreateAccessGroupResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

listProjects

List projects of an access group

Example Usage

import { Vercel } from "@simplesagar/vercel";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.accessGroups.listProjects({
    idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
  });
  
  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@simplesagar/vercel/core.js";
import { accessGroupsListProjects } from "@simplesagar/vercel/funcs/accessGroupsListProjects.js";

// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await accessGroupsListProjects(vercel, {
    idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request models.ListAccessGroupProjectsRequest ✔️ The request object to use for the request.
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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListAccessGroupProjectsResponseBody>

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /