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