public function deleteDynamicMetadata($dynamicMetadataName, $hash, $organization = '', $options = [])
    {
        if (empty($hash)) {
            throw new \LogicException('Missing image Hash.');
        }

        if (empty($dynamicMetadataName)) {
            throw new \LogicException('Missing DynamicMetadata name.');
        }

        $path = implode('/', [
            self::SOURCEIMAGE_RESOURCE,
            $this->getOrganizationName($organization),
            $hash,
            self::DYNAMIC_META_RESOURCE,
            $dynamicMetadataName,
        ]);

        $callOptions = [];
        if (isset($options['deletePrevious']) && $options['deletePrevious']) {
            $callOptions['query'] = ['deletePrevious' => 'true'];
        }

        $response = $this->call('DELETE', $path, $callOptions);

        if ($response->getStatusCode() >= 200 && $response->getStatusCode() < 300) {
            return $this->extractHashFromLocationHeader($response->getHeader('Location'));
        }

        // Throw an exception to be handled by the caller.
        throw new \LogicException($response->getBody()->getContents(), $response->getStatusCode());
    }