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\AsyncBatchAnnotateImagesRequest; 21use Google\Service\Vision\BatchAnnotateImagesRequest; 22use Google\Service\Vision\BatchAnnotateImagesResponse; 23use Google\Service\Vision\Operation; 24 25/** 26 * The "images" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $visionService = new Google\Service\Vision(...); 30 * $images = $visionService->images; 31 * </code> 32 */ 33class Images extends \Google\Service\Resource 34{ 35 /** 36 * Run image detection and annotation for a batch of images. (images.annotate) 37 * 38 * @param BatchAnnotateImagesRequest $postBody 39 * @param array $optParams Optional parameters. 40 * @return BatchAnnotateImagesResponse 41 */ 42 public function annotate(BatchAnnotateImagesRequest $postBody, $optParams = []) 43 { 44 $params = ['postBody' => $postBody]; 45 $params = array_merge($params, $optParams); 46 return $this->call('annotate', [$params], BatchAnnotateImagesResponse::class); 47 } 48 /** 49 * Run asynchronous image detection and annotation for a list of images. 50 * Progress and results can be retrieved through the 51 * `google.longrunning.Operations` interface. `Operation.metadata` contains 52 * `OperationMetadata` (metadata). `Operation.response` contains 53 * `AsyncBatchAnnotateImagesResponse` (results). This service will write image 54 * annotation outputs to json files in customer GCS bucket, each json file 55 * containing BatchAnnotateImagesResponse proto. (images.asyncBatchAnnotate) 56 * 57 * @param AsyncBatchAnnotateImagesRequest $postBody 58 * @param array $optParams Optional parameters. 59 * @return Operation 60 */ 61 public function asyncBatchAnnotate(AsyncBatchAnnotateImagesRequest $postBody, $optParams = []) 62 { 63 $params = ['postBody' => $postBody]; 64 $params = array_merge($params, $optParams); 65 return $this->call('asyncBatchAnnotate', [$params], Operation::class); 66 } 67} 68 69// Adding a class alias for backwards compatibility with the previous class name. 70class_alias(Images::class, 'Google_Service_Vision_Resource_Images'); 71