Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate code from googleapis/nodejs-automl #2841

Merged
merged 147 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
bd4218f
⚒ run the generator
JustinBeckwith Jun 15, 2018
d10e44a
run the generator
JustinBeckwith Jun 20, 2018
72e17d1
remove empty stuffs
JustinBeckwith Jun 20, 2018
2a12f57
fix: prepare for initial GitHub commit
JustinBeckwith Jul 12, 2018
0367bc6
doc: generate README.md from nodejs-repo-tools (#5)
jkwlui Jul 17, 2018
8d5fb9e
synth: use common templating for .circleci/config.yml (#6)
jkwlui Jul 18, 2018
8ed7af5
release: nodejs-automl v0.1.1 (#15)
jkwlui Jul 23, 2018
d715ca1
nit: Google LLC (#16)
jkwlui Jul 24, 2018
677c53c
chore(deps): lock file maintenance (#17)
renovate[bot] Jul 24, 2018
2e741e2
chore: require node 8 for samples (#20)
JustinBeckwith Jul 30, 2018
a01670e
chore: move mocha options to mocha.opts (#19)
JustinBeckwith Jul 30, 2018
b5dee8f
chore(deps): lock file maintenance (#21)
renovate[bot] Jul 31, 2018
81d0df8
chore(deps): lock file maintenance (#25)
renovate[bot] Aug 7, 2018
26f4892
chore: ignore package-lock.json (#27)
JustinBeckwith Aug 7, 2018
fcbc82d
Release nodejs-automl v0.1.2 (#34)
JustinBeckwith Aug 24, 2018
f63119d
Release v0.1.3 (#108)
JustinBeckwith Dec 16, 2018
fbd13ef
docs(samples): move AutoML vision samples from nodejs-vision (#134)
jkwlui Feb 26, 2019
47c0da0
Release v0.1.4 (#141)
JustinBeckwith Mar 12, 2019
dc5c7db
Release @google-cloud/automl v0.2.0
jkwlui Apr 3, 2019
5030725
refactor: use execSync for tests (#158)
JustinBeckwith Apr 5, 2019
721a8f1
docs(samples): add vision beta samples (#157)
nirupa-kumar Apr 5, 2019
ddf0e53
docs(samples): add video-intelligence beta samples (#156)
nirupa-kumar Apr 5, 2019
ecd192d
docs(samples): add language automl beta samples (#154)
nirupa-kumar Apr 5, 2019
42e987d
docs(samples): automl tables beta samples (#155)
nirupa-kumar Apr 5, 2019
02db4ca
docs: add translate samples (#160)
callmehiphop Apr 12, 2019
096611c
chore: release 1.0.0 (#178)
bcoe May 13, 2019
bd21310
docs(samples): fixed comment typo (#182)
Defragger May 21, 2019
5e1075f
feat: add .repo-metadata.json; allows us to generate new docs site (#…
bcoe May 23, 2019
3c24cba
chore: release 1.1.0 (#185)
yoshi-automation May 23, 2019
e146830
chore: release 1.1.1 (#192)
yoshi-automation Jun 6, 2019
934f73f
refactor: changes formatting of a variety of statements
yoshi-automation Jun 7, 2019
212574b
fix(deps): update dependency mathjs to v6 (#195)
renovate[bot] Jun 11, 2019
a7af828
chore: release 1.2.0 (#197)
yoshi-automation Jun 11, 2019
b606616
fix: parse CSV correctly (#198)
leahecole Jun 11, 2019
70ca0f7
docs(samples): fix create-model.v1beta1.js filename (#202)
chiefkarlin Jun 13, 2019
764162f
chore: release 1.2.1 (#199)
yoshi-automation Jun 14, 2019
97a1605
build: switch to GitHub magic proxy, for release-please (#204)
bcoe Jun 19, 2019
45c9d7c
chore: release 1.2.2 (#206)
yoshi-automation Jun 26, 2019
bf1dc7b
fix(deps): update dependency execa to v2 (#211)
renovate-bot Jul 26, 2019
a9f20ab
chore: release 1.2.3 (#212)
yoshi-automation Jul 29, 2019
8879b14
chore: release 1.2.4 (#219)
yoshi-automation Aug 5, 2019
4348e93
chore: release 1.3.0 (#221)
yoshi-automation Aug 19, 2019
ca82587
fix(deps): update dependency yargs to v14
renovate-bot Aug 20, 2019
351d87a
chore: release 1.4.0 (#227)
yoshi-automation Aug 28, 2019
c508eb7
docs: wrap await with async in sample (#225)
anguillanneuf Sep 5, 2019
8279af3
chore: release 1.5.0 (#231)
yoshi-automation Sep 5, 2019
cec2b7d
fix(deps): update dependency execa to v3 (#251)
renovate-bot Oct 14, 2019
37b8b90
chore: release 1.7.3 (#257)
release-please[bot] Oct 22, 2019
0435f18
feat: added samples for api-endpoints (#259)
bradmiro Oct 30, 2019
a83f2d5
fix(samples): remove extra print statement and "setEndpoint.js" from …
bradmiro Oct 31, 2019
c46d6da
chore: release 1.8.0 (#260)
release-please[bot] Nov 8, 2019
78e71a6
chore: release 1.9.0 (#270)
release-please[bot] Nov 12, 2019
f333c6b
refactor: clean up samples and tests (#272)
JustinBeckwith Nov 15, 2019
aa37100
fix(deps): update dependency yargs to v15 (#279)
renovate-bot Nov 18, 2019
a6f28c3
chore: release 1.9.1 (#278)
release-please[bot] Nov 18, 2019
c84707c
chore: release 1.9.2 (#281)
release-please[bot] Nov 18, 2019
d817766
chore: update license headers
JustinBeckwith Nov 25, 2019
468c5cc
fix: correct AutoML Natural Language region tags to match with all ot…
martinvarelaj Dec 5, 2019
3ebe56c
chore: release 1.10.0 (#283)
release-please[bot] Dec 5, 2019
b7b077f
docs: add natural language entity extraction ga samples (#295)
nnegrey Dec 12, 2019
481f320
chore(deps): update dependency @google-cloud/storage to v4 (#299)
renovate-bot Dec 15, 2019
c841602
docs: add base dataset samples for the automl ga (#290)
nnegrey Dec 18, 2019
35e85d4
docs: add natural language sentiment analysis ga samples (#292)
nnegrey Dec 20, 2019
9677f5d
docs: add translate ga samples (#296)
nnegrey Dec 20, 2019
382e528
refactor: use explicit mocha imports
JustinBeckwith Dec 30, 2019
3481fb3
docs: add vision classification ga samples (#297)
nnegrey Jan 2, 2020
7a4a306
docs: use a fake dataset to make create model testable (#306)
nnegrey Jan 2, 2020
ab1f31e
chore(deps): update dependency mocha to v7 (#308)
renovate-bot Jan 6, 2020
54d6401
docs: add vision object detection ga samples (#298)
nnegrey Jan 6, 2020
35ff9c2
docs: add natural language text classification ga samples (#294)
nnegrey Jan 9, 2020
4f7753c
docs: add the base samples for model tasks (#291)
nnegrey Jan 9, 2020
63eae70
docs: add base samples for automl ga (#293)
nnegrey Jan 9, 2020
5d6da8b
chore: release 1.10.1 (#319)
release-please[bot] Jan 28, 2020
c228e53
docs(samples): add feature importance to predict sample (#277)
leahecole Jan 30, 2020
5ea8ca9
feat: move to typescript code generation (#332)
xiaozhenliu-gg5 Mar 6, 2020
22b532c
chore(deps): update dependency uuid to v7 (#334)
renovate-bot Mar 9, 2020
29f7bae
docs: move samples out of branch (#338)
nnegrey Mar 12, 2020
47db106
chore: release 1.11.0 (#330)
release-please[bot] Mar 12, 2020
db8256a
docs: move and update beta video classification samples (#339)
nnegrey Mar 16, 2020
a3cbb72
docs: move and update beta list samples for video (#344)
nnegrey Mar 17, 2020
54cdb1d
docs: update batch test (#345)
nnegrey Mar 17, 2020
00202ff
docs: move and update beta video object tracking samples (#340)
nnegrey Mar 17, 2020
9c1b151
docs: update beta delete samples for video (#342)
nnegrey Mar 17, 2020
912768b
docs: move and update beta import samples (#341)
nnegrey Mar 17, 2020
e156136
docs: delete samples that are no longer used in docs and tests are sk…
nnegrey Mar 19, 2020
973ec04
docs: move and update beta get samples for video (#343)
nnegrey Mar 24, 2020
2bfa321
feat!: drop node8 support, support for async iterators (#364)
alexander-fenster Apr 1, 2020
a034ce8
test: deal with concurrent import (#368)
bcoe Apr 6, 2020
cc72859
test: another race condition (#369)
bcoe Apr 6, 2020
9c0f11b
test: standardize retry logic (#371)
bcoe Apr 7, 2020
13e3530
chore: release 2.0.0 (#365)
release-please[bot] Apr 7, 2020
e287524
chore: cleanup synth.py (#386)
xiaozhenliu-gg5 Apr 15, 2020
542cdaa
chore(deps): update dependency uuid to v8 (#395)
renovate-bot May 1, 2020
8180cf1
chore(deps): update dependency @google-cloud/storage to v5 (#401)
renovate-bot May 15, 2020
1168797
fix(deps): update dependency mathjs to v7 (#400)
renovate-bot May 15, 2020
d97d0e9
chore(samples): tables-related snippet cleanup (#392)
Strykrol May 15, 2020
bd319b0
automl: remove extraneous region tagging (#391)
Strykrol May 15, 2020
c7e9f24
chore: release 2.1.0 (#398)
release-please[bot] Jun 4, 2020
1e418ee
chore(deps): update dependency mocha to v8 (#408)
renovate-bot Jun 11, 2020
6426f3f
chore: release 2.2.0 (#407)
release-please[bot] Jun 29, 2020
50a9d09
samples: refactor autoMl table, enable IT test (#423)
munkhuushmgl Jul 15, 2020
e80c701
docs(automl_video_intelligence_classification): remove unused samples…
Strykrol Jul 15, 2020
1374ff1
samples: restored deleted sample and added test for it (#430)
munkhuushmgl Jul 20, 2020
7ff7665
samples: moving autoML samples from nodejs-translate and refactored t…
munkhuushmgl Aug 4, 2020
e52deb0
build: update kokoro build config (#439)
bcoe Sep 9, 2020
bb65ace
fix(deps): update dependency yargs to v16 (#438)
renovate-bot Sep 9, 2020
575837a
samples: fix line endings (#443)
bcoe Sep 10, 2020
81f361d
build: update to latest build and publish config (#448)
yoshi-automation Sep 13, 2020
f5a94fb
samples: disable automl create model tests becuase they have no teard…
munkhuushmgl Sep 17, 2020
6e52fd4
chore: prep tables snippets for sample browser (#462)
sirtorry Oct 23, 2020
4948a8c
build(node_library): migrate to Trampoline V2 (#456)
yoshi-automation Oct 27, 2020
7fde7c0
chore: release 2.3.0 (#461)
release-please[bot] Oct 27, 2020
925aee7
docs(deps): update dependency mathjs to v8 (#464)
renovate-bot Nov 7, 2020
9923266
chore: release 2.3.1 (#467)
release-please[bot] Dec 2, 2020
96d7a0e
chore: refactor and cleanup automl tests (#468)
munkhuushmgl Dec 22, 2020
76302a9
chore: release 2.4.0 (#479)
release-please[bot] Jan 12, 2021
c32de4a
fix: Wrote inputs as string to facilitate parsing (#480)
ivanmkc Jan 15, 2021
9b80b1e
fix(deps): update dependency mathjs to v9 (#482)
renovate-bot Jan 19, 2021
115e8b3
chore: release 2.4.1 (#481)
release-please[bot] Mar 8, 2021
e8d1c4b
chore: release 2.4.2 (#502)
release-please[bot] May 13, 2021
02d4e8d
chore: refactored samples to catch missing exception (#511)
munkhuushmgl May 24, 2021
65bb4fa
chore: release 2.4.3 (#520)
release-please[bot] Jul 21, 2021
899c872
chore: release 2.4.4 (#537)
release-please[bot] Aug 11, 2021
5658559
docs: fix typo in sample (#534)
ey00 Aug 13, 2021
b5c02a1
chore: release 2.4.5 (#539)
release-please[bot] Aug 17, 2021
254635e
chore: release 2.5.0 (#541)
release-please[bot] Oct 15, 2021
b479b1c
fix(deps): update dependency mathjs to v10 (#559)
renovate-bot Nov 8, 2021
70dfcbf
chore: release 2.5.1 (#560)
release-please[bot] Nov 8, 2021
188bced
test: Added retries to automlTablesPredict sample test (#561)
kweinmeister Nov 9, 2021
5801dd0
test: Add retries to additional function in AutoML Tables Predict tes…
kweinmeister Nov 10, 2021
453ea67
docs(samples): add example tags to generated samples (#563)
gcf-owl-bot[bot] Nov 10, 2021
d4c98fc
docs: Removed metadata comment from sample (#570)
nayaknishant Dec 9, 2021
a466970
fix(deps): update dependency csv to v6 (#565)
renovate-bot Dec 30, 2021
201260d
chore: release 2.5.2 (#576)
release-please[bot] Dec 31, 2021
6851582
samples: remove the json parse for inputs parameter (#582)
danieljbruce Jan 25, 2022
2bd8d77
build!: update library to use Node 12 (#613)
sofisl May 20, 2022
99574f7
chore(deps): update dependency @google-cloud/storage to v6 (#614)
renovate-bot Jun 20, 2022
5e82ef9
chore(main): release 3.0.0 (#612)
release-please[bot] Jun 20, 2022
d3a8a50
fix(deps): update dependency mathjs to v11 (#622)
renovate-bot Jul 29, 2022
1321511
chore(main): release 3.1.0 (#619)
release-please[bot] Aug 23, 2022
17ece29
chore(main): release 3.1.1 (#630)
release-please[bot] Sep 7, 2022
b223849
chore(deps): update dependency uuid to v9 (#631)
renovate-bot Sep 9, 2022
1b02a4b
chore(main): release 3.1.2 (#635)
release-please[bot] Oct 17, 2022
344f789
Delete quickstart.js
Nov 14, 2022
f7ef280
Add workflows config
Nov 14, 2022
5c56960
Add missing TABLE_MODEL_ID env var
Nov 15, 2022
73bdbda
Fix typo in region tag
Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/automl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: automl
on:
push:
branches:
- main
paths:
- 'automl/**'
pull_request:
paths:
- 'automl/**'
pull_request_target:
types: [labeled]
schedule:
- cron: '0 0 * * 0'
jobs:
test:
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'actions:force-run' }}
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: 'write'
pull-requests: 'write'
id-token: 'write'
steps:
- uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: google-github-actions/auth@v1.0.0
with:
workload_identity_provider: 'projects/1046198160504/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider'
service_account: 'kokoro-system-test@long-door-651.iam.gserviceaccount.com'
create_credentials_file: 'true'
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
access_token_lifetime: 600s
- id: secrets
uses: 'google-github-actions/get-secretmanager-secrets@v0'
with:
secrets: |-
table_model_id:nodejs-docs-samples-tests/nodejs-docs-samples-table-model-id
- uses: actions/setup-node@v3
with:
node-version: 14
- run: npm install
working-directory: automl
- run: npm test
working-directory: automl
env:
MOCHA_REPORTER_SUITENAME: automl
MOCHA_REPORTER_OUTPUT: automl_sponge_log.xml
MOCHA_REPORTER: xunit
TABLE_MODEL_ID: ${{ steps.secrets.outputs.table_model_id }}
- if: ${{ github.event.action == 'labeled' && github.event.label.name == 'actions:force-run' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
try {
await github.rest.issues.removeLabel({
name: 'actions:force-run',
owner: 'GoogleCloudPlatform',
repo: 'nodejs-docs-samples',
issue_number: context.payload.pull_request.number
});
} catch (e) {
if (!e.message.includes('Label does not exist')) {
throw e;
}
}
- if: ${{ github.event_name == 'schedule' && always() }}
run: |
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
chmod +x ./flakybot
./flakybot --repo GoogleCloudPlatform/nodejs-docs-samples --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
1 change: 1 addition & 0 deletions .github/workflows/workflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"appengine/storage/flexible",
"appengine/storage/standard",
"auth",
"automl",
"appengine/typescript",
"appengine/websockets",
"appengine/twilio",
Expand Down
3 changes: 3 additions & 0 deletions automl/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
rules:
no-console: off
74 changes: 74 additions & 0 deletions automl/batch_predict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(
projectId = 'YOUR_PROJECT_ID',
location = 'us-central1',
modelId = 'YOUR_MODEL_ID',
inputUri = 'gs://YOUR_BUCKET_ID/path_to_your_input_csv_or_jsonl',
outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/'
) {
// [START automl_batch_predict]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'YOUR_PROJECT_ID';
// const location = 'us-central1';
// const modelId = 'YOUR_MODEL_ID';
// const inputUri = 'gs://YOUR_BUCKET_ID/path_to_your_input_csv_or_jsonl';
// const outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/';

// Imports the Google Cloud AutoML library
const {PredictionServiceClient} = require('@google-cloud/automl').v1;

// Instantiates a client
const client = new PredictionServiceClient();

async function batchPredict() {
// Construct request
const request = {
name: client.modelPath(projectId, location, modelId),
inputConfig: {
gcsSource: {
inputUris: [inputUri],
},
},
outputConfig: {
gcsDestination: {
outputUriPrefix: outputUri,
},
},
};

const [operation] = await client.batchPredict(request);

console.log('Waiting for operation to complete...');
// Wait for operation to complete.
const [response] = await operation.promise();
console.log(
`Batch Prediction results saved to Cloud Storage bucket. ${response}`
);
}

batchPredict();
// [END automl_batch_predict]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
74 changes: 74 additions & 0 deletions automl/beta/batch_predict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(
projectId = 'YOUR_PROJECT_ID',
location = 'us-central1',
modelId = 'YOUR_MODEL_ID',
inputUri = 'gs://YOUR_BUCKET_ID/path_to_your_input_csv_or_jsonl',
outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/'
) {
// [START automl_batch_predict_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'YOUR_PROJECT_ID';
// const location = 'us-central1';
// const modelId = 'YOUR_MODEL_ID';
// const inputUri = 'gs://YOUR_BUCKET_ID/path_to_your_input_csv_or_jsonl';
// const outputUri = 'gs://YOUR_BUCKET_ID/path_to_save_results/';

// Imports the Google Cloud AutoML library
const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new PredictionServiceClient();

async function batchPredict() {
// Construct request
const request = {
name: client.modelPath(projectId, location, modelId),
inputConfig: {
gcsSource: {
inputUris: [inputUri],
},
},
outputConfig: {
gcsDestination: {
outputUriPrefix: outputUri,
},
},
};

const [operation] = await client.batchPredict(request);

console.log('Waiting for operation to complete...');
// Wait for operation to complete.
const [response] = await operation.promise();
console.log(
`Batch Prediction results saved to Cloud Storage bucket. ${response}`
);
}

batchPredict();
// [END automl_batch_predict_beta]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
51 changes: 51 additions & 0 deletions automl/beta/cancel_operation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

async function main(operationFullId) {
// [START automl_cancel_operation_beta]

/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const operationFullId = 'projects/YOUR_PROJECT_ID/locations/YOUR_LOCATIOIN/operations/OPERATION_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();

async function cancelOperation() {
client.operationsClient.cancelOperation({
name: operationFullId,
});

// Wait for operation to complete.
console.log('Cancelled operation');
}

cancelOperation();
// [END automl_cancel_operation_beta]
}

main(...process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exitCode = 1;
});
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
57 changes: 57 additions & 0 deletions automl/beta/delete-dataset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(
projectId = 'YOUR_PROJECT_ID',
location = 'us-central1',
datasetId = 'YOUR_DATASET_ID'
) {
// [START automl_delete_dataset_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'YOUR_PROJECT_ID';
// const location = 'us-central1';
// const datasetId = 'YOUR_DATASET_ID';

// Imports the Google Cloud AutoML library
const {AutoMlClient} = require('@google-cloud/automl').v1beta1;

// Instantiates a client
const client = new AutoMlClient();

async function deleteDataset() {
// Construct request
const request = {
name: client.datasetPath(projectId, location, datasetId),
};

const [operation] = await client.deleteDataset(request);

// Wait for operation to complete.
const [response] = await operation.promise();
console.log(`Dataset deleted: ${response}`);
}

deleteDataset();
// [END automl_delete_dataset_beta]
}

process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Loading