From e7f7f1dfe597bfda56ce726353d88fc6d61cb4f8 Mon Sep 17 00:00:00 2001
From: Pierrick Voulet <6769971+PierrickVoulet@users.noreply.github.com>
Date: Thu, 3 Oct 2024 13:20:43 -0400
Subject: [PATCH] feat: update message with app creds and typos (#923)

Co-authored-by: pierrick <pierrick@google.com>
---
 .../client-libraries/cloud/update-message-app-cred.js | 11 +++++++++--
 .../cloud/update-message-user-cred.js                 |  5 ++++-
 .../cloud/update-space-read-state-user-cred.js        |  2 +-
 chat/client-libraries/cloud/update-space-user-cred.js |  5 ++++-
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/chat/client-libraries/cloud/update-message-app-cred.js b/chat/client-libraries/cloud/update-message-app-cred.js
index 6dc766d7..8c368f90 100644
--- a/chat/client-libraries/cloud/update-message-app-cred.js
+++ b/chat/client-libraries/cloud/update-message-app-cred.js
@@ -29,11 +29,18 @@ async function main() {
     message: {
       // Replace SPACE_NAME and MESSAGE_NAME here
       name: 'spaces/SPACE_NAME/messages/MESSAGE_NAME',
-      text: 'Updated with app credential!'
+      text: 'Text updated with app credential!',
+      cardsV2 : [{ card: { header: {
+        title: 'Card updated with app credential!',
+        imageUrl: 'https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/info/default/24px.svg'
+      }}}]
     },
     // The field paths to update. Separate multiple values with commas or use
     // `*` to update all field paths.
-    updateMask: 'text'
+    updateMask: {
+      // The field paths to update.
+      paths: ['text', 'cards_v2']
+    }
   };
 
   // Make the request
diff --git a/chat/client-libraries/cloud/update-message-user-cred.js b/chat/client-libraries/cloud/update-message-user-cred.js
index b56f2500..8ad1c30a 100644
--- a/chat/client-libraries/cloud/update-message-user-cred.js
+++ b/chat/client-libraries/cloud/update-message-user-cred.js
@@ -35,7 +35,10 @@ async function main() {
     },
     // The field paths to update. Separate multiple values with commas or use
     // `*` to update all field paths.
-    updateMask: 'text'
+    updateMask: {
+      // The field paths to update.
+      paths: ['text']
+    }
   };
 
   // Make the request
diff --git a/chat/client-libraries/cloud/update-space-read-state-user-cred.js b/chat/client-libraries/cloud/update-space-read-state-user-cred.js
index 3282a1ab..d11db27c 100644
--- a/chat/client-libraries/cloud/update-space-read-state-user-cred.js
+++ b/chat/client-libraries/cloud/update-space-read-state-user-cred.js
@@ -39,7 +39,7 @@ async function main() {
     },
     updateMask: {
       // The field paths to update.
-      paths: ['lastReadTime']
+      paths: ['last_read_time']
     }
   };
 
diff --git a/chat/client-libraries/cloud/update-space-user-cred.js b/chat/client-libraries/cloud/update-space-user-cred.js
index 7fd8542f..31e4d74f 100644
--- a/chat/client-libraries/cloud/update-space-user-cred.js
+++ b/chat/client-libraries/cloud/update-space-user-cred.js
@@ -35,7 +35,10 @@ async function main() {
     },
     // The field paths to update. Separate multiple values with commas or use
     // `*` to update all field paths.
-    updateMask: 'displayName'
+    updateMask: {
+      // The field paths to update.
+      paths: ['display_name']
+    }
   };
 
   // Make the request