Skip to content

Commit e28e52e

Browse files
Benjamin E. Coekweinmeister
authored andcommitted
feat!: initial library generation (#1)
1 parent b350403 commit e28e52e

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

media-translation/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "media-translation-samples",
3+
"private": true,
4+
"license": "Apache-2.0",
5+
"author": "Google LLC",
6+
"engines": {
7+
"node": ">=10"
8+
},
9+
"files": [
10+
"*.js"
11+
],
12+
"scripts": {
13+
"test": "c8 mocha --timeout 600000 test/*.js"
14+
},
15+
"dependencies": {
16+
"@google-cloud/media-translation": "^0.1.0"
17+
},
18+
"devDependencies": {
19+
"c8": "^7.0.0",
20+
"chai": "^4.2.0",
21+
"mocha": "^7.0.0"
22+
}
23+
}

media-translation/quickstart.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
'use strict';
17+
18+
async function quickstart() {
19+
// parent = 'projects/my-project' // Project to list dashboards for.
20+
// [START media_translation_quickstart]
21+
// Imports the Google Cloud client library
22+
const {
23+
SpeechTranslationServiceClient,
24+
} = require('@google-cloud/media-translation');
25+
26+
// Creates a client
27+
const translate = new SpeechTranslationServiceClient();
28+
29+
// parent = 'projects/my-project', // Project to list dashboards for.
30+
31+
// TODO: add an actual sample.
32+
console.info(translate);
33+
34+
// [END media_translation_quickstart]
35+
}
36+
37+
const args = process.argv.slice(2);
38+
quickstart(...args).catch(console.error);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
'use strict';
17+
18+
const path = require('path');
19+
const {assert} = require('chai');
20+
const cp = require('child_process');
21+
const {describe, it} = require('mocha');
22+
23+
const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
24+
25+
const cwd = path.join(__dirname, '..');
26+
27+
const PROJECT_ID = process.env.GCLOUD_PROJECT;
28+
29+
describe('Sample Integration Tests', () => {
30+
it('should run quickstart.js', async () => {
31+
const stdout = execSync(`node ./quickstart.js projects/${PROJECT_ID}`, {
32+
cwd,
33+
});
34+
assert(stdout);
35+
});
36+
});

0 commit comments

Comments
 (0)