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\Speech\Resource;
19
20use Google\Service\Speech\CreateCustomClassRequest;
21use Google\Service\Speech\CustomClass;
22use Google\Service\Speech\ListCustomClassesResponse;
23use Google\Service\Speech\SpeechEmpty;
24
25/**
26 * The "customClasses" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $speechService = new Google\Service\Speech(...);
30 *   $customClasses = $speechService->customClasses;
31 *  </code>
32 */
33class ProjectsLocationsCustomClasses extends \Google\Service\Resource
34{
35  /**
36   * Create a custom class. (customClasses.create)
37   *
38   * @param string $parent Required. The parent resource where this custom class
39   * will be created. Format:
40   * `projects/{project}/locations/{location}/customClasses` Speech-to-Text
41   * supports three locations: `global`, `us` (US North America), and `eu`
42   * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the
43   * `global` location. To specify a region, use a [regional endpoint](/speech-to-
44   * text/docs/endpoints) with matching `us` or `eu` location value.
45   * @param CreateCustomClassRequest $postBody
46   * @param array $optParams Optional parameters.
47   * @return CustomClass
48   */
49  public function create($parent, CreateCustomClassRequest $postBody, $optParams = [])
50  {
51    $params = ['parent' => $parent, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('create', [$params], CustomClass::class);
54  }
55  /**
56   * Delete a custom class. (customClasses.delete)
57   *
58   * @param string $name Required. The name of the custom class to delete. Format:
59   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
60   * Speech-to-Text supports three locations: `global`, `us` (US North America),
61   * and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint,
62   * use the `global` location. To specify a region, use a [regional endpoint
63   * ](/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
64   * @param array $optParams Optional parameters.
65   * @return SpeechEmpty
66   */
67  public function delete($name, $optParams = [])
68  {
69    $params = ['name' => $name];
70    $params = array_merge($params, $optParams);
71    return $this->call('delete', [$params], SpeechEmpty::class);
72  }
73  /**
74   * Get a custom class. (customClasses.get)
75   *
76   * @param string $name Required. The name of the custom class to retrieve.
77   * Format:
78   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
79   * @param array $optParams Optional parameters.
80   * @return CustomClass
81   */
82  public function get($name, $optParams = [])
83  {
84    $params = ['name' => $name];
85    $params = array_merge($params, $optParams);
86    return $this->call('get', [$params], CustomClass::class);
87  }
88  /**
89   * List custom classes. (customClasses.listProjectsLocationsCustomClasses)
90   *
91   * @param string $parent Required. The parent, which owns this collection of
92   * custom classes. Format:
93   * `projects/{project}/locations/{location}/customClasses` Speech-to-Text
94   * supports three locations: `global`, `us` (US North America), and `eu`
95   * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the
96   * `global` location. To specify a region, use a [regional endpoint](/speech-to-
97   * text/docs/endpoints) with matching `us` or `eu` location value.
98   * @param array $optParams Optional parameters.
99   *
100   * @opt_param int pageSize The maximum number of custom classes to return. The
101   * service may return fewer than this value. If unspecified, at most 50 custom
102   * classes will be returned. The maximum value is 1000; values above 1000 will
103   * be coerced to 1000.
104   * @opt_param string pageToken A page token, received from a previous
105   * `ListCustomClass` call. Provide this to retrieve the subsequent page. When
106   * paginating, all other parameters provided to `ListCustomClass` must match the
107   * call that provided the page token.
108   * @return ListCustomClassesResponse
109   */
110  public function listProjectsLocationsCustomClasses($parent, $optParams = [])
111  {
112    $params = ['parent' => $parent];
113    $params = array_merge($params, $optParams);
114    return $this->call('list', [$params], ListCustomClassesResponse::class);
115  }
116  /**
117   * Update a custom class. (customClasses.patch)
118   *
119   * @param string $name The resource name of the custom class.
120   * @param CustomClass $postBody
121   * @param array $optParams Optional parameters.
122   *
123   * @opt_param string updateMask The list of fields to be updated.
124   * @return CustomClass
125   */
126  public function patch($name, CustomClass $postBody, $optParams = [])
127  {
128    $params = ['name' => $name, 'postBody' => $postBody];
129    $params = array_merge($params, $optParams);
130    return $this->call('patch', [$params], CustomClass::class);
131  }
132}
133
134// Adding a class alias for backwards compatibility with the previous class name.
135class_alias(ProjectsLocationsCustomClasses::class, 'Google_Service_Speech_Resource_ProjectsLocationsCustomClasses');
136