class PersonalAccessToken extends BaseResource implements Creatable

PersonalAccessToken class.

This class represents a resource with type "PersonalAccessToken" in Contentful.

Properties

protected SystemProperties $sys from BaseResource
protected BaseProxy $proxy from BaseResource
protected string $name
protected ApiDateTime|null $revokedAt
protected bool $isReadOnly
protected string|null $token

Methods

__construct(string $name = '', bool $isReadOnly = false)

PersonalAccessToken constructor.

getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

string|null
getId()

Shortcut for accessing the resource ID through its system properties.

Link
asLink()

Creates a Link representation of the current resource.

setProxy(BaseProxy $proxy)

Sets the current BaseProxy object instance.

asRequestBody()

{@inheritdoc}

__call(string $name, array $arguments)

Shortcut for forwarding methods to the current proxy, using the current object as argument.

array
jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

string
getName()

No description

setName(string $name)

No description

getRevokedAt()

No description

setReadOnly(bool $isReadOnly)

No description

bool
isReadOnly()

No description

string|null
getToken()

No description

Details

at line 51
__construct(string $name = '', bool $isReadOnly = false)

PersonalAccessToken constructor.

Parameters

string $name
bool $isReadOnly

in BaseResource at line 47
SystemProperties getSystemProperties()

Returns the resource's system properties, defined in the object "sys" in Contentful's responses.

Return Value

SystemProperties

in BaseResource at line 57
string|null getId()

Shortcut for accessing the resource ID through its system properties.

Return Value

string|null

Creates a Link representation of the current resource.

Return Value

Link

in BaseResource at line 79
BaseResource setProxy(BaseProxy $proxy)

Sets the current BaseProxy object instance.

This is done automatically when performing API calls, so it shouldn't be used manually.

Parameters

BaseProxy $proxy

Return Value

BaseResource

at line 79
asRequestBody()

{@inheritdoc}

in BaseResource at line 111
__call(string $name, array $arguments)

Shortcut for forwarding methods to the current proxy, using the current object as argument.

// Instead of
$client->asset->publish($asset);
// You can use
$asset->publish();

Parameters

string $name
array $arguments

at line 63
array jsonSerialize()

Returns an array to be used by "json_encode" to serialize objects of this class.

Return Value

array

at line 93
string getName()

Return Value

string

at line 103
PersonalAccessToken setName(string $name)

Parameters

string $name

Return Value

PersonalAccessToken

at line 113
ApiDateTime|null getRevokedAt()

Return Value

ApiDateTime|null

at line 121
setReadOnly(bool $isReadOnly)

Parameters

bool $isReadOnly

at line 131
bool isReadOnly()

Return Value

bool

at line 139
string|null getToken()

Return Value

string|null