Update metadata programmatically

Update metadata programmatically

# Example from the documentation to update metadata programmatically

from google.cloud import contentwarehouse_v1client = contentwarehouse_v1.ContentWarehouseServiceClient()document = contentwarehouse_v1.Document(
title=”Optimized Title”,
description=”This is an optimized meta description for better SEO.”,
keywords=[“SEO”, “metadata”, “optimization”]
)

request = contentwarehouse_v1.UpdateDocumentRequest(
document=document,
update_mask={“paths”: [“title”, “description”, “keywords”]}
)

response = client.update_document(request=request)
print(response)

Leave a Reply

Your email address will not be published. Required fields are marked *