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\GoogleCloudDatalabelingV1beta1Example;
21use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1ListExamplesResponse;
22
23/**
24 * The "examples" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $datalabelingService = new Google\Service\DataLabeling(...);
28 *   $examples = $datalabelingService->examples;
29 *  </code>
30 */
31class ProjectsDatasetsAnnotatedDatasetsExamples extends \Google\Service\Resource
32{
33  /**
34   * Gets an example by resource name, including both data and annotation.
35   * (examples.get)
36   *
37   * @param string $name Required. Name of example, format:
38   * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
39   * {annotated_dataset_id}/examples/{example_id}
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string filter Optional. An expression for filtering Examples.
43   * Filter by annotation_spec.display_name is supported. Format
44   * "annotation_spec.display_name = {display_name}"
45   * @return GoogleCloudDatalabelingV1beta1Example
46   */
47  public function get($name, $optParams = [])
48  {
49    $params = ['name' => $name];
50    $params = array_merge($params, $optParams);
51    return $this->call('get', [$params], GoogleCloudDatalabelingV1beta1Example::class);
52  }
53  /**
54   * Lists examples in an annotated dataset. Pagination is supported.
55   * (examples.listProjectsDatasetsAnnotatedDatasetsExamples)
56   *
57   * @param string $parent Required. Example resource parent.
58   * @param array $optParams Optional parameters.
59   *
60   * @opt_param string filter Optional. An expression for filtering Examples. For
61   * annotated datasets that have annotation spec set, filter by
62   * annotation_spec.display_name is supported. Format
63   * "annotation_spec.display_name = {display_name}"
64   * @opt_param int pageSize Optional. Requested page size. Server may return
65   * fewer results than requested. Default value is 100.
66   * @opt_param string pageToken Optional. A token identifying a page of results
67   * for the server to return. Typically obtained by
68   * ListExamplesResponse.next_page_token of the previous
69   * [DataLabelingService.ListExamples] call. Return first page if empty.
70   * @return GoogleCloudDatalabelingV1beta1ListExamplesResponse
71   */
72  public function listProjectsDatasetsAnnotatedDatasetsExamples($parent, $optParams = [])
73  {
74    $params = ['parent' => $parent];
75    $params = array_merge($params, $optParams);
76    return $this->call('list', [$params], GoogleCloudDatalabelingV1beta1ListExamplesResponse::class);
77  }
78}
79
80// Adding a class alias for backwards compatibility with the previous class name.
81class_alias(ProjectsDatasetsAnnotatedDatasetsExamples::class, 'Google_Service_DataLabeling_Resource_ProjectsDatasetsAnnotatedDatasetsExamples');
82