OpenApiTypesense.Keys (OpenApiTypesense v0.6.5)
View SourceProvides API endpoints related to keys
Summary
Functions
Create an API Key
Either one of
Either one of
Delete an API key given its ID.
Either one of
Either one of
Retrieve (metadata about) a key
Either one of
Either one of
Retrieve (metadata about) all keys.
Either one of
Either one of
Functions
@spec create_key(map()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Create an API Key
Create an API Key with fine-grain access control. You can restrict access on both a per-collection and per-action level. The generated key is returned only during creation. You want to store this key carefully in a secure place.
@spec create_key(map() | OpenApiTypesense.Connection.t(), map() | keyword()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_key(payload, opts)
create_key(%{api_key: xyz, host: ...}, payload)
create_key(Connection.new(), payload)
@spec create_key(map() | OpenApiTypesense.Connection.t(), map(), keyword()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
create_key(%{api_key: xyz, host: ...}, payload, opts)
create_key(Connection.new(), payload, opts)
@spec delete_key(integer()) :: {:ok, OpenApiTypesense.ApiKeyDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Delete an API key given its ID.
@spec delete_key( map() | OpenApiTypesense.Connection.t() | integer(), integer() | keyword() ) :: {:ok, OpenApiTypesense.ApiKeyDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
delete_key(keyId, opts)
delete_key(%{api_key: xyz, host: ...}, keyId)
delete_key(Connection.new(), keyId)
@spec delete_key(map() | OpenApiTypesense.Connection.t(), integer(), keyword()) :: {:ok, OpenApiTypesense.ApiKeyDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
@spec delete_key(OpenApiTypesense.Connection.t(), integer(), keyword()) :: {:ok, OpenApiTypesense.ApiKeyDeleteResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
delete_key(%{api_key: xyz, host: ...}, keyId, opts)
delete_key(Connection.new(), keyId, opts)
@spec get_key(integer()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Retrieve (metadata about) a key
Retrieve (metadata about) a key. Only the key prefix is returned when you retrieve a key. Due to security reasons, only the create endpoint returns the full API key.
@spec get_key( map() | OpenApiTypesense.Connection.t() | integer(), keyword() ) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
get_key(keyId, opts)
get_key(%{api_key: xyz, host: ...}, keyId)
get_key(Connection.new(), keyId)
@spec get_key(map() | OpenApiTypesense.Connection.t(), integer(), keyword()) :: {:ok, OpenApiTypesense.ApiKey.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Either one of:
get_key(%{api_key: xyz, host: ...}, keyId, opts)
get_key(Connection.new(), keyId, opts)
@spec get_keys() :: {:ok, OpenApiTypesense.ApiKeysResponse.t()} | :error
Retrieve (metadata about) all keys.
@spec get_keys(map() | OpenApiTypesense.Connection.t() | keyword()) :: {:ok, OpenApiTypesense.ApiKeysResponse.t()} | :error
Either one of:
get_keys(opts)
get_keys(%{api_key: xyz, host: ...})
get_keys(Connection.new())
@spec get_keys( map() | OpenApiTypesense.Connection.t(), keyword() ) :: {:ok, OpenApiTypesense.ApiKeysResponse.t()} | :error
Either one of:
get_keys(%{api_key: xyz, host: ...}, opts)
get_keys(Connection.new(), opts)