# EscalationPaths
(*escalationPaths*)

## Overview

### Available Operations

* [create](#create) - CreatePath Escalations V2
* [delete](#delete) - DestroyPath Escalations V2
* [get](#get) - ShowPath Escalations V2
* [update](#update) - UpdatePath Escalations V2

## create

Create an escalation path.

An escalation path is a series of steps that describe how a page should be escalated,
represented as graph, supporting conditional branches based on alert priority and working
intervals.

We recommend you create escalation paths in the incident.io dashboard where our path
builder makes it easy to use conditions and visualise the path.


### Example Usage

```typescript
import { Incidentio } from "incidentio";

const incidentio = new Incidentio();

async function run() {
  const result = await incidentio.escalationPaths.create({
    name: "Urgent Support",
    path: [
  
    ],
    workingHours: [
      {
        id: "abc123",
        name: "abc123",
        timezone: "abc123",
        weekdayIntervals: [
          {
            endTime: "17:00",
            startTime: "09:00",
            weekday: "abc123",
          },
        ],
      },
    ],
  });
  
  // Handle the result
  console.log(result)
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { escalationPathsCreate } from "incidentio/funcs/escalationPathsCreate.js";

// Use `IncidentioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const incidentio = new IncidentioCore();

async function run() {
  const res = await escalationPathsCreate(incidentio, {
    name: "Urgent Support",
    path: [
  
    ],
    workingHours: [
      {
        id: "abc123",
        name: "abc123",
        timezone: "abc123",
        weekdayIntervals: [
          {
            endTime: "17:00",
            startTime: "09:00",
            weekday: "abc123",
          },
        ],
      },
    ],
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [components.CreatePathRequestBody](../../models/components/createpathrequestbody.md)                                                                                           | :heavy_check_mark:                                                                                                                                                             | The request object to use for the request.                                                                                                                                     |
| `options`                                                                                                                                                                      | RequestOptions                                                                                                                                                                 | :heavy_minus_sign:                                                                                                                                                             | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions`                                                                                                                                                         | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                                        | :heavy_minus_sign:                                                                                                                                                             | 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](../../lib/utils/retryconfig.md)                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                             | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

**Promise\<[components.CreatePathResponseBody](../../models/components/createpathresponsebody.md)\>**

### Errors

| Error Object    | Status Code     | Content Type    |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx         | */*             |


## delete

Archives an escalation path.

We recommend you create escalation paths in the incident.io dashboard where our path
builder makes it easy to use conditions and visualise the path.


### Example Usage

```typescript
import { Incidentio } from "incidentio";

const incidentio = new Incidentio();

async function run() {
  await incidentio.escalationPaths.delete({
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
  });
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { escalationPathsDelete } from "incidentio/funcs/escalationPathsDelete.js";

// Use `IncidentioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const incidentio = new IncidentioCore();

async function run() {
  const res = await escalationPathsDelete(incidentio, {
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
  });

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

  const { value: result } = res;

  
}

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [operations.EscalationsV2NumberDestroyPathRequest](../../models/operations/escalationsv2numberdestroypathrequest.md)                                                           | :heavy_check_mark:                                                                                                                                                             | The request object to use for the request.                                                                                                                                     |
| `options`                                                                                                                                                                      | RequestOptions                                                                                                                                                                 | :heavy_minus_sign:                                                                                                                                                             | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions`                                                                                                                                                         | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                                        | :heavy_minus_sign:                                                                                                                                                             | 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](../../lib/utils/retryconfig.md)                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                             | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

**Promise\<void\>**

### Errors

| Error Object    | Status Code     | Content Type    |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx         | */*             |


## get

Show an escalation path.

We recommend you create escalation paths in the incident.io dashboard where our path
builder makes it easy to use conditions and visualise the path.


### Example Usage

```typescript
import { Incidentio } from "incidentio";

const incidentio = new Incidentio();

async function run() {
  const result = await incidentio.escalationPaths.get({
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
  });
  
  // Handle the result
  console.log(result)
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { escalationPathsGet } from "incidentio/funcs/escalationPathsGet.js";

// Use `IncidentioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const incidentio = new IncidentioCore();

async function run() {
  const res = await escalationPathsGet(incidentio, {
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [operations.EscalationsV2NumberShowPathRequest](../../models/operations/escalationsv2numbershowpathrequest.md)                                                                 | :heavy_check_mark:                                                                                                                                                             | The request object to use for the request.                                                                                                                                     |
| `options`                                                                                                                                                                      | RequestOptions                                                                                                                                                                 | :heavy_minus_sign:                                                                                                                                                             | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions`                                                                                                                                                         | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                                        | :heavy_minus_sign:                                                                                                                                                             | 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](../../lib/utils/retryconfig.md)                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                             | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

**Promise\<[components.CreatePathResponseBody](../../models/components/createpathresponsebody.md)\>**

### Errors

| Error Object    | Status Code     | Content Type    |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx         | */*             |


## update

Updates an escalation path.

We recommend you create escalation paths in the incident.io dashboard where our path
builder makes it easy to use conditions and visualise the path.


### Example Usage

```typescript
import { Incidentio } from "incidentio";

const incidentio = new Incidentio();

async function run() {
  const result = await incidentio.escalationPaths.update({
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
    createPathRequestBody: {
      name: "Urgent Support",
      path: [
  
      ],
      workingHours: [
        {
          id: "abc123",
          name: "abc123",
          timezone: "abc123",
          weekdayIntervals: [
            {
              endTime: "17:00",
              startTime: "09:00",
              weekday: "abc123",
            },
          ],
        },
      ],
    },
  });
  
  // Handle the result
  console.log(result)
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { escalationPathsUpdate } from "incidentio/funcs/escalationPathsUpdate.js";

// Use `IncidentioCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const incidentio = new IncidentioCore();

async function run() {
  const res = await escalationPathsUpdate(incidentio, {
    id: "01FCNDV6P870EA6S7TK1DSYDG0",
    createPathRequestBody: {
      name: "Urgent Support",
      path: [
  
      ],
      workingHours: [
        {
          id: "abc123",
          name: "abc123",
          timezone: "abc123",
          weekdayIntervals: [
            {
              endTime: "17:00",
              startTime: "09:00",
              weekday: "abc123",
            },
          ],
        },
      ],
    },
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [operations.EscalationsV2NumberUpdatePathRequest](../../models/operations/escalationsv2numberupdatepathrequest.md)                                                             | :heavy_check_mark:                                                                                                                                                             | The request object to use for the request.                                                                                                                                     |
| `options`                                                                                                                                                                      | RequestOptions                                                                                                                                                                 | :heavy_minus_sign:                                                                                                                                                             | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions`                                                                                                                                                         | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                                        | :heavy_minus_sign:                                                                                                                                                             | 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](../../lib/utils/retryconfig.md)                                                                                                                                  | :heavy_minus_sign:                                                                                                                                                             | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

### Response

**Promise\<[components.CreatePathResponseBody](../../models/components/createpathresponsebody.md)\>**

### Errors

| Error Object    | Status Code     | Content Type    |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx         | */*             |
