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 |
|
ORGANIZATION_RESOURCE |
|
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 user.
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 68
setCredentials(string $key)
Set the credentials.
in
Base at line 85
protected ResponseInterface
call(string $method, string $path, array $options = [], bool $needsCredentials = true)
Call the API rokka endpoint.
in
Base at line 105
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 user.
Organization
createOrganization(string $name, string $billingMail, string $displayName = '')
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.