Polarex.Organizations (Polarex v0.3.2)

Copy Markdown View Source

Provides API endpoints related to organizations

Summary

Functions

customer_portal_organizations_get(slug, opts \\ [])

@spec customer_portal_organizations_get(slug :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.CustomerOrganizationData.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Organization

Get a customer portal's organization by slug.

organizations_create(body, opts \\ [])

@spec organizations_create(body :: Polarex.OrganizationCreate.t(), opts :: keyword()) ::
  {:ok, Polarex.Organization.t()} | {:error, Polarex.HTTPValidationError.t()}

Create Organization

Create an organization.

Scopes: organizations:write

Request Body

Content Types: application/json

organizations_get(id, opts \\ [])

@spec organizations_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Organization.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Organization

Get an organization by ID.

organizations_list(opts \\ [])

@spec organizations_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceOrganization.t()}
  | {:error, Polarex.HTTPValidationError.t()}

List Organizations

List organizations.

Scopes: organizations:read organizations:write

Options

  • slug: Filter by slug.
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.
  • sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.

organizations_update(id, body, opts \\ [])

@spec organizations_update(
  id :: String.t(),
  body :: Polarex.OrganizationUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Organization.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Update Organization

Update an organization.

Request Body

Content Types: application/json