public function upload()
{
$multipartStream = new Psr7\MultipartStream([['name' => 'metadata', 'headers' => ['Content-Type' => 'application/json; charset=UTF-8'], 'contents' => json_encode($this->metadata)], ['name' => 'data', 'headers' => ['Content-Type' => $this->contentType], 'contents' => $this->data]], 'boundary');
$headers = ['Content-Type' => 'multipart/related; boundary=boundary', 'Content-Length' => $multipartStream->getSize()];
return json_decode($this->requestWrapper->send(new Request('POST', $this->uri, $headers, $multipartStream), $this->requestOptions)->getBody(), true);
}