Skip to content

Latest commit

Β 

History

History
583 lines (465 loc) Β· 35 KB

README.md

File metadata and controls

583 lines (465 loc) Β· 35 KB

Departments

(accounting.departments)

Overview

Available Operations

  • list - List Departments
  • create - Create Department
  • get - Get Department
  • update - Update Department
  • delete - Delete Department

list

List Departments

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.accounting.departments.list({
    serviceId: "salesforce",
    fields: "id,updated_at",
    filter: {
      subsidiary: "1",
    },
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { accountingDepartmentsList } from "@apideck/unify/funcs/accountingDepartmentsList.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await accountingDepartmentsList(apideck, {
    serviceId: "salesforce",
    fields: "id,updated_at",
    filter: {
      subsidiary: "1",
    },
  });

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

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.AccountingDepartmentsAllRequest βœ”οΈ 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.AccountingDepartmentsAllResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*

create

Create Department

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.accounting.departments.create({
    serviceId: "salesforce",
    accountingDepartment: {
      parentId: "12345",
      name: "Sales",
      status: "active",
      subsidiaries: [
        {
          name: "SpaceX",
        },
        {
          name: "SpaceX",
        },
      ],
      rowVersion: "1-12345",
      passThrough: [
        {
          serviceId: "<id>",
          extendPaths: [
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
          ],
        },
      ],
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { accountingDepartmentsCreate } from "@apideck/unify/funcs/accountingDepartmentsCreate.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await accountingDepartmentsCreate(apideck, {
    serviceId: "salesforce",
    accountingDepartment: {
      parentId: "12345",
      name: "Sales",
      status: "active",
      subsidiaries: [
        {
          name: "SpaceX",
        },
        {
          name: "SpaceX",
        },
      ],
      rowVersion: "1-12345",
      passThrough: [
        {
          serviceId: "<id>",
          extendPaths: [
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
          ],
        },
      ],
    },
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.AccountingDepartmentsAddRequest βœ”οΈ 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.AccountingDepartmentsAddResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*

get

Get Department

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.accounting.departments.get({
    id: "<id>",
    serviceId: "salesforce",
    fields: "id,updated_at",
  });

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

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { accountingDepartmentsGet } from "@apideck/unify/funcs/accountingDepartmentsGet.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await accountingDepartmentsGet(apideck, {
    id: "<id>",
    serviceId: "salesforce",
    fields: "id,updated_at",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.AccountingDepartmentsOneRequest βœ”οΈ 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.AccountingDepartmentsOneResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*

update

Update Department

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.accounting.departments.update({
    id: "<id>",
    serviceId: "salesforce",
    accountingDepartment: {
      parentId: "12345",
      name: "Sales",
      status: "active",
      subsidiaries: [
        {
          name: "SpaceX",
        },
      ],
      rowVersion: "1-12345",
      passThrough: [
        {
          serviceId: "<id>",
          extendPaths: [
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
          ],
        },
      ],
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { accountingDepartmentsUpdate } from "@apideck/unify/funcs/accountingDepartmentsUpdate.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await accountingDepartmentsUpdate(apideck, {
    id: "<id>",
    serviceId: "salesforce",
    accountingDepartment: {
      parentId: "12345",
      name: "Sales",
      status: "active",
      subsidiaries: [
        {
          name: "SpaceX",
        },
      ],
      rowVersion: "1-12345",
      passThrough: [
        {
          serviceId: "<id>",
          extendPaths: [
            {
              path: "$.nested.property",
              value: {
                "TaxClassificationRef": {
                  "value": "EUC-99990201-V1-00020000",
                },
              },
            },
          ],
        },
      ],
    },
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.AccountingDepartmentsUpdateRequest βœ”οΈ 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.AccountingDepartmentsUpdateResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*

delete

Delete Department

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.accounting.departments.delete({
    id: "<id>",
    serviceId: "salesforce",
  });

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

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { accountingDepartmentsDelete } from "@apideck/unify/funcs/accountingDepartmentsDelete.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await accountingDepartmentsDelete(apideck, {
    id: "<id>",
    serviceId: "salesforce",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.AccountingDepartmentsDeleteRequest βœ”οΈ 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.AccountingDepartmentsDeleteResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*