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\DataLabeling\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1AnnotationSpecSet;
|
---|
21 | use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest;
|
---|
22 | use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse;
|
---|
23 | use Google\Service\DataLabeling\GoogleProtobufEmpty;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "annotationSpecSets" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $datalabelingService = new Google\Service\DataLabeling(...);
|
---|
30 | * $annotationSpecSets = $datalabelingService->projects_annotationSpecSets;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsAnnotationSpecSets extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates an annotation spec set by providing a set of labels.
|
---|
37 | * (annotationSpecSets.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. AnnotationSpecSet resource parent, format:
|
---|
40 | * projects/{project_id}
|
---|
41 | * @param GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return GoogleCloudDatalabelingV1beta1AnnotationSpecSet
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function create($parent, GoogleCloudDatalabelingV1beta1CreateAnnotationSpecSetRequest $postBody, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('create', [$params], GoogleCloudDatalabelingV1beta1AnnotationSpecSet::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Deletes an annotation spec set by resource name. (annotationSpecSets.delete)
|
---|
54 | *
|
---|
55 | * @param string $name Required. AnnotationSpec resource name, format:
|
---|
56 | * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return GoogleProtobufEmpty
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function delete($name, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['name' => $name];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Gets an annotation spec set by resource name. (annotationSpecSets.get)
|
---|
69 | *
|
---|
70 | * @param string $name Required. AnnotationSpecSet resource name, format:
|
---|
71 | * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | * @return GoogleCloudDatalabelingV1beta1AnnotationSpecSet
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function get($name, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['name' => $name];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('get', [$params], GoogleCloudDatalabelingV1beta1AnnotationSpecSet::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Lists annotation spec sets for a project. Pagination is supported.
|
---|
84 | * (annotationSpecSets.listProjectsAnnotationSpecSets)
|
---|
85 | *
|
---|
86 | * @param string $parent Required. Parent of AnnotationSpecSet resource, format:
|
---|
87 | * projects/{project_id}
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | *
|
---|
90 | * @opt_param string filter Optional. Filter is not supported at this moment.
|
---|
91 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
92 | * fewer results than requested. Default value is 100.
|
---|
93 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
94 | * for the server to return. Typically obtained by
|
---|
95 | * ListAnnotationSpecSetsResponse.next_page_token of the previous
|
---|
96 | * [DataLabelingService.ListAnnotationSpecSets] call. Return first page if
|
---|
97 | * empty.
|
---|
98 | * @return GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function listProjectsAnnotationSpecSets($parent, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['parent' => $parent];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('list', [$params], GoogleCloudDatalabelingV1beta1ListAnnotationSpecSetsResponse::class);
|
---|
106 | }
|
---|
107 | }
|
---|
108 |
|
---|
109 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
110 | class_alias(ProjectsAnnotationSpecSets::class, 'Google_Service_DataLabeling_Resource_ProjectsAnnotationSpecSets');
|
---|