You are here

public function Client::editAssetXmpMetadata in Media: Acquia DAM 8

Edit asset XMP metadata.

Parameters

int $assetID: The asset to edit XMP metadata for.

array $data: A key value array of metadata to edit.

Return value

array The metadata of the asset.

Throws

\GuzzleHttp\Exception\GuzzleException

\cweagans\webdam\Exception\InvalidCredentialsException

File

src/Client.php, line 422

Class

Client
Overridden implementation of the cweagans php-webdam-client.

Namespace

Drupal\media_acquiadam

Code

public function editAssetXmpMetadata($assetID, array $data) {
  $this
    ->checkAuth();
  $data['type'] = 'assetxmp';
  $response = $this->client
    ->request('PUT', $this->baseUrl . '/assets/' . $assetID . '/metadatas/xmp', [
    'headers' => $this
      ->getDefaultHeaders(),
    RequestOptions::JSON => $data,
  ]);
  $response = json_decode((string) $response
    ->getBody(), TRUE);
  return $response;
}