You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 regels
974 B

  1. %% Vendored from hex_core v0.5.1, do not edit manually
  2. -module(r3_hex_api_key).
  3. -export([
  4. list/1,
  5. get/2,
  6. add/3,
  7. delete/2,
  8. delete_all/1
  9. ]).
  10. list(Config) when is_map(Config) ->
  11. Path = r3_hex_api:build_organization_path(Config, ["keys"]),
  12. r3_hex_api:get(Config, Path).
  13. get(Config, Name) when is_map(Config) ->
  14. Path = r3_hex_api:build_organization_path(Config, ["keys", Name]),
  15. r3_hex_api:get(Config, Path).
  16. add(Config, Name, Permissions) when is_map(Config) ->
  17. Path = r3_hex_api:build_organization_path(Config, ["keys"]),
  18. Params = #{<<"name">> => Name, <<"permissions">> => Permissions},
  19. r3_hex_api:post(Config, Path, Params).
  20. delete(Config, Name) when is_map(Config) ->
  21. Path = r3_hex_api:build_organization_path(Config, ["keys", Name]),
  22. r3_hex_api:delete(Config, Path).
  23. delete_all(Config) when is_map(Config) ->
  24. Path = r3_hex_api:build_organization_path(Config, ["keys"]),
  25. r3_hex_api:delete(Config, Path).