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