User
class User extends Base (View source)
User management client for the rokka.io service.
Constants
DEFAULT_API_BASE_URL |
|
DEFAULT_API_VERSION |
|
API_KEY_HEADER |
|
API_VERSION_HEADER |
|
USERS_RESOURCE |
|
USER_RESOURCE |
|
USER_API_KEYS_RESOURCE |
|
ORGANIZATION_RESOURCE |
|
ORGANIZATION_OPTION_PROTECT_DYNAMIC_STACK |
|
Properties
protected ClientInterface | $client | Client to access Rokka. |
from Base |
protected string|null | $defaultOrganization | Default organization. |
from Base |
Methods
Constructor.
Call the API rokka endpoint.
Return the organization or the default if empty.
Create a user.
Get current userID.
Add an Api Key to the current user.
Gets info about the currently used Api Key.
Deletes an Api Key for the current user.
Get current user.
Create an organization.
Create an organization.
Return an organization.
Create a membership.
Create a user and membership associated to this organization.
Get the membership metadata for the given organization and user's ID.
Deletes a membership for the given organization and user's ID.
List the membership metadata for the given organization.
Details
__construct(ClientInterface $client, string|null $defaultOrganization, string|null $apiKey)
Constructor.
in
Base at line 70
void
setCredentials(string $key)
Set the credentials.
in
Base at line 87
protected ResponseInterface
call(string $method, string $path, array $options = [], bool $needsCredentials = true)
Call the API rokka endpoint.
in
Base at line 107
protected string
getOrganizationName(string|null $organization = null)
Return the organization or the default if empty.
User
createUser(string $email)
Create a user.
string
getCurrentUserId()
Get current userID.
UserApiKey
addUserApiKey(string $comment = null)
Add an Api Key to the current user.
UserApiKey
getCurrentUserApiKey()
Gets info about the currently used Api Key.
bool
deleteUserApiKey(string $id)
Deletes an Api Key for the current user.
User
getCurrentUser()
Get current user.
Organization
createOrganization(string $name, string $billingMail, string $displayName = '')
Create an organization.
Organization
setOrganizationOption(string $organization, string $name, string $value)
Create an organization.
Organization
getOrganization(string $organization = '')
Return an organization.
Membership
createMembership(string $userId, string|array $roles = [Membership::ROLE_READ], string $organization = '')
Create a membership.
Membership
createUserAndMembership(string|array $roles = [Membership::ROLE_READ], string $organization = '')
Create a user and membership associated to this organization.
Membership
getMembership(string $userId, string $organization = '')
Get the membership metadata for the given organization and user's ID.
bool
deleteMembership(string $userId, string $organization = '')
Deletes a membership for the given organization and user's ID.
Membership[]
listMemberships(string $organization = '')
List the membership metadata for the given organization.