Packages

Complete Twilio SDK for Elixir — 37 products, 494 services, 467 resources. Auto-generated from official OpenAPI specs. Finch HTTP/2, retries with jitter, webhooks, TwiML, telemetry, streaming pagination.

Current section

Files

Jump to
twilio_elixir lib twilio api v2010 authorized_connect_app_service.ex
Raw

lib/twilio/api/v2010/authorized_connect_app_service.ex

# File generated from Twilio's OpenAPI spec — do not edit manually
defmodule Twilio.Api.V2010.AuthorizedConnectAppService do
@moduledoc """
Authorized Twilio Connect apps
Operations: `list`, `fetch`
"""
alias Twilio.Client
alias Twilio.Deserializer
@doc """
Retrieve a list of authorized-connect-apps belonging to the account used to make the request
Operation: `ListAuthorizedConnectApp` | Tags: Api20100401AuthorizedConnectApp
"""
@spec list(Client.t(), map(), keyword()) ::
{:ok, Twilio.Page.t()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
def list(client, params \\ %{}, opts \\ []) do
case Client.request(
client,
:get,
"/2010-04-01/Accounts/#{client.account_sid}/AuthorizedConnectApps.json",
params: params,
opts: opts,
base_url: "https://api.twilio.com"
) do
{:ok, data} ->
page = Twilio.Page.from_response(data, "authorized_connect_apps")
{:ok,
%{
page
| items:
Deserializer.deserialize_list(
page.items,
Twilio.Resources.Api.V2010.AuthorizedConnectApp
)
}}
error ->
error
end
end
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
@doc "Stream: Retrieve a list of authorized-connect-apps belonging to the account used to make the request (lazy auto-pagination)."
@spec stream(Client.t(), map(), keyword()) :: Enumerable.t()
def stream(client, params \\ %{}, opts \\ []) do
Twilio.Page.stream(
fn page_opts ->
list(client, Map.merge(params, page_opts), opts)
end,
"authorized_connect_apps"
)
end
@doc """
Fetch an instance of an authorized-connect-app
Operation: `FetchAuthorizedConnectApp` | Tags: Api20100401AuthorizedConnectApp
"""
@spec fetch(Client.t(), String.t(), keyword()) ::
{:ok, Twilio.Resources.Api.V2010.AuthorizedConnectApp.t()}
| {:ok, map(), map()}
| :ok
| {:error, Twilio.Error.t()}
def fetch(client, sid, opts \\ []) do
with {:ok, data} <-
Client.request(
client,
:get,
"/2010-04-01/Accounts/#{client.account_sid}/AuthorizedConnectApps/#{sid}.json",
opts: opts,
base_url: "https://api.twilio.com"
) do
{:ok, Deserializer.deserialize(data, Twilio.Resources.Api.V2010.AuthorizedConnectApp)}
end
end
end