Cyphi.Organizations (Cyphi v0.1.0)
Provides API endpoints related to organizations
Summary
Functions
List organization courses
List organization course templates
Create organization
Create organizations
Delete organization
Get organization
List organizations
Update organization
Update organizations
List organization groups
Add suborganization
Add suborganizations
Delete suborganization
List suborganizations
List organization users
Types
@type organization_course_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type organization_course_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type organization_course_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type organization_course_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type organization_course_template_crud_list_400_json_resp() :: %{ message: String.t() | nil }
@type organization_course_template_crud_list_403_json_resp() :: %{ message: String.t() | nil }
@type organization_course_template_crud_list_404_json_resp() :: %{ message: String.t() | nil }
@type organization_course_template_crud_list_405_json_resp() :: %{ message: String.t() | nil }
@type organization_crud_create_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_batch_202_json_resp() :: %{batch_id: integer() | nil}
@type organization_crud_create_batch_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_batch_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_batch_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_create_batch_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_delete_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_delete_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_delete_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_delete_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_get_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_get_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_get_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_get_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_405_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_batch_202_json_resp() :: %{batch_id: integer() | nil}
@type organization_crud_update_batch_400_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_batch_403_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_batch_404_json_resp() :: %{message: String.t() | nil}
@type organization_crud_update_batch_405_json_resp() :: %{message: String.t() | nil}
@type organization_group_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type organization_group_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type organization_group_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type organization_group_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type organization_suborganization_crud_create_400_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_403_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_404_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_405_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_batch_202_json_resp() :: %{ batch_id: integer() | nil }
@type organization_suborganization_crud_create_batch_400_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_batch_403_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_batch_404_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_create_batch_405_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_delete_400_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_delete_403_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_delete_404_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_delete_405_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_list_400_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_list_403_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_list_404_json_resp() :: %{ message: String.t() | nil }
@type organization_suborganization_crud_list_405_json_resp() :: %{ message: String.t() | nil }
@type organization_user_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type organization_user_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type organization_user_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type organization_user_crud_list_405_json_resp() :: %{message: String.t() | nil}
Functions
@spec organization_course_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.Course.t()]} | {:error, organization_course_crud_list_400_json_resp() | organization_course_crud_list_403_json_resp() | organization_course_crud_list_404_json_resp() | organization_course_crud_list_405_json_resp()}
List organization courses
Return a list of the courses in the specified organization. By default, it lists courses that are not archived.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: archived (default: false), organization_id, id, name, course_code, sis_id, sis_pid, path, tags, metadata.creator_id, metadata.created_at, metadata.language.$include: Comma separated list of relationships to include in the results, taken from this list: parent, current_module, organization.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec organization_course_template_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.CourseTemplate.t()]} | {:error, organization_course_template_crud_list_400_json_resp() | organization_course_template_crud_list_403_json_resp() | organization_course_template_crud_list_404_json_resp() | organization_course_template_crud_list_405_json_resp()}
List organization course templates
Return a list of the course templates in the specified organization.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: organization_id, id, name, course_code, sis_id, sis_pid, path, tags, metadata.creator_id, metadata.created_at, metadata.language.$include: Comma separated list of relationships to include in the results, taken from this list: organization.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec organization_crud_create(body :: map(), opts :: keyword()) :: {:ok, Cyphi.Organization.t()} | {:error, organization_crud_create_400_json_resp() | organization_crud_create_403_json_resp() | organization_crud_create_404_json_resp() | organization_crud_create_405_json_resp()}
Create organization
Create an organization.
An optional position=setting option may be used to specify the location of the new organization. Here are the available options for the setting, and if a position is not specified, it is AtEnd by default:
- AtStart
- Added as the first organization
- AtEnd
- Added as the last organization
- AfterOrg:ID
- Added after the organization with the specified ID
- BeforeOrg:ID
- Added before the organization with the specified ID
- FirstChildOfOrg:ID
- Added as the first child of the organization with the specified ID
- LastChildOfOrg:ID
- Added as the last child of the organization with the specified ID
Options
$options: Valid options are: position
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_crud_create_batch(body :: [map()], opts :: keyword()) :: {:ok, organization_crud_create_batch_202_json_resp()} | {:error, organization_crud_create_batch_400_json_resp() | organization_crud_create_batch_403_json_resp() | organization_crud_create_batch_404_json_resp() | organization_crud_create_batch_405_json_resp()}
Create organizations
Create up to 50 organizations using a batch job.
An optional position=setting option may be used to specify the location of the new organizations. Here are the available options for the setting, and if a position is not specified, it is AtEnd by default:
- AtStart
- Added as the first organization
- AtEnd
- Added as the last organization
- AfterOrg:ID
- Added after the organization with the specified ID
- BeforeOrg:ID
- Added before the organization with the specified ID
- FirstChildOfOrg:ID
- Added as the first child of the organization with the specified ID
- LastChildOfOrg:ID
- Added as the last child of the organization with the specified ID
Options
$options: Valid options are: position
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_crud_delete(id :: integer(), opts :: keyword()) :: :ok | {:error, organization_crud_delete_400_json_resp() | organization_crud_delete_403_json_resp() | organization_crud_delete_404_json_resp() | organization_crud_delete_405_json_resp()}
Delete organization
Delete the organization with the specified ID.
@spec organization_crud_get(id :: integer(), opts :: keyword()) :: {:ok, Cyphi.Organization.t()} | {:error, organization_crud_get_400_json_resp() | organization_crud_get_403_json_resp() | organization_crud_get_404_json_resp() | organization_crud_get_405_json_resp()}
Get organization
Return the organization with the specified ID.
Options
$include: Comma separated list of relationships to include in the results, taken from this list: parent.
@spec organization_crud_list(opts :: keyword()) :: {:ok, [Cyphi.Organization.t()]} | {:error, organization_crud_list_400_json_resp() | organization_crud_list_403_json_resp() | organization_crud_list_404_json_resp() | organization_crud_list_405_json_resp()}
List organizations
Return a list of organizations.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: tags, parent_id, id, name.$include: Comma separated list of relationships to include in the results, taken from this list: parent.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec organization_crud_update(id :: integer(), body :: map(), opts :: keyword()) :: {:ok, Cyphi.Organization.t()} | {:error, organization_crud_update_400_json_resp() | organization_crud_update_403_json_resp() | organization_crud_update_404_json_resp() | organization_crud_update_405_json_resp()}
Update organization
Update the organization with the specified ID. Note that if you update the parent_id of an organization, the organization is added as the last child of its new parent.
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_crud_update_batch(body :: [map()], opts :: keyword()) :: {:ok, organization_crud_update_batch_202_json_resp()} | {:error, organization_crud_update_batch_400_json_resp() | organization_crud_update_batch_403_json_resp() | organization_crud_update_batch_404_json_resp() | organization_crud_update_batch_405_json_resp()}
Update organizations
Update up to 50 organizations using a batch job. Note that if you update the parent_id of an organization, the organization is added as the last child of its new parent.
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_group_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.Group.t()]} | {:error, organization_group_crud_list_400_json_resp() | organization_group_crud_list_403_json_resp() | organization_group_crud_list_404_json_resp() | organization_group_crud_list_405_json_resp()}
List organization groups
Return a list of the groups in the specified organization.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id, name, visibility, tags, container_type, metadata.creator_id, metadata.created_at, metadata.language.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec organization_suborganization_crud_create( id :: integer(), body :: map(), opts :: keyword() ) :: {:ok, Cyphi.Organization.t()} | {:error, organization_suborganization_crud_create_400_json_resp() | organization_suborganization_crud_create_403_json_resp() | organization_suborganization_crud_create_404_json_resp() | organization_suborganization_crud_create_405_json_resp()}
Add suborganization
Create an organization that is a suborganizations of the specified organization.
An optional position=setting option may be used to specify the location of the new organization. Here are the available options for the setting, and if a position is not specified, it is LastChildOfOrg by default:
- FirstChildOfOrg
- Added as the first child of the organization
- LastChildOfOrg
- Added as the last child of the organization
Options
$options: Valid options are: position
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_suborganization_crud_create_batch( id :: integer(), body :: [map()], opts :: keyword() ) :: {:ok, organization_suborganization_crud_create_batch_202_json_resp()} | {:error, organization_suborganization_crud_create_batch_400_json_resp() | organization_suborganization_crud_create_batch_403_json_resp() | organization_suborganization_crud_create_batch_404_json_resp() | organization_suborganization_crud_create_batch_405_json_resp()}
Add suborganizations
Create up to 50 organizations that are suborganizations of the specified organization using a batch job.
An optional position=setting option may be used to specify the location of the organizations. Here are the available options for the setting, and if a position is not specified, it is LastChildOfOrg by default:
- FirstChildOfOrg
- Added as the first child of the organization
- LastChildOfOrg
- Added as the last child of the organization
Options
$options: Valid options are: position
Request Body
Content Types: application/json
Here is the format of a request.
@spec organization_suborganization_crud_delete( id :: integer(), suborganization_id :: integer(), opts :: keyword() ) :: :ok | {:error, organization_suborganization_crud_delete_400_json_resp() | organization_suborganization_crud_delete_403_json_resp() | organization_suborganization_crud_delete_404_json_resp() | organization_suborganization_crud_delete_405_json_resp()}
Delete suborganization
Delete the suborganization with the specified ID.
@spec organization_suborganization_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.Organization.t()]} | {:error, organization_suborganization_crud_list_400_json_resp() | organization_suborganization_crud_list_403_json_resp() | organization_suborganization_crud_list_404_json_resp() | organization_suborganization_crud_list_405_json_resp()}
List suborganizations
Return a list of organization suborganizations.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: tags, parent_id, id, name.$include: Comma separated list of relationships to include in the results, taken from this list: parent.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec organization_user_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.User.t()]} | {:error, organization_user_crud_list_400_json_resp() | organization_user_crud_list_403_json_resp() | organization_user_crud_list_404_json_resp() | organization_user_crud_list_405_json_resp()}
List organization users
Return a list of the users in the specified organization. By default it lists users that are not archived.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: organization_id, job_title_id, manager_id, added_by_id, id, userid, first_name, last_name, roles, email, mobile_phone, learnerID, instructorID, joined_at, last_login_at, sis_id, sis_pid, archived (default: false), tags.$include: Comma separated list of relationships to include in the results, taken from this list: organization, archiver, job_title, manager, added_by.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, userid, first_name, last_name, email, learnerID, instructorID, sis_id, sis_pid. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.