class Upload extends BaseResource implements Creatable, Deletable

Upload class.

This class represents an "Upload" object in Contentful.

Properties

protected SystemProperties $sys from BaseResource
protected BaseProxy $proxy from BaseResource
protected string|resource|StreamInterface|null $body

Methods

__construct(string|resource|StreamInterface $body)

Upload 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|resource|StreamInterface|null
getBody()

No description

setBody(string|resource|StreamInterface|null $body)

No description

Details

at line 39
__construct(string|resource|StreamInterface $body)

Upload constructor.

Parameters

string|resource|StreamInterface $body Internally this is the value that is passed to Guzzle's request body, which means that all values accepted by Guzzle are allowed. These include an actual "string", a resource such as the result of a "fopen('file.txt', 'r')" call, an object implementing StreamInterface, etc.

See also

http://docs.guzzlephp.org/en/stable/request-options.html#body For more un Guzzle's internal options

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 60
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 50
array jsonSerialize()

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

Return Value

array

at line 68
string|resource|StreamInterface|null getBody()

Return Value

string|resource|StreamInterface|null

at line 78
Upload setBody(string|resource|StreamInterface|null $body)

Parameters

string|resource|StreamInterface|null $body

Return Value

Upload