Modules

hex_api_key hex_api_package hex_api_package_owner hex_api_release hex_api_user hex_core hex_http hex_pb_names hex_pb_package hex_pb_signed hex_pb_versions hex_registry hex_repo hex_tarball

Module hex_api_organization_member

Data Types

role()


role() = admin | write | read

Function Index

add/3 Adds an organization member.
delete/2 Deletes an organization member.
get/2 Gets an organization member.
list/1 Lists the organization's members.
update/3 Updates an organization member's role.

Function Details

add/3


add(Config::hex_core:config(), UsernameOrEmail::binary(), Role::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">>
       }}}

delete/2


delete(Config::hex_core:config(), UsernameOrEmail::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}}

get/2


get(Config::hex_core:config(), UsernameOrEmail::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">>
       }}}

list/1


list(Config::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">>
       }]}}

update/3


update(Config::hex_core:config(), UsernameOrEmail::binary(), Role::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">>
       }}}