text: /* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  SPDX-License-Identifier: Apache-2.0
  
  ABOUT THIS NODE.JS EXAMPLE: This example works with the AWS SDK for JavaScript version 3 (v3),
  which is available at https://github.com/aws/aws-sdk-js-v3. This example is in the 'AWS SDK for JavaScript v3 Developer Guide' at
  https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/cross-service-example-dataupload.html.
  
  Purpose:
  update-table.js is part of a tutorial demonstrating how to build and deploy an app to submit
  data to an Amazon DynamoDB table.
  To run the full tutorial, see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/cross-service-example-submitting-data.html.
  update-table.js demonstrates how to update a DynamoDB table.
  
  Inputs (replace in code):
  - REGION
  - TABLE_NAME
  
  Running the code:
  node create-table.js
   */
  // snippet-start:[s3.JavaScript.cross-service.updateTableV3]
  // Import required AWS SDK clients and commands for Node.js
  import { PutItemCommand } from "@aws-sdk/client-dynamodb";
  import { dynamoClient } from "../libs/dynamoClient.js";
  
  // Set the parameters
  export const params = {
    TableName: "Items",
    Item: {
      id: { N: "1" },
      title: { S: "aTitle" },
      name: { S: "aName" },
      body: { S: "aBody" },
    },
  };
  
  export const run = async () => {
    try {
      const data = await dynamoClient.send(new PutItemCommand(params));
      console.log("success");
      console.log(data);
    } catch (err) {
      console.error(err);
    }
  };
  run();
  // snippet-end:[s3.JavaScript.cross-service.updateTableV3]
  