@wildix/wda-insights-client > CreatePlaylistCommand
CreatePlaylistCommand class
Creates a new playlist with specified configuration.
Signature:
export declare class CreatePlaylistCommand extends CreatePlaylistCommand_base
Extends: CreatePlaylistCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { WdaInsightsClient, CreatePlaylistCommand } from "@wildix/wda-insights-client"; // ES Modules import
// const { WdaInsightsClient, CreatePlaylistCommand } = require("@wildix/wda-insights-client"); // CommonJS import
const client = new WdaInsightsClient(config);
const input = { // CreatePlaylistInput
name: "STRING_VALUE", // required
description: "STRING_VALUE",
company: "STRING_VALUE",
user: "STRING_VALUE",
access: { // PlaylistAccess
visibility: "explicit" || "organization",
grants: [ // PlaylistGrantList
{ // PlaylistGrant
permission: "view" || "edit", // required
principal: { // PlaylistPrincipal Union: only one key present
userId: "STRING_VALUE",
groupId: "STRING_VALUE",
},
},
],
},
};
const command = new CreatePlaylistCommand(input);
const response = await client.send(command);
// { // CreatePlaylistOutput
// playlist: { // Playlist
// name: "STRING_VALUE", // required
// description: "STRING_VALUE",
// id: "STRING_VALUE", // required
// createdAt: "STRING_VALUE", // required
// createdBy: "STRING_VALUE", // required
// createdByName: "STRING_VALUE", // required
// updatedAt: "STRING_VALUE",
// access: { // PlaylistAccess
// visibility: "explicit" || "organization",
// grants: [ // PlaylistGrantList
// { // PlaylistGrant
// permission: "view" || "edit", // required
// principal: { // PlaylistPrincipal Union: only one key present
// userId: "STRING_VALUE",
// groupId: "STRING_VALUE",
// },
// },
// ],
// },
// itemsCount: Number("int"), // required
// },
// };