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