class PreviewApiKey extends BaseProxy

PreviewApiKey class.

This class is used as a proxy for doing operations related to preview api keys.

Properties

protected Client $client from BaseProxy
protected string|null $spaceId from BaseProxy
protected bool $requiresSpaceId Whether the current proxy requires a space ID for working properly. from BaseProxy

Methods

__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

from BaseProxy
__call(string $name, array $arguments)

Acts as a whitelister for protected methods.

from BaseProxy
string|null
getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

from BaseProxy
resolveLink(Link $link)

Shortcut for resolving links.

from BaseProxy
ResourceInterface|ResourceArray
getResource(array $values, Query $query = null, ResourceInterface $resource = null)

No description

from BaseProxy
requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

No description

from BaseProxy
string
getResourceId(ResourceInterface|string $resource)

No description

from BaseProxy
create(Creatable $resource, string $resourceId = null)

Creates a resource.

from BaseProxy
string[]
getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

from BaseProxy
update(Updatable $resource)

Updates a resource.

from BaseProxy
delete(ResourceInterface|string $resource, int $version = null)

Deletes a resource.

from BaseProxy
archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

from BaseProxy
unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

from BaseProxy
publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

from BaseProxy
unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

from BaseProxy
string
getResourceUri(array $values)

Returns the URI for the current proxy type.

string[]
getEnabledMethods()

An array of enabled methods for the current proxy.

get(string $resourceId)

Returns a PreviewApiKey object which corresponds to the given resource ID in Contentful.

ResourceArray
getAll(Query $query = null)

Returns a ResourceArray object containing DeliveryApiKey objects.

Details

in BaseProxy at line 54
__construct(Client $client, string $spaceId = null)

BaseProxy constructor.

Parameters

Client $client
string $spaceId

in BaseProxy at line 78
ResourceInterface __call(string $name, array $arguments)

Acts as a whitelister for protected methods.

Parameters

string $name
array $arguments

Return Value

ResourceInterface

Exceptions

LogicException

in BaseProxy at line 93
protected string|null getBaseUri()

Returns the string to be used as baseUri option, or null otherwise.

Return Value

string|null

Shortcut for resolving links.

Parameters

Link $link

Return Value

ResourceInterface

in BaseProxy at line 117
protected ResourceInterface|ResourceArray getResource(array $values, Query $query = null, ResourceInterface $resource = null)

Parameters

array $values
Query $query
ResourceInterface $resource

Return Value

ResourceInterface|ResourceArray

in BaseProxy at line 144
protected ResourceInterface requestResource(string $method, string $uriSuffix, ResourceInterface|string $resource, int $version = null, mixed $body = null)

Parameters

string $method
string $uriSuffix
ResourceInterface|string $resource
int $version
mixed $body

Return Value

ResourceInterface

in BaseProxy at line 172
protected string getResourceId(ResourceInterface|string $resource)

Parameters

ResourceInterface|string $resource

Return Value

string

in BaseProxy at line 187
protected create(Creatable $resource, string $resourceId = null)

Creates a resource.

Parameters

Creatable $resource
string $resourceId

in BaseProxy at line 212
protected string[] getCreateAdditionalHeaders(ResourceInterface $resource)

Override this method in a proxy class if special headers are to be defined upon creation.

Parameters

ResourceInterface $resource

Return Value

string[]

in BaseProxy at line 222
protected update(Updatable $resource)

Updates a resource.

Parameters

Updatable $resource

in BaseProxy at line 233
protected delete(ResourceInterface|string $resource, int $version = null)

Deletes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 248
protected archive(ResourceInterface|string $resource, int $version = null)

Archives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 263
protected unarchive(ResourceInterface|string $resource, int $version = null)

Unarchives a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 278
protected publish(ResourceInterface|string $resource, int $version = null)

Publishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

in BaseProxy at line 293
protected unpublish(ResourceInterface|string $resource, int $version = null)

Unpublishes a resource.

Parameters

ResourceInterface|string $resource Either a resource object, or a resource ID
int $version Null if $resouce is an object

at line 27
protected string getResourceUri(array $values)

Returns the URI for the current proxy type.

Parameters

array $values

Return Value

string

at line 35
string[] getEnabledMethods()

An array of enabled methods for the current proxy.

Return Value

string[]

at line 49
PreviewApiKey get(string $resourceId)

Returns a PreviewApiKey object which corresponds to the given resource ID in Contentful.

Parameters

string $resourceId

Return Value

PreviewApiKey

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys

at line 65
ResourceArray getAll(Query $query = null)

Returns a ResourceArray object containing DeliveryApiKey objects.

Parameters

Query $query

Return Value

ResourceArray

See also

https://www.contentful.com/developers/docs/references/content-management-api/#/reference/api-keys/api-keys-collection