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 18namespace Google\Service\Vision\Resource; 19 20use Google\Service\Vision\AsyncBatchAnnotateFilesRequest; 21use Google\Service\Vision\BatchAnnotateFilesRequest; 22use Google\Service\Vision\BatchAnnotateFilesResponse; 23use 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 */ 33class ProjectsLocationsFiles 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 string $parent Optional. Target project and location to make a call. 44 * Format: `projects/{project-id}/locations/{location-id}`. If no parent is 45 * specified, a region will be chosen automatically. Supported location-ids: 46 * `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 47 * The European Union. Example: `projects/project-A/locations/eu`. 48 * @param BatchAnnotateFilesRequest $postBody 49 * @param array $optParams Optional parameters. 50 * @return BatchAnnotateFilesResponse 51 */ 52 public function annotate($parent, BatchAnnotateFilesRequest $postBody, $optParams = []) 53 { 54 $params = ['parent' => $parent, 'postBody' => $postBody]; 55 $params = array_merge($params, $optParams); 56 return $this->call('annotate', [$params], BatchAnnotateFilesResponse::class); 57 } 58 /** 59 * Run asynchronous image detection and annotation for a list of generic files, 60 * such as PDF files, which may contain multiple pages and multiple images per 61 * page. Progress and results can be retrieved through the 62 * `google.longrunning.Operations` interface. `Operation.metadata` contains 63 * `OperationMetadata` (metadata). `Operation.response` contains 64 * `AsyncBatchAnnotateFilesResponse` (results). (files.asyncBatchAnnotate) 65 * 66 * @param string $parent Optional. Target project and location to make a call. 67 * Format: `projects/{project-id}/locations/{location-id}`. If no parent is 68 * specified, a region will be chosen automatically. Supported location-ids: 69 * `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`: 70 * The European Union. Example: `projects/project-A/locations/eu`. 71 * @param AsyncBatchAnnotateFilesRequest $postBody 72 * @param array $optParams Optional parameters. 73 * @return Operation 74 */ 75 public function asyncBatchAnnotate($parent, AsyncBatchAnnotateFilesRequest $postBody, $optParams = []) 76 { 77 $params = ['parent' => $parent, 'postBody' => $postBody]; 78 $params = array_merge($params, $optParams); 79 return $this->call('asyncBatchAnnotate', [$params], Operation::class); 80 } 81} 82 83// Adding a class alias for backwards compatibility with the previous class name. 84class_alias(ProjectsLocationsFiles::class, 'Google_Service_Vision_Resource_ProjectsLocationsFiles'); 85