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->images;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class 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 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function annotate(BatchAnnotateImagesRequest $postBody, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['postBody' => $postBody];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('annotate', [$params], BatchAnnotateImagesResponse::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Run asynchronous image detection and annotation for a list of images.
|
---|
51 | * Progress and results can be retrieved through the
|
---|
52 | * `google.longrunning.Operations` interface. `Operation.metadata` contains
|
---|
53 | * `OperationMetadata` (metadata). `Operation.response` contains
|
---|
54 | * `AsyncBatchAnnotateImagesResponse` (results). This service will write image
|
---|
55 | * annotation outputs to json files in customer GCS bucket, each json file
|
---|
56 | * containing BatchAnnotateImagesResponse proto. (images.asyncBatchAnnotate)
|
---|
57 | *
|
---|
58 | * @param AsyncBatchAnnotateImagesRequest $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return Operation
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function asyncBatchAnnotate(AsyncBatchAnnotateImagesRequest $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('asyncBatchAnnotate', [$params], Operation::class);
|
---|
68 | }
|
---|
69 | }
|
---|
70 |
|
---|
71 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
72 | class_alias(Images::class, 'Google_Service_Vision_Resource_Images');
|
---|