hex_api_organization_member (hex_core v0.7.1) View Source
Link to this section Summary
Functions
Adds an organization member.
Deletes an organization member.
Gets an organization member.
Lists the organization's members.
Updates an organization member's role.
Link to this section Types
Specs
role() :: :admin | :write | :read
Link to this section Functions
Specs
add(:hex_core.config(), binary(), role()) :: :hex_api.response()
Adds an organization member.
Examples:
> hex_api_organization_member:add(hex_core:default_config()#{api_organization => <<"acme">>}, <<"user">>, write). {ok, {200, ..., #{ <<"email">> => <<"user@example.com">>, <<"role">> => <<"write">>, <<"url">> => <<"https://hex.pm/api/users/user">>, <<"username">> => <<"user">> }}}
Specs
delete(:hex_core.config(), binary()) :: :hex_api.response()
Deletes an organization member.
Examples:
> hex_api_organization_member:delete(hex_core:default_config()#{api_organization => <<"acme">>}, <<"user">>). {ok, {204, ..., nil}}
Specs
get(:hex_core.config(), binary()) :: :hex_api.response()
Gets an organization member.
Examples:
> hex_api_organization_member:get(hex_core:default_config()#{api_organization => <<"acme">>}, <<"user">>). {ok, {200, ..., #{ <<"email">> => <<"user@example.com">>, <<"role">> => <<"admin">>, <<"url">> => <<"https://hex.pm/api/users/user">>, <<"username">> => <<"user">> }}}
Specs
list(:hex_core.config()) :: :hex_api.response()
Lists the organization's members.
Examples:
> hex_api_organization_member:list(hex_core:default_config()#{api_organization => <<"acme">>}). {ok, {200, ..., [#{ <<"email">> => <<"user@example.com">>, <<"role">> => <<"admin">>, <<"url">> => <<"https://hex.pm/api/users/user">>, <<"username">> => <<"user">> }]}}
Specs
update(:hex_core.config(), binary(), role()) :: :hex_api.response()
Updates an organization member's role.
Examples:
> hex_api_organization_member:update(hex_core:default_config()#{api_organization => <<"acme">>}, <<"user">>, read). {ok, {200, ..., #{ <<"email">> => <<"user@example.com">>, <<"role">> => <<"read">>, <<"url">> => <<"https://hex.pm/api/users/user">>, <<"username">> => <<"user">> }}}