Skip to content

Latest commit

 

History

History
267 lines (189 loc) · 26.7 KB

File metadata and controls

267 lines (189 loc) · 26.7 KB

Items

(project.queues.items)

Overview

Project Queues Items API

Available Operations

append

Appends an item to the queue.

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const result = await intunedClient.project.queues.items.append("my-project", "my-sample-queue", {
    apiName: "get-contracts",
  parameters:     {
        "page": 1,
        "isLastPage": false,
      },
    retry: {
      maximumAttempts: 3,
    },
  });

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

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectQueuesItemsAppend } from "@intuned/client/funcs/projectQueuesItemsAppend.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectQueuesItemsAppend(intunedClient, "my-project", "my-sample-queue", {
    apiName: "get-contracts",
  parameters:     [
        {
          "page": 1,
          "isLastPage": false,
        },
      ],
    retry: {
      maximumAttempts: 3,
    },
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
queueId string ✔️ Your queue ID. It is the ID of the queue you provided when creating it. [object Object]
queueItem components.QueueItem ✔️ queue item
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<components.AddQueueItem>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /

result

Get queue item result.

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const result = await intunedClient.project.queues.items.result("my-project", "my-sample-queue", "11111111-1111-1111-1111-111111111111");

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

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectQueuesItemsResult } from "@intuned/client/funcs/projectQueuesItemsResult.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectQueuesItemsResult(intunedClient, "my-project", "my-sample-queue", "11111111-1111-1111-1111-111111111111");

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
queueId string ✔️ Your queue ID. It is the ID of the queue you provided when creating it. [object Object]
itemRunId string ✔️ Queue item run ID, obtained from the append queue item endpoint response. [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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.QueueItemResult>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /

delete

Delete queued item. If the item is currently processing, the delete will fail.

Example Usage

import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  await intunedClient.project.queues.items.delete("my-project", "my-sample-queue", "11111111-1111-1111-1111-111111111111");

  
}

run();

Standalone function

The standalone function version of this method:

import { IntunedClientCore } from "@intuned/client/core.js";
import { projectQueuesItemsDelete } from "@intuned/client/funcs/projectQueuesItemsDelete.js";

// Use `IntunedClientCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const intunedClient = new IntunedClientCore({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const res = await projectQueuesItemsDelete(intunedClient, "my-project", "my-sample-queue", "11111111-1111-1111-1111-111111111111");

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

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description Example
projectName string ✔️ Your project name. It is the name you provide when creating a project. [object Object]
queueId string ✔️ Your queue ID. It is the ID of the queue you provided when creating it. [object Object]
itemRunId string ✔️ Queue item run ID, obtained from the append queue item endpoint response. [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.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.SDKError 4xx-5xx /