Skip to content

Commit 179b0af

Browse files
authored
samples: updates v1beta3 to v1; renames v1beta2 samples (#198)
1 parent 8669965 commit 179b0af

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

packages/google-cloud-documentai/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ npm install @google-cloud/documentai
6868

6969
const {
7070
DocumentProcessorServiceClient,
71-
} = require('@google-cloud/documentai').v1beta3;
71+
} = require('@google-cloud/documentai').v1;
7272

7373
// Instantiates a client
7474
const client = new DocumentProcessorServiceClient();
@@ -88,7 +88,7 @@ async function quickstart() {
8888

8989
const request = {
9090
name,
91-
document: {
91+
rawDocument: {
9292
content: encodedImage,
9393
mimeType: 'application/pdf',
9494
},
@@ -135,15 +135,15 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-document-ai
135135

136136
| Sample | Source Code | Try it |
137137
| --------------------------- | --------------------------------- | ------ |
138-
| Batch-process-document.v1beta3 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-process-document.v1beta3.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-process-document.v1beta3.js,samples/README.md) |
139-
| Batch_parse_form | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch_parse_form.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch_parse_form.js,samples/README.md) |
140-
| Batch_parse_table | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch_parse_table.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch_parse_table.js,samples/README.md) |
141-
| Parse_form | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_form.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_form.js,samples/README.md) |
142-
| Parse_table | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_table.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_table.js,samples/README.md) |
143-
| Parse_with_model | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_with_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_with_model.js,samples/README.md) |
144-
| Process-document.v1beta3 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/process-document.v1beta3.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/process-document.v1beta3.js,samples/README.md) |
138+
| Batch-parse-form.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-parse-form.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-parse-form.v1beta2.js,samples/README.md) |
139+
| Batch-parse-table.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-parse-table.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-parse-table.v1beta2.js,samples/README.md) |
140+
| Batch-process-document | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-process-document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-process-document.js,samples/README.md) |
141+
| Parse-form.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-form.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-form.v1beta2.js,samples/README.md) |
142+
| Parse-table.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-table.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-table.v1beta2.js,samples/README.md) |
143+
| Parse-with-model.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-with-model.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-with-model.v1beta2.js,samples/README.md) |
144+
| Process-document | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/process-document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/process-document.js,samples/README.md) |
145145
| Quickstart | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
146-
| Set_endpoint | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/set_endpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/set_endpoint.js,samples/README.md) |
146+
| Set-endpoint.v1beta2 | [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/set-endpoint.v1beta2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/set-endpoint.v1beta2.js,samples/README.md) |
147147

148148

149149

packages/google-cloud-documentai/samples/README.md

+40-40
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
* [Before you begin](#before-you-begin)
1414
* [Samples](#samples)
15-
* [Batch-process-document.v1beta3](#batch-process-document.v1beta3)
16-
* [Batch_parse_form](#batch_parse_form)
17-
* [Batch_parse_table](#batch_parse_table)
18-
* [Parse_form](#parse_form)
19-
* [Parse_table](#parse_table)
20-
* [Parse_with_model](#parse_with_model)
21-
* [Process-document.v1beta3](#process-document.v1beta3)
15+
* [Batch-parse-form.v1beta2](#batch-parse-form.v1beta2)
16+
* [Batch-parse-table.v1beta2](#batch-parse-table.v1beta2)
17+
* [Batch-process-document](#batch-process-document)
18+
* [Parse-form.v1beta2](#parse-form.v1beta2)
19+
* [Parse-table.v1beta2](#parse-table.v1beta2)
20+
* [Parse-with-model.v1beta2](#parse-with-model.v1beta2)
21+
* [Process-document](#process-document)
2222
* [Quickstart](#quickstart)
23-
* [Set_endpoint](#set_endpoint)
23+
* [Set-endpoint.v1beta2](#set-endpoint.v1beta2)
2424

2525
## Before you begin
2626

@@ -37,118 +37,118 @@ Before running the samples, make sure you've followed the steps outlined in
3737

3838

3939

40-
### Batch-process-document.v1beta3
40+
### Batch-parse-form.v1beta2
4141

42-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-process-document.v1beta3.js).
42+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-parse-form.v1beta2.js).
4343

44-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-process-document.v1beta3.js,samples/README.md)
44+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-parse-form.v1beta2.js,samples/README.md)
4545

4646
__Usage:__
4747

4848

49-
`node samples/batch-process-document.v1beta3.js`
49+
`node samples/batch-parse-form.v1beta2.js`
5050

5151

5252
-----
5353

5454

5555

5656

57-
### Batch_parse_form
57+
### Batch-parse-table.v1beta2
5858

59-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch_parse_form.js).
59+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-parse-table.v1beta2.js).
6060

61-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch_parse_form.js,samples/README.md)
61+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-parse-table.v1beta2.js,samples/README.md)
6262

6363
__Usage:__
6464

6565

66-
`node samples/batch_parse_form.js`
66+
`node samples/batch-parse-table.v1beta2.js`
6767

6868

6969
-----
7070

7171

7272

7373

74-
### Batch_parse_table
74+
### Batch-process-document
7575

76-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch_parse_table.js).
76+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/batch-process-document.js).
7777

78-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch_parse_table.js,samples/README.md)
78+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/batch-process-document.js,samples/README.md)
7979

8080
__Usage:__
8181

8282

83-
`node samples/batch_parse_table.js`
83+
`node samples/batch-process-document.js`
8484

8585

8686
-----
8787

8888

8989

9090

91-
### Parse_form
91+
### Parse-form.v1beta2
9292

93-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_form.js).
93+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-form.v1beta2.js).
9494

95-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_form.js,samples/README.md)
95+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-form.v1beta2.js,samples/README.md)
9696

9797
__Usage:__
9898

9999

100-
`node samples/parse_form.js`
100+
`node samples/parse-form.v1beta2.js`
101101

102102

103103
-----
104104

105105

106106

107107

108-
### Parse_table
108+
### Parse-table.v1beta2
109109

110-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_table.js).
110+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-table.v1beta2.js).
111111

112-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_table.js,samples/README.md)
112+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-table.v1beta2.js,samples/README.md)
113113

114114
__Usage:__
115115

116116

117-
`node samples/parse_table.js`
117+
`node samples/parse-table.v1beta2.js`
118118

119119

120120
-----
121121

122122

123123

124124

125-
### Parse_with_model
125+
### Parse-with-model.v1beta2
126126

127-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse_with_model.js).
127+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/parse-with-model.v1beta2.js).
128128

129-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse_with_model.js,samples/README.md)
129+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/parse-with-model.v1beta2.js,samples/README.md)
130130

131131
__Usage:__
132132

133133

134-
`node samples/parse_with_model.js`
134+
`node samples/parse-with-model.v1beta2.js`
135135

136136

137137
-----
138138

139139

140140

141141

142-
### Process-document.v1beta3
142+
### Process-document
143143

144-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/process-document.v1beta3.js).
144+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/process-document.js).
145145

146-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/process-document.v1beta3.js,samples/README.md)
146+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/process-document.js,samples/README.md)
147147

148148
__Usage:__
149149

150150

151-
`node samples/process-document.v1beta3.js`
151+
`node samples/process-document.js`
152152

153153

154154
-----
@@ -173,16 +173,16 @@ __Usage:__
173173

174174

175175

176-
### Set_endpoint
176+
### Set-endpoint.v1beta2
177177

178-
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/set_endpoint.js).
178+
View the [source code](https://github.com/googleapis/nodejs-document-ai/blob/master/samples/set-endpoint.v1beta2.js).
179179

180-
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/set_endpoint.js,samples/README.md)
180+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-document-ai&page=editor&open_in_editor=samples/set-endpoint.v1beta2.js,samples/README.md)
181181

182182
__Usage:__
183183

184184

185-
`node samples/set_endpoint.js`
185+
`node samples/set-endpoint.v1beta2.js`
186186

187187

188188

packages/google-cloud-documentai/samples/quickstart.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function main(projectId, location, processorId, filePath) {
2727

2828
const {
2929
DocumentProcessorServiceClient,
30-
} = require('@google-cloud/documentai').v1beta3;
30+
} = require('@google-cloud/documentai').v1;
3131

3232
// Instantiates a client
3333
const client = new DocumentProcessorServiceClient();
@@ -47,7 +47,7 @@ async function main(projectId, location, processorId, filePath) {
4747

4848
const request = {
4949
name,
50-
document: {
50+
rawDocument: {
5151
content: encodedImage,
5252
mimeType: 'application/pdf',
5353
},

0 commit comments

Comments
 (0)