# `OpenCode.Generated.Integrations`
[🔗](https://github.com/UtkarshUsername/opencode-sdk-elixir/blob/v0.1.90/lib/opencode/generated/integrations.ex#L1)

Provides API endpoints related to integrations

# `v2_integration_attempt_status_200_json_resp`

```elixir
@type v2_integration_attempt_status_200_json_resp() :: %{
  data: v2_integration_attempt_status_200_json_resp_data(),
  location: OpenCode.Generated.LocationInfo.t()
}
```

# `v2_integration_attempt_status_200_json_resp_data`

```elixir
@type v2_integration_attempt_status_200_json_resp_data() :: %{
  message: String.t(),
  status: String.t(),
  time: v2_integration_attempt_status_200_json_resp_data_time()
}
```

# `v2_integration_attempt_status_200_json_resp_data_time`

```elixir
@type v2_integration_attempt_status_200_json_resp_data_time() :: %{
  created: number() | String.t(),
  expires: number() | String.t()
}
```

# `v2_integration_connect_oauth_200_json_resp`

```elixir
@type v2_integration_connect_oauth_200_json_resp() :: %{
  data: OpenCode.Generated.IntegrationAttempt.t(),
  location: OpenCode.Generated.LocationInfo.t()
}
```

# `v2_integration_get_200_json_resp`

```elixir
@type v2_integration_get_200_json_resp() :: %{
  data: OpenCode.Generated.IntegrationInfo.t(),
  location: OpenCode.Generated.LocationInfo.t()
}
```

# `v2_integration_list_200_json_resp`

```elixir
@type v2_integration_list_200_json_resp() :: %{
  data: [OpenCode.Generated.IntegrationInfo.t()],
  location: OpenCode.Generated.LocationInfo.t()
}
```

# `v2_integration_attempt_cancel`

```elixir
@spec v2_integration_attempt_cancel(attemptID :: String.t(), opts :: keyword()) ::
  :ok
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Cancel OAuth connection

Cancel an OAuth attempt and release its resources.

## Options

  * `location`

# `v2_integration_attempt_complete`

```elixir
@spec v2_integration_attempt_complete(
  attemptID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  :ok
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Complete OAuth connection

Complete a code-based OAuth attempt and store the resulting credential.

## Options

  * `location`

## Request Body

**Content Types**: `application/json`

# `v2_integration_attempt_status`

```elixir
@spec v2_integration_attempt_status(attemptID :: String.t(), opts :: keyword()) ::
  {:ok, v2_integration_attempt_status_200_json_resp()}
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Get OAuth attempt status

Poll the current status of an OAuth attempt.

## Options

  * `location`

# `v2_integration_connect_key`

```elixir
@spec v2_integration_connect_key(
  integrationID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  :ok
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Connect with key

Run a key authentication method and store the resulting credential.

## Options

  * `location`

## Request Body

**Content Types**: `application/json`

# `v2_integration_connect_oauth`

```elixir
@spec v2_integration_connect_oauth(
  integrationID :: String.t(),
  body :: map(),
  opts :: keyword()
) ::
  {:ok, v2_integration_connect_oauth_200_json_resp()}
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Begin OAuth connection

Start an OAuth attempt and return the authorization details.

## Options

  * `location`

## Request Body

**Content Types**: `application/json`

# `v2_integration_get`

```elixir
@spec v2_integration_get(integrationID :: String.t(), opts :: keyword()) ::
  {:ok, v2_integration_get_200_json_resp()}
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

Get integration

Retrieve one integration and its authentication methods.

## Options

  * `location`

# `v2_integration_list`

```elixir
@spec v2_integration_list(opts :: keyword()) ::
  {:ok, v2_integration_list_200_json_resp()}
  | {:error,
     OpenCode.Generated.InvalidRequestError.t()
     | OpenCode.Generated.UnauthorizedError.t()}
```

List integrations

Retrieve available integrations and their authentication methods.

## Options

  * `location`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
