EndPointBlank.Management.ApiPackages (end_point_blank_elixir v0.11.0)

Copy Markdown View Source

/api/v1/api_packages: your API packages, and what each one publishes.

A package is %{"id", "name", "organization_id", "inserted_at", "updated_at"}.

What a package publishes is a list of entries, each one endpoint of your application (or all its endpoints, when "all_endpoints" is true) in one environment: %{"id", "api_package_id", "application_id", "endpoint_id", "all_endpoints", "endpoint" => %{"id", "path", "action"} | nil, "environment_id", "inserted_at"}. Adding or removing one re-derives the grants of every client holding the package; both answer %{data: entry, warnings: [warning]}, where each warning ("code" => "assignment_derives_nothing") names a client assignment that now gives its client nothing.

Summary

Functions

Adds an endpoint to package id. attrs: application_id and environment_id (required), endpoint_id (omit or nil for every endpoint of the application). Answers %{data: entry, warnings: warnings}. Options: idempotency_key:.

Creates an API package. attrs: name (required). Options: idempotency_key:.

Deletes an API package: %{"id", "deleted" => true}. Refused with "api_package_assigned" while a client holds it.

One API package.

One page of your API packages. Options: limit:, after:.

One page of what package id publishes. Options: limit:, after:.

Removes entry access_id from package id. Answers %{data: %{"id", "deleted" => true}, warnings: warnings}.

Every API package, a page at a time. Raises EndPointBlank.Management.Error.

Renames an API package. attrs: name.

Functions

add_endpoint(client, id, attrs, opts \\ [])

@spec add_endpoint(
  EndPointBlank.Management.t(),
  String.t(),
  map() | keyword(),
  keyword()
) ::
  EndPointBlank.Management.result(%{data: map(), warnings: [map()]})

Adds an endpoint to package id. attrs: application_id and environment_id (required), endpoint_id (omit or nil for every endpoint of the application). Answers %{data: entry, warnings: warnings}. Options: idempotency_key:.

create(client, attrs, opts \\ [])

Creates an API package. attrs: name (required). Options: idempotency_key:.

delete(client, id)

Deletes an API package: %{"id", "deleted" => true}. Refused with "api_package_assigned" while a client holds it.

get(client, id)

One API package.

list(client, opts \\ [])

One page of your API packages. Options: limit:, after:.

list_endpoints(client, id, opts \\ [])

One page of what package id publishes. Options: limit:, after:.

remove_endpoint(client, id, access_id)

@spec remove_endpoint(EndPointBlank.Management.t(), String.t(), String.t()) ::
  EndPointBlank.Management.result(%{data: map(), warnings: [map()]})

Removes entry access_id from package id. Answers %{data: %{"id", "deleted" => true}, warnings: warnings}.

stream(client, opts \\ [])

@spec stream(
  EndPointBlank.Management.t(),
  keyword()
) :: Enumerable.t()

Every API package, a page at a time. Raises EndPointBlank.Management.Error.

stream_endpoints(client, id, opts \\ [])

@spec stream_endpoints(EndPointBlank.Management.t(), String.t(), keyword()) ::
  Enumerable.t()

Everything package id publishes. Raises EndPointBlank.Management.Error.

update(client, id, attrs)

Renames an API package. attrs: name.