public function addMultipartFileToRequest($path, $partName) {
        if (!file_exists($path)) {
            throw new InvalidArgumentException(sprintf('File does not exist: "%s"', $path));
        }

        // Create the multipart entry in the request options if it does not already exist
        if (!isset($this->requestOptions['multipart'])) {
            $this->requestOptions['multipart'] = [];
        }

        // Add an entry to the multipart array
        $this->requestOptions['multipart'][] = [
            'name' => $partName,
            'contents' => fopen($path, 'r'),
            'filename' => basename($path),
        ];

        return $this;
    }