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 ProjectsImages extends \Google\Service\Resource
34{
35  /**
36   * Run image detection and annotation for a batch of images. (images.annotate)
37   *
38   * @param string $parent Optional. Target project and location to make a call.
39   * Format: `projects/{project-id}/locations/{location-id}`. If no parent is
40   * specified, a region will be chosen automatically. Supported location-ids:
41   * `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`:
42   * The European Union. Example: `projects/project-A/locations/eu`.
43   * @param BatchAnnotateImagesRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return BatchAnnotateImagesResponse
46   */
47  public function annotate($parent, BatchAnnotateImagesRequest $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('annotate', [$params], BatchAnnotateImagesResponse::class);
52  }
53  /**
54   * Run asynchronous image detection and annotation for a list of images.
55   * Progress and results can be retrieved through the
56   * `google.longrunning.Operations` interface. `Operation.metadata` contains
57   * `OperationMetadata` (metadata). `Operation.response` contains
58   * `AsyncBatchAnnotateImagesResponse` (results). This service will write image
59   * annotation outputs to json files in customer GCS bucket, each json file
60   * containing BatchAnnotateImagesResponse proto. (images.asyncBatchAnnotate)
61   *
62   * @param string $parent Optional. Target project and location to make a call.
63   * Format: `projects/{project-id}/locations/{location-id}`. If no parent is
64   * specified, a region will be chosen automatically. Supported location-ids:
65   * `us`: USA country only, `asia`: East asia areas, like Japan, Taiwan, `eu`:
66   * The European Union. Example: `projects/project-A/locations/eu`.
67   * @param AsyncBatchAnnotateImagesRequest $postBody
68   * @param array $optParams Optional parameters.
69   * @return Operation
70   */
71  public function asyncBatchAnnotate($parent, AsyncBatchAnnotateImagesRequest $postBody, $optParams = [])
72  {
73    $params = ['parent' => $parent, 'postBody' => $postBody];
74    $params = array_merge($params, $optParams);
75    return $this->call('asyncBatchAnnotate', [$params], Operation::class);
76  }
77}
78
79// Adding a class alias for backwards compatibility with the previous class name.
80class_alias(ProjectsImages::class, 'Google_Service_Vision_Resource_ProjectsImages');
81