spotter v0.1.1 Spotter.Endpoint.Plain

Wrapper for a resource with the static path.

Link to this section Summary

Functions

Defines the plain endpoint with static path

Checks for all specified permissions from the first list in the second

Checks that the passed permissions can provide an access to the certain resource

Checking a match of the passed path with the endpoint path by exact string comparison

Returns a new instance of Spotter.Endpoint.Plain struct

Post-processing data before passing it further

Validate an input data

Link to this section Functions

Link to this function %Spotter.Endpoint.Plain{} (struct)

Defines the plain endpoint with static path.

  • :base.path - Path to the resource. For example, api.matchmaking.search. Required.
  • :base.permissions - List of permissions, required for getting an access to the resource. Default is [].
Link to this function access_granted?(required_permissions, permissions)
access_granted?(
  required_permissions :: [String.t()],
  permissions :: [String.t()]
) :: boolean()

Checks for all specified permissions from the first list in the second.

Link to this function has_permissions(endpoint, permissions)
has_permissions(endpoint :: Spotter.Endpoint.Plain, permissions :: [String.t()]) ::
  boolean()

Checks that the passed permissions can provide an access to the certain resource.

Link to this function match(endpoint, path)
match(endpoint :: Spotter.Endpoint.Plain, path :: String.t()) :: boolean()

Checking a match of the passed path with the endpoint path by exact string comparison.

Link to this function new(path, permissions)
new(path :: String.t(), permissions :: [String.t()]) :: Spotter.Endpoint.Plain

Returns a new instance of Spotter.Endpoint.Plain struct.

Link to this function transform(endpoint, data)
transform(endpoint :: any(), data :: any()) ::
  {:ok, any()} | {:error, String.t()}

Post-processing data before passing it further.

Link to this function validate(endpoint, data)
validate(endpoint :: any(), data :: any()) ::
  {:ok, any()} | {:error, String.t()}

Validate an input data.