// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import { fileURLToPath } from "node:url"; // snippet-start:[javascript.v3.support.actions.CreateCase] import { CreateCaseCommand } from "@aws-sdk/client-support"; import { client } from "../libs/client.js"; export const main = async () => { try { // Create a new case and log the case id. // Important: This creates a real support case in your account. const response = await client.send( new CreateCaseCommand({ // The subject line of the case. subject: "IGNORE: Test case", // Use DescribeServices to find available service codes for each service. serviceCode: "service-quicksight-end-user", // Use DescribeSecurityLevels to find available severity codes for your support plan. severityCode: "low", // Use DescribeServices to find available category codes for each service. categoryCode: "end-user-support", // The main description of the support case. communicationBody: "This is a test. Please ignore.", }), ); console.log(response.caseId); return response; } catch (err) { console.error(err); } }; // snippet-end:[javascript.v3.support.actions.CreateCase] // Invoke main function if this file was run directly. if (process.argv[1] === fileURLToPath(import.meta.url)) { main(); }