async function simpleTextReplace(presentationId, shapeId, replacementText) {
  const {GoogleAuth} = require('google-auth-library');
  const {google} = require('googleapis');

  const auth = new GoogleAuth({
    scopes: 'https://www.googleapis.com/auth/presentations',
  });

  const service = google.slides({version: 'v1', auth});
  // Remove existing text in the shape, then insert new text.
  const requests = [
    {
      deleteText: {
        objectId: shapeId,
        textRange: {
          type: 'ALL',
        },
      },
    },
    {
      insertText: {
        objectId: shapeId,
        insertionIndex: 0,
        text: replacementText,
      },
    },
  ];
  // Execute the requests.
  try {
    const batchUpdateResponse = await service.presentations.batchUpdate({
      presentationId,
      resource: {
        requests,
      },
    });
    console.log(`Replaced text in shape with ID: ${shapeId}`);
    return batchUpdateResponse.data;
  } catch (err) {
    // TODO (developer) - Handle exception
    throw err;
  }
}
Replaces text in the provided shape ID.
@param {string} presentationId The presentation ID.
@param {string} shapeId The shape ID to delete existing text and insert new text into.
@param {string} replacementText The new replacement text.