TokenMetadata
in package
implements
ModelInterface, ArrayAccess, JsonSerializable
TokenMetadata Class Doc Comment
Tags
Table of Contents
Interfaces
- ModelInterface
- Interface abstracting model access.
- ArrayAccess
- JsonSerializable
Constants
- ALLOWED_ACTIONS_PURGE : mixed = 'purge'
- ALLOWED_ACTIONS_REVOKE : mixed = 'revoke'
- ALLOWED_ACTIONS_ROTATE : mixed = 'rotate'
- DISCRIMINATOR : mixed = null
Properties
- $attributeMap : array<string|int, string>
- Array of attributes where the key is the local name, and the value is the original name
- $container : array<string|int, mixed>
- Associative array for storing property values
- $getters : array<string|int, string>
- Array of attributes to getter functions (for serialization of requests)
- $openAPIFormats : array<string|int, string>
- Array of property to format mappings. Used for (de)serialization
- $openAPIModelName : string
- The original name of the model.
- $openAPINullables : array<string|int, bool>
- Array of nullable properties. Used for (de)serialization
- $openAPINullablesSetToNull : array<string|int, bool>
- If a nullable field gets set to null, insert it here
- $openAPITypes : array<string|int, string>
- Array of property to type mappings. Used for (de)serialization
- $setters : array<string|int, string>
- Array of attributes to setter functions (for deserialization of responses)
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Gets the string presentation of the object
- attributeMap() : array<string|int, mixed>
- Array of attributes where the key is the local name, and the value is the original name
- getAllowedActions() : array<string|int, string>|null
- Gets allowed_actions
- getAllowedActionsAllowableValues() : array<string|int, string>
- Gets allowable values of the enum
- getCreatedAt() : DateTime
- Gets created_at
- getDescription() : string
- Gets description
- getExpiresAt() : DateTime
- Gets expires_at
- getId() : string
- Gets id
- getLastUsedAt() : DateTime|null
- Gets last_used_at
- getModelName() : string
- The original name of the model.
- getOwner() : string|null
- Gets owner
- getRevoked() : bool
- Gets revoked
- getStatus() : TokenStatus|null
- Gets status
- getters() : array<string|int, mixed>
- Array of attributes to getter functions (for serialization of requests)
- isNullable() : bool
- Checks if a property is nullable
- isNullableSetToNull() : bool
- Checks if a nullable property is set to null.
- jsonSerialize() : mixed
- Serializes the object to a value that can be serialized natively by json_encode().
- listInvalidProperties() : array<string|int, mixed>
- Show all the invalid properties with reasons.
- offsetExists() : bool
- Returns true if offset exists. False otherwise.
- offsetGet() : mixed|null
- Gets offset.
- offsetSet() : void
- Sets value based on offset.
- offsetUnset() : void
- Unsets offset.
- openAPIFormats() : array<string|int, mixed>
- Array of property to format mappings. Used for (de)serialization
- openAPITypes() : array<string|int, mixed>
- Array of property to type mappings. Used for (de)serialization
- setAllowedActions() : self
- Sets allowed_actions
- setCreatedAt() : self
- Sets created_at
- setDescription() : self
- Sets description
- setExpiresAt() : self
- Sets expires_at
- setId() : self
- Sets id
- setLastUsedAt() : self
- Sets last_used_at
- setOwner() : self
- Sets owner
- setRevoked() : self
- Sets revoked
- setStatus() : self
- Sets status
- setters() : array<string|int, mixed>
- Array of attributes to setter functions (for deserialization of responses)
- toHeaderValue() : string
- Gets a header-safe presentation of the object
- valid() : bool
- Validate all the properties in the model return true if all passed
- openAPINullables() : array<string|int, mixed>
- Array of nullable properties
- getOpenAPINullablesSetToNull() : array<string|int, bool>
- Array of nullable field names deliberately set to null
- setIfExists() : void
- Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the $this->openAPINullablesSetToNull array
- setOpenAPINullablesSetToNull() : void
- Setter - Array of nullable field names deliberately set to null
Constants
ALLOWED_ACTIONS_PURGE
public
mixed
ALLOWED_ACTIONS_PURGE
= 'purge'
ALLOWED_ACTIONS_REVOKE
public
mixed
ALLOWED_ACTIONS_REVOKE
= 'revoke'
ALLOWED_ACTIONS_ROTATE
public
mixed
ALLOWED_ACTIONS_ROTATE
= 'rotate'
DISCRIMINATOR
public
mixed
DISCRIMINATOR
= null
Properties
$attributeMap
Array of attributes where the key is the local name, and the value is the original name
protected
static array<string|int, string>
$attributeMap
= ['id' => 'id', 'description' => 'description', 'owner' => 'owner', 'created_at' => 'created_at', 'expires_at' => 'expires_at', 'revoked' => 'revoked', 'last_used_at' => 'last_used_at', 'status' => 'status', 'allowed_actions' => 'allowed_actions']
$container
Associative array for storing property values
protected
array<string|int, mixed>
$container
= []
$getters
Array of attributes to getter functions (for serialization of requests)
protected
static array<string|int, string>
$getters
= ['id' => 'getId', 'description' => 'getDescription', 'owner' => 'getOwner', 'created_at' => 'getCreatedAt', 'expires_at' => 'getExpiresAt', 'revoked' => 'getRevoked', 'last_used_at' => 'getLastUsedAt', 'status' => 'getStatus', 'allowed_actions' => 'getAllowedActions']
$openAPIFormats
Array of property to format mappings. Used for (de)serialization
protected
static array<string|int, string>
$openAPIFormats
= ['id' => null, 'description' => null, 'owner' => null, 'created_at' => 'date-time', 'expires_at' => 'date-time', 'revoked' => null, 'last_used_at' => 'date-time', 'status' => null, 'allowed_actions' => null]
Tags
$openAPIModelName
The original name of the model.
protected
static string
$openAPIModelName
= 'TokenMetadata'
$openAPINullables
Array of nullable properties. Used for (de)serialization
protected
static array<string|int, bool>
$openAPINullables
= ['id' => false, 'description' => false, 'owner' => false, 'created_at' => false, 'expires_at' => false, 'revoked' => false, 'last_used_at' => false, 'status' => false, 'allowed_actions' => false]
$openAPINullablesSetToNull
If a nullable field gets set to null, insert it here
protected
array<string|int, bool>
$openAPINullablesSetToNull
= []
$openAPITypes
Array of property to type mappings. Used for (de)serialization
protected
static array<string|int, string>
$openAPITypes
= ['id' => 'string', 'description' => 'string', 'owner' => 'string', 'created_at' => '\DateTime', 'expires_at' => '\DateTime', 'revoked' => 'bool', 'last_used_at' => '\DateTime', 'status' => '\HushHush\Generated\Model\TokenStatus', 'allowed_actions' => 'string[]']
$setters
Array of attributes to setter functions (for deserialization of responses)
protected
static array<string|int, string>
$setters
= ['id' => 'setId', 'description' => 'setDescription', 'owner' => 'setOwner', 'created_at' => 'setCreatedAt', 'expires_at' => 'setExpiresAt', 'revoked' => 'setRevoked', 'last_used_at' => 'setLastUsedAt', 'status' => 'setStatus', 'allowed_actions' => 'setAllowedActions']
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed>|null $data = null ]) : mixed
Parameters
- $data : array<string|int, mixed>|null = null
-
Associated array of property values initializing the model
__toString()
Gets the string presentation of the object
public
__toString() : string
Return values
stringattributeMap()
Array of attributes where the key is the local name, and the value is the original name
public
static attributeMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getAllowedActions()
Gets allowed_actions
public
getAllowedActions() : array<string|int, string>|null
Return values
array<string|int, string>|nullgetAllowedActionsAllowableValues()
Gets allowable values of the enum
public
getAllowedActionsAllowableValues() : array<string|int, string>
Return values
array<string|int, string>getCreatedAt()
Gets created_at
public
getCreatedAt() : DateTime
Return values
DateTimegetDescription()
Gets description
public
getDescription() : string
Return values
stringgetExpiresAt()
Gets expires_at
public
getExpiresAt() : DateTime
Return values
DateTimegetId()
Gets id
public
getId() : string
Return values
stringgetLastUsedAt()
Gets last_used_at
public
getLastUsedAt() : DateTime|null
Return values
DateTime|nullgetModelName()
The original name of the model.
public
getModelName() : string
Return values
stringgetOwner()
Gets owner
public
getOwner() : string|null
Return values
string|nullgetRevoked()
Gets revoked
public
getRevoked() : bool
Return values
boolgetStatus()
Gets status
public
getStatus() : TokenStatus|null
Return values
TokenStatus|nullgetters()
Array of attributes to getter functions (for serialization of requests)
public
static getters() : array<string|int, mixed>
Return values
array<string|int, mixed>isNullable()
Checks if a property is nullable
public
static isNullable(string $property) : bool
Parameters
- $property : string
Return values
boolisNullableSetToNull()
Checks if a nullable property is set to null.
public
isNullableSetToNull(string $property) : bool
Parameters
- $property : string
Return values
booljsonSerialize()
Serializes the object to a value that can be serialized natively by json_encode().
public
jsonSerialize() : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Returns data which can be serialized by json_encode(), which is a value of any type other than a resource.
listInvalidProperties()
Show all the invalid properties with reasons.
public
listInvalidProperties() : array<string|int, mixed>
Return values
array<string|int, mixed> —invalid properties with reasons
offsetExists()
Returns true if offset exists. False otherwise.
public
offsetExists(int|string $offset) : bool
Parameters
- $offset : int|string
-
Offset
Return values
booloffsetGet()
Gets offset.
public
offsetGet(int|string $offset) : mixed|null
Parameters
- $offset : int|string
-
Offset
Attributes
- #[ReturnTypeWillChange]
Return values
mixed|nulloffsetSet()
Sets value based on offset.
public
offsetSet(int|null $offset, mixed $value) : void
Parameters
- $offset : int|null
-
Offset
- $value : mixed
-
Value to be set
offsetUnset()
Unsets offset.
public
offsetUnset(int|string $offset) : void
Parameters
- $offset : int|string
-
Offset
openAPIFormats()
Array of property to format mappings. Used for (de)serialization
public
static openAPIFormats() : array<string|int, mixed>
Return values
array<string|int, mixed>openAPITypes()
Array of property to type mappings. Used for (de)serialization
public
static openAPITypes() : array<string|int, mixed>
Return values
array<string|int, mixed>setAllowedActions()
Sets allowed_actions
public
setAllowedActions(array<string|int, string>|null $allowed_actions) : self
Parameters
- $allowed_actions : array<string|int, string>|null
-
What may be done to the token in its current state:
rotateandrevokewhile it isactive, onlypurgeonce it isexpiredorrevoked. The endpoints enforce the same rule themselves - a purge of an active token is still a 409 - so a client that acts on a stale view gets the server's answer. Hiding a button is cosmetic; this is what to show.
Return values
selfsetCreatedAt()
Sets created_at
public
setCreatedAt(DateTime $created_at) : self
Parameters
- $created_at : DateTime
-
created_at
Return values
selfsetDescription()
Sets description
public
setDescription(string $description) : self
Parameters
- $description : string
-
description
Return values
selfsetExpiresAt()
Sets expires_at
public
setExpiresAt(DateTime $expires_at) : self
Parameters
- $expires_at : DateTime
-
expires_at
Return values
selfsetId()
Sets id
public
setId(string $id) : self
Parameters
- $id : string
-
id
Return values
selfsetLastUsedAt()
Sets last_used_at
public
setLastUsedAt(DateTime|null $last_used_at) : self
Parameters
- $last_used_at : DateTime|null
-
Absent if this token has never authenticated a request.
Return values
selfsetOwner()
Sets owner
public
setOwner(string|null $owner) : self
Parameters
- $owner : string|null
-
The admin account that created this token over HTTP. Absent for a token issued via the
tokenCLI command, which has no session to attribute to - never a guessed value.
Return values
selfsetRevoked()
Sets revoked
public
setRevoked(bool $revoked) : self
Parameters
- $revoked : bool
-
revoked
Return values
selfsetStatus()
Sets status
public
setStatus(TokenStatus|null $status) : self
Parameters
- $status : TokenStatus|null
-
status
Return values
selfsetters()
Array of attributes to setter functions (for deserialization of responses)
public
static setters() : array<string|int, mixed>
Return values
array<string|int, mixed>toHeaderValue()
Gets a header-safe presentation of the object
public
toHeaderValue() : string
Return values
stringvalid()
Validate all the properties in the model return true if all passed
public
valid() : bool
Return values
bool —True if all properties are valid
openAPINullables()
Array of nullable properties
protected
static openAPINullables() : array<string|int, mixed>
Return values
array<string|int, mixed>getOpenAPINullablesSetToNull()
Array of nullable field names deliberately set to null
private
getOpenAPINullablesSetToNull() : array<string|int, bool>
Return values
array<string|int, bool>setIfExists()
Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the $this->openAPINullablesSetToNull array
private
setIfExists(string $variableName, array<string|int, mixed> $fields, mixed $defaultValue) : void
Parameters
- $variableName : string
- $fields : array<string|int, mixed>
- $defaultValue : mixed
setOpenAPINullablesSetToNull()
Setter - Array of nullable field names deliberately set to null
private
setOpenAPINullablesSetToNull(array<string|int, bool> $openAPINullablesSetToNull) : void
Parameters
- $openAPINullablesSetToNull : array<string|int, bool>