View Source ExNylas.Connectors (ExNylas v0.9.0)
Interface for Nylas connector.
Summary
Functions
Fetch all connector(s) matching the provided query (the SDK will handle paging).
Fetch all connector(s) matching the provided query (the SDK will handle paging).
Create and validate a connector, use create/update to send to Nylas.
Create and validate a connector, use create/update to send to Nylas.
Create a(n) connector.
Create a(n) connector.
Delete a(n) connector.
Delete a(n) connector.
Find a(n) connector.
Find a(n) connector.
Get the first connector.
Get the first connector.
Fetch connector(s), optionally provide query params.
Fetch connector(s), optionally provide query params.
Update a(n) connector.
Update a(n) connector.
Functions
@spec all(ExNylas.Connection.t(), Keyword.t() | map()) :: {:ok, [struct()]} | {:error, ExNylas.Response.t()}
Fetch all connector(s) matching the provided query (the SDK will handle paging).
The second argument can be a keyword list of options + query parameters to pass to the Nylas API (map is also supported). Options supports:
:send_to
- a single arity function to send each page of results (default is nil, e.g. results will be accumulated and returned as a list):delay
- the number of milliseconds to wait between each page request (default is 0; strongly recommended to avoid rate limiting):query
- a keyword list or map of query parameters to pass to the Nylas API (default is an empty list)
Examples
iex> opts = [send_to: &IO.inspect/1, delay: 3_000, query: [key: "value"]]
iex> {:ok, result} = ExNylas.Connectors.all(conn, opts)
@spec all!(ExNylas.Connection.t(), Keyword.t() | map()) :: [struct()]
Fetch all connector(s) matching the provided query (the SDK will handle paging).
The second argument can be a keyword list of options + query parameters to pass to the Nylas API (map is also supported). Options supports:
:send_to
- a single arity function to send each page of results (default is nil, e.g. results will be accumulated and returned as a list):delay
- the number of milliseconds to wait between each page request (default is 0; strongly recommended to avoid rate limiting):query
- a keyword list or map of query parameters to pass to the Nylas API (default is an empty list)
Examples
iex> opts = [send_to: &IO.inspect/1, delay: 3_000, query: [key: "value"]]
iex> result = ExNylas.Connectors.all!(conn, opts)
@spec build(map() | struct()) :: {:ok, struct()} | {:error, Ecto.Changeset.t()}
Create and validate a connector, use create/update to send to Nylas.
Examples
iex> {:ok, result} = ExNylas.Connectors.build(payload)
Create and validate a connector, use create/update to send to Nylas.
Examples
iex> result = ExNylas.Connectors.build!(payload)
@spec create(ExNylas.Connection.t(), map(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Create a(n) connector.
Examples
iex> {:ok, result} = ExNylas.Connectors.create(conn, body, params)
@spec create!(ExNylas.Connection.t(), map(), Keyword.t() | map()) :: ExNylas.Response.t()
Create a(n) connector.
Examples
iex> result = ExNylas.Connectors.create(conn, body, params)
@spec delete(ExNylas.Connection.t(), String.t(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Delete a(n) connector.
Examples
iex> {:ok, result} = ExNylas.Connectors.delete(conn, id, params)
@spec delete!(ExNylas.Connection.t(), String.t(), Keyword.t() | map()) :: ExNylas.Response.t()
Delete a(n) connector.
Examples
iex> result = ExNylas.Connectors.delete!(conn, id, params)
@spec find(ExNylas.Connection.t(), String.t(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Find a(n) connector.
Examples
iex> {:ok, result} = ExNylas.Connectors.find(conn, id, params)
@spec find!(ExNylas.Connection.t(), String.t(), Keyword.t() | map()) :: ExNylas.Response.t()
Find a(n) connector.
Examples
iex> result = ExNylas.Connectors.find!(conn, id, params)
@spec first(ExNylas.Connection.t(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Get the first connector.
Examples
iex> {:ok, result} = ExNylas.Connectors.first(conn, params)
@spec first!(ExNylas.Connection.t(), Keyword.t() | map()) :: ExNylas.Response.t()
Get the first connector.
Examples
iex> result = ExNylas.Connectors.first!(conn, params)
@spec list(ExNylas.Connection.t(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Fetch connector(s), optionally provide query params.
Examples
iex> {:ok, result} = ExNylas.Connectors.list(conn, params)
@spec list!(ExNylas.Connection.t(), Keyword.t() | map()) :: ExNylas.Response.t()
Fetch connector(s), optionally provide query params.
Examples
iex> result = ExNylas.Connectors.list!(conn, params)
@spec update(ExNylas.Connection.t(), String.t(), map(), Keyword.t() | map()) :: {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}
Update a(n) connector.
Examples
iex> {:ok, result} = ExNylas.Connectors.update(conn, id, body, params)
@spec update!(ExNylas.Connection.t(), String.t(), map(), Keyword.t() | map()) :: ExNylas.Response.t()
Update a(n) connector.
Examples
iex> result = ExNylas.Connectors.update!(conn, id, body, params)