Iris.Rigging.Organization (iris v0.1.0)
This module represents the Organization in Cordage.
Attributes:
- id
- name
- display_name
- auth0_id
- responsible_id
- main_business_unit_id
Link to this section Summary
Functions
Gets the Organization from Rigging. Expects the token of the user making the request, along with the ID of the organization they are looking for.
Gets the Organization from Rigging. Expects the token of the user making the request, along with the ID of the organization they are looking for.
Link to this section Functions
all!(user_token, ids)
all(user_token, ids)
get!(user_token, id)
@spec get!(user_token :: String.t(), id :: String.t()) :: %Iris.Rigging.Organization{ auth0_id: term(), display_name: term(), id: term(), main_business_unit_id: term(), name: term(), responsible_id: term() }
Gets the Organization from Rigging. Expects the token of the user making the request, along with the ID of the organization they are looking for.
Token must not contain the "Bearer" prefix. Also, the authorization login will be enforce by Rigging.
Raises a Iris.Error.NotFoundError
if no record is matched.
Raises a Iris.Error.UnauthorizedError
if Rigging sends an "unauthorized" response.
Examples
iex> Organization.get!("my valid token", "my id")
iex> %Iris.Rigging.Organization{}
iex> Organization.get!("my valid token", "invalid id")
iex> ** Iris.Error.NotFoundError
iex> Organization.get!("my invalid token", "my id")
iex> ** Iris.Error.UnauthorizedError
get(user_token, id)
@spec get(user_token :: String.t(), id :: String.t()) :: {:ok, %Iris.Rigging.Organization{ auth0_id: term(), display_name: term(), id: term(), main_business_unit_id: term(), name: term(), responsible_id: term() }} | {:error, %Iris.Error.NotFoundError{__exception__: term(), message: term()}} | {:error, %Iris.Error.UnauthorizedError{__exception__: term(), message: term()}}
Gets the Organization from Rigging. Expects the token of the user making the request, along with the ID of the organization they are looking for.
Token must not contain the "Bearer" prefix. Also, the authorization login will be enforce by Rigging.
Examples
iex> Organization.get("my valid token", "my id")
iex> {:ok, %Iris.Rigging.Organization{}}
iex> Organization.get("my valid token", "invalid id")
iex> {:error, %Iris.Error.NotFoundError}
iex> Organization.get("my invalid token", "my id")
iex> {:error, %Iris.Error.UnauthorizedError}