MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

media/livestream/deleteAsset.js:18–47  ·  view source on GitHub ↗
(projectId, location, assetId)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, assetId) {
19 // [START livestream_delete_asset]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // assetId = 'my-asset';
26
27 // Imports the Livestream library
28 const {LivestreamServiceClient} = require('@google-cloud/livestream').v1;
29
30 // Instantiates a client
31 const livestreamServiceClient = new LivestreamServiceClient();
32
33 async function deleteAsset() {
34 // Construct request
35 const request = {
36 name: livestreamServiceClient.assetPath(projectId, location, assetId),
37 };
38
39 // Run request
40 const [operation] = await livestreamServiceClient.deleteAsset(request);
41 await operation.promise();
42 console.log('Deleted asset');
43 }
44
45 deleteAsset();
46 // [END livestream_delete_asset]
47}
48
49// node deleteAsset.js <projectId> <location> <assetId>
50process.on('unhandledRejection', err => {

Callers 1

deleteAsset.jsFile · 0.70

Calls 1

deleteAssetFunction · 0.85

Tested by

no test coverage detected