# IncidentsV1
(*incidentsV1*)

## Overview

### Available Operations

* [~~list~~](#list) - List Incidents V1 :warning: **Deprecated**
* [~~create~~](#create) - Create Incidents V1 :warning: **Deprecated**
* [~~get~~](#get) - Show Incidents V1 :warning: **Deprecated**

## ~~list~~

List all incidents for an organisation.

> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.

### Example Usage

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

const incidentio = new Incidentio();

async function run() {
  const result = await incidentio.incidentsV1.list({
    pageSize: 25,
    after: "01FDAG4SAP5TYPT98WGR2N7W91",
    status: [
      "declined",
    ],
  });
  
  // Handle the result
  console.log(result)
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { incidentsV1List } from "incidentio/funcs/incidentsV1List.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 incidentsV1List(incidentio, {
    pageSize: 25,
    after: "01FDAG4SAP5TYPT98WGR2N7W91",
    status: [
      "declined",
    ],
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [operations.IncidentsV1NumberListRequest](../../models/operations/incidentsv1numberlistrequest.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.ListResponseBody14](../../models/components/listresponsebody14.md)\>**

### Errors

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


## ~~create~~

Create a new incident.

> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.

### Example Usage

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

const incidentio = new Incidentio();

async function run() {
  const result = await incidentio.incidentsV1.create({
    customFieldEntries: [
      {
        customFieldId: "01FCNDV6P870EA6S7TK1DSYDG0",
        values: [
          {
            id: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueCatalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueLink: "https://google.com/",
            valueNumeric: "123.456",
            valueOptionId: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueText: "This is my text field, I hope you like it",
            valueTimestamp: "",
          },
        ],
      },
    ],
    idempotencyKey: "alert-uuid",
    incidentRoleAssignments: [
      {
        assignee: {
          email: "bob@example.com",
          id: "01G0J1EXE7AXZ2C93K61WBPYEH",
          slackUserId: "USER123",
        },
        incidentRoleId: "01FH5TZRWMNAFB0DZ23FD1TV96",
      },
    ],
    incidentTypeId: "01FH5TZRWMNAFB0DZ23FD1TV96",
    mode: "real",
    name: "Our database is sad",
    severityId: "01FH5TZRWMNAFB0DZ23FD1TV96",
    slackTeamId: "T02A1FSLE8J",
    sourceMessageChannelId: "C02AW36C1M5",
    sourceMessageTimestamp: "1653650280.526509",
    status: "triage",
    summary: "Our database is really really sad, and we don't know why yet.",
    visibility: "public",
  });
  
  // Handle the result
  console.log(result)
}

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { incidentsV1Create } from "incidentio/funcs/incidentsV1Create.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 incidentsV1Create(incidentio, {
    customFieldEntries: [
      {
        customFieldId: "01FCNDV6P870EA6S7TK1DSYDG0",
        values: [
          {
            id: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueCatalogEntryId: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueLink: "https://google.com/",
            valueNumeric: "123.456",
            valueOptionId: "01FCNDV6P870EA6S7TK1DSYDG0",
            valueText: "This is my text field, I hope you like it",
            valueTimestamp: "",
          },
        ],
      },
    ],
    idempotencyKey: "alert-uuid",
    incidentRoleAssignments: [
      {
        assignee: {
          email: "bob@example.com",
          id: "01G0J1EXE7AXZ2C93K61WBPYEH",
          slackUserId: "USER123",
        },
        incidentRoleId: "01FH5TZRWMNAFB0DZ23FD1TV96",
      },
    ],
    incidentTypeId: "01FH5TZRWMNAFB0DZ23FD1TV96",
    mode: "real",
    name: "Our database is sad",
    severityId: "01FH5TZRWMNAFB0DZ23FD1TV96",
    slackTeamId: "T02A1FSLE8J",
    sourceMessageChannelId: "C02AW36C1M5",
    sourceMessageTimestamp: "1653650280.526509",
    status: "triage",
    summary: "Our database is really really sad, and we don't know why yet.",
    visibility: "public",
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [components.CreateRequestBody10](../../models/components/createrequestbody10.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.ShowResponseBody12](../../models/components/showresponsebody12.md)\>**

### Errors

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


## ~~get~~

Get a single incident.

> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.

### Example Usage

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

const incidentio = new Incidentio();

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

run();
```

### Standalone function

The standalone function version of this method:

```typescript
import { IncidentioCore } from "incidentio/core.js";
import { incidentsV1Get } from "incidentio/funcs/incidentsV1Get.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 incidentsV1Get(incidentio, {
    id: "01FDAG4SAP5TYPT98WGR2N7W91",
  });

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

  const { value: result } = res;

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

run();
```

### Parameters

| Parameter                                                                                                                                                                      | Type                                                                                                                                                                           | Required                                                                                                                                                                       | Description                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`                                                                                                                                                                      | [operations.IncidentsV1NumberShowRequest](../../models/operations/incidentsv1numbershowrequest.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.ShowResponseBody12](../../models/components/showresponsebody12.md)\>**

### Errors

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