hex_api_package_owner (hex_core v0.8.0) View Source

HTTP API - Package Owners.

Link to this section Summary

Link to this section Functions

Link to this function

add(Config, PackageName, UsernameOrEmail, Level, Transfer)

View Source

Specs

add(hex_core:config(), binary(), binary(), binary(), boolean()) -> hex_api:response().

Adds a packages owner.

Examples:

  > hex_api_package_owner:add(hex_core:default_config(), <<"package">>, <<"user">>, <<"full">>, false).
  {ok, {200, ..., #{
       <<"email">> => <<"user@example.com">>,
       <<"full_name">> => <<"John Doe">>,
       <<"handles">> => #{...},
       <<"inserted_at">> => <<"2014-04-21T17:20:12Z">>,
       <<"level">> => <<"full">>,
       <<"updated_at">> => <<"2019-08-04T19:28:05Z">>,
       <<"url">> => <<"https://hex.pm/api/users/user">>,
       <<"username">> => <<"user">>
       }}}
Link to this function

delete(Config, PackageName, UsernameOrEmail)

View Source

Specs

delete(hex_core:config(), binary(), binary()) -> hex_api:response().

Deletes a packages owner.

Examples:

  > hex_api_package_owner:delete(hex_core:default_config(), <<"package">>, <<"user">>).
  {ok, {204, ..., nil}}
Link to this function

get(Config, PackageName, UsernameOrEmail)

View Source

Specs

get(hex_core:config(), binary(), binary()) -> hex_api:response().

Gets a packages owner.

Examples:

  > hex_api_package_owner:get(hex_core:default_config(), <<"package">>, <<"user">>).
  {ok, {200, ..., #{
       <<"email">> => <<"user@example.com">>,
       <<"full_name">> => <<"John Doe">>,
       <<"handles">> => #{...},
       <<"inserted_at">> => <<"2014-04-21T17:20:12Z">>,
       <<"level">> => <<"full">>,
       <<"updated_at">> => <<"2019-08-04T19:28:05Z">>,
       <<"url">> => <<"https://hex.pm/api/users/user">>,
       <<"username">> => <<"user">>
       }}}
Link to this function

list(Config, PackageName)

View Source

Specs

list(hex_core:config(), binary()) -> hex_api:response().

Lists the packages owners.

Examples:

  > hex_api_package_owner:list(hex_core:default_config(), <<"package">>).
  {ok, {200, ..., [#{
       <<"email">> => <<"user@example.com">>,
       <<"full_name">> => <<"John Doe">>,
       <<"handles">> => #{...},
       <<"inserted_at">> => <<"2014-04-21T17:20:12Z">>,
       <<"level">> => <<"full">>,
       <<"updated_at">> => <<"2019-08-04T19:28:05Z">>,
       <<"url">> => <<"https://hex.pm/api/users/user">>,
       <<"username">> => <<"user">>
       }]}}