-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(npm): add artifact name for npm (#284)
docs: adds generated samples PiperOrigin-RevId: 408439482 PiperOrigin-RevId: 411579858 Source-Link: googleapis/googleapis@4bd5f4b Source-Link: googleapis/googleapis-gen@c7653e1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzc2NTNlMTcyOGQxYTkyNmJmZWZmY2E0ZGU0YWUyMDRmZjE3Y2Y1NCJ9 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4072dff
commit 6582ece
Showing
21 changed files
with
1,378 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
"img.shields.io" | ||
], | ||
"silent": true, | ||
"concurrency": 10 | ||
"concurrency": 5 | ||
} |
67 changes: 67 additions & 0 deletions
67
...oud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2021 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(name) { | ||
// [START documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The processor resource name. | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* The input documents for batch process. | ||
*/ | ||
// const inputDocuments = {} | ||
/** | ||
* The overall output config for batch process. | ||
*/ | ||
// const documentOutputConfig = {} | ||
/** | ||
* Whether Human Review feature should be skipped for this request. Default to | ||
* false. | ||
*/ | ||
// const skipHumanReview = true | ||
|
||
// Imports the Documentai library | ||
const {DocumentProcessorServiceClient} = | ||
require('@google-cloud/documentai').v1; | ||
|
||
// Instantiates a client | ||
const documentaiClient = new DocumentProcessorServiceClient(); | ||
|
||
async function callBatchProcessDocuments() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await documentaiClient.batchProcessDocuments(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callBatchProcessDocuments(); | ||
// [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
66 changes: 66 additions & 0 deletions
66
...ogle-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2021 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(name) { | ||
// [START documentai_v1_generated_DocumentProcessorService_ProcessDocument_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* An inline document proto. | ||
*/ | ||
// const inlineDocument = {} | ||
/** | ||
* A raw document content (bytes). | ||
*/ | ||
// const rawDocument = {} | ||
/** | ||
* Required. The processor resource name. | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Whether Human Review feature should be skipped for this request. Default to | ||
* false. | ||
*/ | ||
// const skipHumanReview = true | ||
|
||
// Imports the Documentai library | ||
const {DocumentProcessorServiceClient} = | ||
require('@google-cloud/documentai').v1; | ||
|
||
// Instantiates a client | ||
const documentaiClient = new DocumentProcessorServiceClient(); | ||
|
||
async function callProcessDocument() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const response = await documentaiClient.processDocument(request); | ||
console.log(response); | ||
} | ||
|
||
callProcessDocument(); | ||
// [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
67 changes: 67 additions & 0 deletions
67
...oogle-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright 2021 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(humanReviewConfig) { | ||
// [START documentai_v1_generated_DocumentProcessorService_ReviewDocument_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* An inline document proto. | ||
*/ | ||
// const inlineDocument = {} | ||
/** | ||
* Required. The resource name of the HumanReviewConfig that the document will be | ||
* reviewed with. | ||
*/ | ||
// const humanReviewConfig = 'abc123' | ||
/** | ||
* Whether the validation should be performed on the ad-hoc review request. | ||
*/ | ||
// const enableSchemaValidation = true | ||
/** | ||
* The priority of the human review task. | ||
*/ | ||
// const priority = {} | ||
|
||
// Imports the Documentai library | ||
const {DocumentProcessorServiceClient} = | ||
require('@google-cloud/documentai').v1; | ||
|
||
// Instantiates a client | ||
const documentaiClient = new DocumentProcessorServiceClient(); | ||
|
||
async function callReviewDocument() { | ||
// Construct request | ||
const request = { | ||
humanReviewConfig, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await documentaiClient.reviewDocument(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callReviewDocument(); | ||
// [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
60 changes: 60 additions & 0 deletions
60
...entai/samples/generated/v1beta1/document_understanding_service.batch_process_documents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2021 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(requests) { | ||
// [START documentai_v1beta1_generated_DocumentUnderstandingService_BatchProcessDocuments_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Individual requests for each document. | ||
*/ | ||
// const requests = 1234 | ||
/** | ||
* Target project and location to make a call. | ||
* Format: `projects/{project-id}/locations/{location-id}`. | ||
* If no location is specified, a region will be chosen automatically. | ||
*/ | ||
// const parent = 'abc123' | ||
|
||
// Imports the Documentai library | ||
const {DocumentUnderstandingServiceClient} = | ||
require('@google-cloud/documentai').v1beta1; | ||
|
||
// Instantiates a client | ||
const documentaiClient = new DocumentUnderstandingServiceClient(); | ||
|
||
async function callBatchProcessDocuments() { | ||
// Construct request | ||
const request = { | ||
requests, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await documentaiClient.batchProcessDocuments(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callBatchProcessDocuments(); | ||
// [END documentai_v1beta1_generated_DocumentUnderstandingService_BatchProcessDocuments_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
60 changes: 60 additions & 0 deletions
60
...entai/samples/generated/v1beta2/document_understanding_service.batch_process_documents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2021 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(requests) { | ||
// [START documentai_v1beta2_generated_DocumentUnderstandingService_BatchProcessDocuments_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. Individual requests for each document. | ||
*/ | ||
// const requests = 1234 | ||
/** | ||
* Target project and location to make a call. | ||
* Format: `projects/{project-id}/locations/{location-id}`. | ||
* If no location is specified, a region will be chosen automatically. | ||
*/ | ||
// const parent = 'abc123' | ||
|
||
// Imports the Documentai library | ||
const {DocumentUnderstandingServiceClient} = | ||
require('@google-cloud/documentai').v1beta2; | ||
|
||
// Instantiates a client | ||
const documentaiClient = new DocumentUnderstandingServiceClient(); | ||
|
||
async function callBatchProcessDocuments() { | ||
// Construct request | ||
const request = { | ||
requests, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await documentaiClient.batchProcessDocuments(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callBatchProcessDocuments(); | ||
// [END documentai_v1beta2_generated_DocumentUnderstandingService_BatchProcessDocuments_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.