Google\Cloud\Upload\AbstractUploader::__construct PHP Method

__construct() public method

public __construct ( RequestWrapper $requestWrapper, string | resource | Psr\Http\Message\StreamInterface $data, string $uri, array $options = [] )
$requestWrapper Google\Cloud\RequestWrapper
$data string | resource | Psr\Http\Message\StreamInterface
$uri string
$options array [optional] { Optional configuration. @type array $metadata Metadata on the resource. @type int $chunkSize Size of the chunks to send incrementally during a resumable upload. Must be in multiples of 262144 bytes. @type array $httpOptions HTTP client specific configuration options. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type string $contentType Content type of the resource. }
    public function __construct(RequestWrapper $requestWrapper, $data, $uri, array $options = [])
    {
        $this->requestWrapper = $requestWrapper;
        $this->data = Psr7\stream_for($data);
        $this->uri = $uri;
        $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
        $this->chunkSize = isset($options['chunkSize']) ? $options['chunkSize'] : null;
        $this->requestOptions = array_intersect_key($options, ['httpOptions' => null, 'retries' => null]);
        $this->contentType = isset($options['contentType']) ? $options['contentType'] : 'application/octet-stream';
    }
AbstractUploader