Polarex.Members (Polarex v0.3.1)

Copy Markdown View Source

Provides API endpoints related to members

Summary

Functions

customer_portal_members_add_member(body, opts \\ [])

@spec customer_portal_members_add_member(
  body :: Polarex.CustomerPortalMemberCreate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerPortalMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Add Member

Add a new member to the customer's team.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot add a member with the owner role (there must be exactly one owner)
  • If a member with this email already exists, the existing member is returned

Request Body

Content Types: application/json

customer_portal_members_list_members(opts \\ [])

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

List Members

List all members of the customer's team.

Only available to owners and billing managers of team customers.

Options

  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

customer_portal_members_remove_member(id, opts \\ [])

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

Remove Member

Remove a member from the team.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot remove yourself
  • Cannot remove the only owner

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

@spec customer_portal_members_update_member(
  id :: String.t(),
  body :: Polarex.CustomerPortalMemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.CustomerPortalMember.t()}
  | {:error, Polarex.HTTPValidationError.t()}

Update Member

Update a member's role.

Only available to owners and billing managers of team customers.

Rules:

  • Cannot modify your own role (to prevent self-demotion)
  • Customer must have exactly one owner at all times

Request Body

Content Types: application/json

members_create_member(body, opts \\ [])

@spec members_create_member(body :: Polarex.MemberCreate.t(), opts :: keyword()) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Create Member

Create a new member for a customer.

Only B2B customers with the member management feature enabled can add members. The authenticated user or organization must have access to the customer's organization.

Scopes: members:write

Request Body

Content Types: application/json

members_delete_member(id, opts \\ [])

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

Delete Member

Delete a member.

The authenticated user or organization must have access to the member's organization.

Scopes: members:write

members_delete_member_by_external_id(external_id, opts \\ [])

@spec members_delete_member_by_external_id(
  external_id :: String.t(),
  opts :: keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Delete Member by External ID

Delete a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

members_get_member(id, opts \\ [])

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

Get Member

Get a member by ID.

The authenticated user or organization must have access to the member's organization.

Scopes: members:read members:write

members_get_member_by_external_id(external_id, opts \\ [])

@spec members_get_member_by_external_id(external_id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get Member by External ID

Get a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:read members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

members_list_members(opts \\ [])

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

List Members

List members with optional customer ID filter.

Scopes: members:read members:write

Options

  • customer_id: Filter by customer ID.
  • external_customer_id: Filter by customer external ID.
  • role: Filter by member role.
  • 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.

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

@spec members_update_member(
  id :: String.t(),
  body :: Polarex.MemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Member

Update a member.

Only name and role can be updated. The authenticated user or organization must have access to the member's organization.

Scopes: members:write

Request Body

Content Types: application/json

members_update_member_by_external_id(external_id, body, opts \\ [])

@spec members_update_member_by_external_id(
  external_id :: String.t(),
  body :: Polarex.MemberUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.Member.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Update Member by External ID

Update a member by external ID. One of customer_id or external_customer_id must be specified.

Scopes: members:write

Options

  • customer_id: The customer ID.
  • external_customer_id: The customer external ID.

Request Body

Content Types: application/json