[e3d4e0a] | 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\Vision\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Vision\AsyncBatchAnnotateFilesRequest;
|
---|
| 21 | use Google\Service\Vision\BatchAnnotateFilesRequest;
|
---|
| 22 | use Google\Service\Vision\BatchAnnotateFilesResponse;
|
---|
| 23 | use Google\Service\Vision\Operation;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "files" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $visionService = new Google\Service\Vision(...);
|
---|
| 30 | * $files = $visionService->files;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class Files extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Service that performs image detection and annotation for a batch of files.
|
---|
| 37 | * Now only "application/pdf", "image/tiff" and "image/gif" are supported. This
|
---|
| 38 | * service will extract at most 5 (customers can specify which 5 in
|
---|
| 39 | * AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file
|
---|
| 40 | * provided and perform detection and annotation for each image extracted.
|
---|
| 41 | * (files.annotate)
|
---|
| 42 | *
|
---|
| 43 | * @param BatchAnnotateFilesRequest $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | * @return BatchAnnotateFilesResponse
|
---|
| 46 | * @throws \Google\Service\Exception
|
---|
| 47 | */
|
---|
| 48 | public function annotate(BatchAnnotateFilesRequest $postBody, $optParams = [])
|
---|
| 49 | {
|
---|
| 50 | $params = ['postBody' => $postBody];
|
---|
| 51 | $params = array_merge($params, $optParams);
|
---|
| 52 | return $this->call('annotate', [$params], BatchAnnotateFilesResponse::class);
|
---|
| 53 | }
|
---|
| 54 | /**
|
---|
| 55 | * Run asynchronous image detection and annotation for a list of generic files,
|
---|
| 56 | * such as PDF files, which may contain multiple pages and multiple images per
|
---|
| 57 | * page. Progress and results can be retrieved through the
|
---|
| 58 | * `google.longrunning.Operations` interface. `Operation.metadata` contains
|
---|
| 59 | * `OperationMetadata` (metadata). `Operation.response` contains
|
---|
| 60 | * `AsyncBatchAnnotateFilesResponse` (results). (files.asyncBatchAnnotate)
|
---|
| 61 | *
|
---|
| 62 | * @param AsyncBatchAnnotateFilesRequest $postBody
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return Operation
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function asyncBatchAnnotate(AsyncBatchAnnotateFilesRequest $postBody, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['postBody' => $postBody];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('asyncBatchAnnotate', [$params], Operation::class);
|
---|
| 72 | }
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 76 | class_alias(Files::class, 'Google_Service_Vision_Resource_Files');
|
---|