Skip to content

Latest commit

 

History

History
384 lines (279 loc) · 25.5 KB

README.md

File metadata and controls

384 lines (279 loc) · 25.5 KB

Capabilities

(capabilities)

Overview

Available Operations

  • list - Retrieve all the capabilities an account has requested.

Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.read scope.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.write scope.

  • get - Retrieve a specific capability that an account has requested. Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.read scope.

  • disable - Disable a specific capability that an account has requested. Read our capabilities guide to learn more.

    To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.write scope.

list

Retrieve all the capabilities an account has requested.

Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.capabilities.list({
    accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { capabilitiesList } from "@moovio/sdk/funcs/capabilitiesList.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await capabilitiesList(moov, {
    accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.ListCapabilitiesRequest ✔️ 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<operations.ListCapabilitiesResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

request

Request capabilities for a specific account. Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.write scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.capabilities.request({
    accountID: "32613610-de25-446e-8662-ec2709ffea9d",
    addCapabilities: {
      capabilities: [
        "collect-funds",
      ],
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { capabilitiesRequest } from "@moovio/sdk/funcs/capabilitiesRequest.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await capabilitiesRequest(moov, {
    accountID: "32613610-de25-446e-8662-ec2709ffea9d",
    addCapabilities: {
      capabilities: [
        "collect-funds",
      ],
    },
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.RequestCapabilitiesRequest ✔️ 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<operations.RequestCapabilitiesResponse>

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409 application/json
errors.AddCapabilitiesError 422 application/json
errors.APIError 4XX, 5XX */*

get

Retrieve a specific capability that an account has requested. Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.read scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.capabilities.get({
    accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
    capabilityID: "production-app",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { capabilitiesGet } from "@moovio/sdk/funcs/capabilitiesGet.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await capabilitiesGet(moov, {
    accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
    capabilityID: "production-app",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetCapabilityRequest ✔️ 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<operations.GetCapabilityResponse>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

disable

Disable a specific capability that an account has requested. Read our capabilities guide to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/capabilities.write scope.

Example Usage

import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.capabilities.disable({
    accountID: "cd7cd1ce-90cc-444b-ac3e-badb79be277f",
    capabilityID: "transfers",
  });

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

run();

Standalone function

The standalone function version of this method:

import { MoovCore } from "@moovio/sdk/core.js";
import { capabilitiesDisable } from "@moovio/sdk/funcs/capabilitiesDisable.js";

// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const res = await capabilitiesDisable(moov, {
    accountID: "cd7cd1ce-90cc-444b-ac3e-badb79be277f",
    capabilityID: "transfers",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.DisableCapabilityRequest ✔️ 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<operations.DisableCapabilityResponse>

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409 application/json
errors.APIError 4XX, 5XX */*