1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Document\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Document\GoogleCloudDocumentaiV1BatchProcessRequest;
|
---|
21 | use Google\Service\Document\GoogleCloudDocumentaiV1DeployProcessorVersionRequest;
|
---|
22 | use Google\Service\Document\GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest;
|
---|
23 | use Google\Service\Document\GoogleCloudDocumentaiV1ListProcessorVersionsResponse;
|
---|
24 | use Google\Service\Document\GoogleCloudDocumentaiV1ProcessRequest;
|
---|
25 | use Google\Service\Document\GoogleCloudDocumentaiV1ProcessResponse;
|
---|
26 | use Google\Service\Document\GoogleCloudDocumentaiV1ProcessorVersion;
|
---|
27 | use Google\Service\Document\GoogleCloudDocumentaiV1TrainProcessorVersionRequest;
|
---|
28 | use Google\Service\Document\GoogleCloudDocumentaiV1UndeployProcessorVersionRequest;
|
---|
29 | use Google\Service\Document\GoogleLongrunningOperation;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "processorVersions" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $documentaiService = new Google\Service\Document(...);
|
---|
36 | * $processorVersions = $documentaiService->projects_locations_processors_processorVersions;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsProcessorsProcessorVersions extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * LRO endpoint to batch process many documents. The output is written to Cloud
|
---|
43 | * Storage as JSON in the [Document] format. (processorVersions.batchProcess)
|
---|
44 | *
|
---|
45 | * @param string $name Required. The resource name of Processor or
|
---|
46 | * ProcessorVersion. Format:
|
---|
47 | * `projects/{project}/locations/{location}/processors/{processor}`, or `project
|
---|
48 | * s/{project}/locations/{location}/processors/{processor}/processorVersions/{pr
|
---|
49 | * ocessorVersion}`
|
---|
50 | * @param GoogleCloudDocumentaiV1BatchProcessRequest $postBody
|
---|
51 | * @param array $optParams Optional parameters.
|
---|
52 | * @return GoogleLongrunningOperation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function batchProcess($name, GoogleCloudDocumentaiV1BatchProcessRequest $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('batchProcess', [$params], GoogleLongrunningOperation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Deletes the processor version, all artifacts under the processor version will
|
---|
63 | * be deleted. (processorVersions.delete)
|
---|
64 | *
|
---|
65 | * @param string $name Required. The processor version resource name to be
|
---|
66 | * deleted.
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return GoogleLongrunningOperation
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function delete($name, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['name' => $name];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Deploys the processor version. (processorVersions.deploy)
|
---|
79 | *
|
---|
80 | * @param string $name Required. The processor version resource name to be
|
---|
81 | * deployed.
|
---|
82 | * @param GoogleCloudDocumentaiV1DeployProcessorVersionRequest $postBody
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return GoogleLongrunningOperation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function deploy($name, GoogleCloudDocumentaiV1DeployProcessorVersionRequest $postBody, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('deploy', [$params], GoogleLongrunningOperation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Evaluates a ProcessorVersion against annotated documents, producing an
|
---|
95 | * Evaluation. (processorVersions.evaluateProcessorVersion)
|
---|
96 | *
|
---|
97 | * @param string $processorVersion Required. The resource name of the
|
---|
98 | * ProcessorVersion to evaluate. `projects/{project}/locations/{location}/proces
|
---|
99 | * sors/{processor}/processorVersions/{processorVersion}`
|
---|
100 | * @param GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest $postBody
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | * @return GoogleLongrunningOperation
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function evaluateProcessorVersion($processorVersion, GoogleCloudDocumentaiV1EvaluateProcessorVersionRequest $postBody, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['processorVersion' => $processorVersion, 'postBody' => $postBody];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('evaluateProcessorVersion', [$params], GoogleLongrunningOperation::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Gets a processor version detail. (processorVersions.get)
|
---|
113 | *
|
---|
114 | * @param string $name Required. The processor resource name.
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | * @return GoogleCloudDocumentaiV1ProcessorVersion
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function get($name, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['name' => $name];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('get', [$params], GoogleCloudDocumentaiV1ProcessorVersion::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Lists all versions of a processor.
|
---|
127 | * (processorVersions.listProjectsLocationsProcessorsProcessorVersions)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. The parent (project, location and processor)
|
---|
130 | * to list all versions. Format:
|
---|
131 | * `projects/{project}/locations/{location}/processors/{processor}`
|
---|
132 | * @param array $optParams Optional parameters.
|
---|
133 | *
|
---|
134 | * @opt_param int pageSize The maximum number of processor versions to return.
|
---|
135 | * If unspecified, at most `10` processor versions will be returned. The maximum
|
---|
136 | * value is `20`. Values above `20` will be coerced to `20`.
|
---|
137 | * @opt_param string pageToken We will return the processor versions sorted by
|
---|
138 | * creation time. The page token will point to the next processor version.
|
---|
139 | * @return GoogleCloudDocumentaiV1ListProcessorVersionsResponse
|
---|
140 | * @throws \Google\Service\Exception
|
---|
141 | */
|
---|
142 | public function listProjectsLocationsProcessorsProcessorVersions($parent, $optParams = [])
|
---|
143 | {
|
---|
144 | $params = ['parent' => $parent];
|
---|
145 | $params = array_merge($params, $optParams);
|
---|
146 | return $this->call('list', [$params], GoogleCloudDocumentaiV1ListProcessorVersionsResponse::class);
|
---|
147 | }
|
---|
148 | /**
|
---|
149 | * Processes a single document. (processorVersions.process)
|
---|
150 | *
|
---|
151 | * @param string $name Required. The resource name of the Processor or
|
---|
152 | * ProcessorVersion to use for processing. If a Processor is specified, the
|
---|
153 | * server will use its default version. Format:
|
---|
154 | * `projects/{project}/locations/{location}/processors/{processor}`, or `project
|
---|
155 | * s/{project}/locations/{location}/processors/{processor}/processorVersions/{pr
|
---|
156 | * ocessorVersion}`
|
---|
157 | * @param GoogleCloudDocumentaiV1ProcessRequest $postBody
|
---|
158 | * @param array $optParams Optional parameters.
|
---|
159 | * @return GoogleCloudDocumentaiV1ProcessResponse
|
---|
160 | * @throws \Google\Service\Exception
|
---|
161 | */
|
---|
162 | public function process($name, GoogleCloudDocumentaiV1ProcessRequest $postBody, $optParams = [])
|
---|
163 | {
|
---|
164 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
165 | $params = array_merge($params, $optParams);
|
---|
166 | return $this->call('process', [$params], GoogleCloudDocumentaiV1ProcessResponse::class);
|
---|
167 | }
|
---|
168 | /**
|
---|
169 | * Trains a new processor version. Operation metadata is returned as
|
---|
170 | * TrainProcessorVersionMetadata. (processorVersions.train)
|
---|
171 | *
|
---|
172 | * @param string $parent Required. The parent (project, location and processor)
|
---|
173 | * to create the new version for. Format:
|
---|
174 | * `projects/{project}/locations/{location}/processors/{processor}`.
|
---|
175 | * @param GoogleCloudDocumentaiV1TrainProcessorVersionRequest $postBody
|
---|
176 | * @param array $optParams Optional parameters.
|
---|
177 | * @return GoogleLongrunningOperation
|
---|
178 | * @throws \Google\Service\Exception
|
---|
179 | */
|
---|
180 | public function train($parent, GoogleCloudDocumentaiV1TrainProcessorVersionRequest $postBody, $optParams = [])
|
---|
181 | {
|
---|
182 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
183 | $params = array_merge($params, $optParams);
|
---|
184 | return $this->call('train', [$params], GoogleLongrunningOperation::class);
|
---|
185 | }
|
---|
186 | /**
|
---|
187 | * Undeploys the processor version. (processorVersions.undeploy)
|
---|
188 | *
|
---|
189 | * @param string $name Required. The processor version resource name to be
|
---|
190 | * undeployed.
|
---|
191 | * @param GoogleCloudDocumentaiV1UndeployProcessorVersionRequest $postBody
|
---|
192 | * @param array $optParams Optional parameters.
|
---|
193 | * @return GoogleLongrunningOperation
|
---|
194 | * @throws \Google\Service\Exception
|
---|
195 | */
|
---|
196 | public function undeploy($name, GoogleCloudDocumentaiV1UndeployProcessorVersionRequest $postBody, $optParams = [])
|
---|
197 | {
|
---|
198 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
199 | $params = array_merge($params, $optParams);
|
---|
200 | return $this->call('undeploy', [$params], GoogleLongrunningOperation::class);
|
---|
201 | }
|
---|
202 | }
|
---|
203 |
|
---|
204 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
205 | class_alias(ProjectsLocationsProcessorsProcessorVersions::class, 'Google_Service_Document_Resource_ProjectsLocationsProcessorsProcessorVersions');
|
---|