View Source hex_api_organization (hex_core v0.10.0)

Hex HTTP API - Organizations.

Link to this section Summary

Functions

Gets an organzation.

Lists all organizations you are member of.

Updates the number of seats in an organzation.

Link to this section Functions

-spec get(hex_core:config()) -> hex_api:response().

Gets an organzation.

Examples:

  > hex_api_organization:get(hex_core:default_config(), #{api_organization => <<"acme">>}).
  {ok, {200, ..., #{
       <<"billing_active">> => true,
       <<"inserted_at">> => <<"2017-08-22T22:19:53Z">>,
       <<"name">> => <<"acme">>,
       <<"seats">> => 42,
       <<"updated_at">> => <<"2019-01-18T08:47:29Z">>}
       }}}
-spec list(hex_core:config()) -> hex_api:response().

Lists all organizations you are member of.

Examples:

  > hex_api_organization:list(hex_core:default_config(), #{api_organization => <<"acme">>}).
  {ok, {200, ..., [#{
       <<"billing_active">> => true,
       <<"inserted_at">> => <<"2017-08-22T22:19:53Z">>,
       <<"name">> => <<"acme">>,
       <<"updated_at">> => <<"2019-01-18T08:47:29Z">>}
       }]}}
-spec update(hex_core:config(), pos_integer()) -> hex_api:response().

Updates the number of seats in an organzation.

Examples:

  > hex_api_organization:get(hex_core:default_config(), #{api_organization => <<"acme">>}, 42).
  {ok, {200, ..., #{
       <<"billing_active">> => true,
       <<"inserted_at">> => <<"2017-08-22T22:19:53Z">>,
       <<"name">> => <<"acme">>,
       <<"seats">> => 42,
       <<"updated_at">> => <<"2019-01-18T08:47:29Z">>}
       }}}