OpenCode.Generated.Integrations (opencode_sdk v0.1.88)

Copy Markdown View Source

Provides API endpoints related to integrations

Summary

Types

v2_integration_attempt_status_200_json_resp()

@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()

@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()

@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()

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

v2_integration_get_200_json_resp()

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

v2_integration_list_200_json_resp()

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

Functions

v2_integration_attempt_cancel(attemptID, opts \\ [])

@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(attemptID, body, opts \\ [])

@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(attemptID, opts \\ [])

@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(integrationID, body, opts \\ [])

@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(integrationID, body, opts \\ [])

@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(integrationID, opts \\ [])

@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(opts \\ [])

List integrations

Retrieve available integrations and their authentication methods.

Options

  • location