Skip to content

Commit

Permalink
docs(samples): add Video Stitcher slate and CDN key code samples and …
Browse files Browse the repository at this point in the history
…tests (#6)

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-video-stitcher/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [X] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes b:202972969
  • Loading branch information
irataxy authored Jun 10, 2022
1 parent 973f7f2 commit 430695a
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/google-cloud-video-stitcher/.repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"release_level": "beta",
"language": "nodejs",
"repo": "googleapis/nodejs-video-stitcher",
"codeowner_team": "@googleapis/cloud-media-team",
"distribution_name": "@google-cloud/video-stitcher",
"api_id": "stitcher.googleapis.com",
"default_version": "v1",
Expand Down
20 changes: 19 additions & 1 deletion packages/google-cloud-video-stitcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
* [Before you begin](#before-you-begin)
* [Installing the client library](#installing-the-client-library)


* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
Expand All @@ -56,6 +56,24 @@ npm install @google-cloud/video-stitcher



## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-video-stitcher/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Create Cdn Key | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/createCdnKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/createCdnKey.js,samples/README.md) |
| Create Slate | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/createSlate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/createSlate.js,samples/README.md) |
| Delete Cdn Key | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/deleteCdnKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/deleteCdnKey.js,samples/README.md) |
| Delete Slate | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/deleteSlate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/deleteSlate.js,samples/README.md) |
| Get Cdn Key | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/getCdnKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/getCdnKey.js,samples/README.md) |
| Get Slate | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/getSlate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/getSlate.js,samples/README.md) |
| List Cdn Keys | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/listCdnKeys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/listCdnKeys.js,samples/README.md) |
| List Slates | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/listSlates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/listSlates.js,samples/README.md) |
| Update Cdn Key | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/updateCdnKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/updateCdnKey.js,samples/README.md) |
| Update Slate | [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/updateSlate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/updateSlate.js,samples/README.md) |



The [Video Stitcher API Node.js Client API Reference][client-docs] documentation
also contains samples.
Expand Down
212 changes: 212 additions & 0 deletions packages/google-cloud-video-stitcher/samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Video Stitcher API: Node.js Samples](https://github.com/googleapis/nodejs-video-stitcher)

[![Open in Cloud Shell][shell_img]][shell_link]



## Table of Contents

* [Before you begin](#before-you-begin)
* [Samples](#samples)
* [Create Cdn Key](#create-cdn-key)
* [Create Slate](#create-slate)
* [Delete Cdn Key](#delete-cdn-key)
* [Delete Slate](#delete-slate)
* [Get Cdn Key](#get-cdn-key)
* [Get Slate](#get-slate)
* [List Cdn Keys](#list-cdn-keys)
* [List Slates](#list-slates)
* [Update Cdn Key](#update-cdn-key)
* [Update Slate](#update-slate)

## Before you begin

Before running the samples, make sure you've followed the steps outlined in
[Using the client library](https://github.com/googleapis/nodejs-video-stitcher#using-the-client-library).

`cd samples`

`npm install`

`cd ..`

## Samples



### Create Cdn Key

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/createCdnKey.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/createCdnKey.js,samples/README.md)

__Usage:__


`node samples/createCdnKey.js`


-----




### Create Slate

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/createSlate.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/createSlate.js,samples/README.md)

__Usage:__


`node samples/createSlate.js`


-----




### Delete Cdn Key

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/deleteCdnKey.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/deleteCdnKey.js,samples/README.md)

__Usage:__


`node samples/deleteCdnKey.js`


-----




### Delete Slate

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/deleteSlate.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/deleteSlate.js,samples/README.md)

__Usage:__


`node samples/deleteSlate.js`


-----




### Get Cdn Key

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/getCdnKey.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/getCdnKey.js,samples/README.md)

__Usage:__


`node samples/getCdnKey.js`


-----




### Get Slate

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/getSlate.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/getSlate.js,samples/README.md)

__Usage:__


`node samples/getSlate.js`


-----




### List Cdn Keys

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/listCdnKeys.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/listCdnKeys.js,samples/README.md)

__Usage:__


`node samples/listCdnKeys.js`


-----




### List Slates

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/listSlates.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/listSlates.js,samples/README.md)

__Usage:__


`node samples/listSlates.js`


-----




### Update Cdn Key

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/updateCdnKey.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/updateCdnKey.js,samples/README.md)

__Usage:__


`node samples/updateCdnKey.js`


-----




### Update Slate

View the [source code](https://github.com/googleapis/nodejs-video-stitcher/blob/main/samples/updateSlate.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/updateSlate.js,samples/README.md)

__Usage:__


`node samples/updateSlate.js`






[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-video-stitcher&page=editor&open_in_editor=samples/README.md
[product-docs]: https://cloud.google.com/video-stitcher/
3 changes: 2 additions & 1 deletion packages/google-cloud-video-stitcher/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"devDependencies": {
"c8": "^7.1.0",
"chai": "^4.2.0",
"mocha": "^8.0.0"
"mocha": "^8.0.0",
"uuid": "^8.0.0"
}
}

0 comments on commit 430695a

Please sign in to comment.