Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
build(npm): add artifact name for npm (#284)
Browse files Browse the repository at this point in the history
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
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Nov 23, 2021
1 parent 146dbe6 commit 34df222
Show file tree
Hide file tree
Showing 21 changed files with 1,378 additions and 441 deletions.
2 changes: 1 addition & 1 deletion linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
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));
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 samples/generated/v1/document_processor_service.review_document.js
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));
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));
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));

0 comments on commit 34df222

Please sign in to comment.