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\CreatePhraseSetRequest;
|
---|
21 | use Google\Service\Speech\ListPhraseSetResponse;
|
---|
22 | use Google\Service\Speech\PhraseSet;
|
---|
23 | use Google\Service\Speech\SpeechEmpty;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "phraseSets" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $speechService = new Google\Service\Speech(...);
|
---|
30 | * $phraseSets = $speechService->projects_locations_phraseSets;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsPhraseSets extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Create a set of phrase hints. Each item in the set can be a single word or a
|
---|
37 | * multi-word phrase. The items in the PhraseSet are favored by the recognition
|
---|
38 | * model when you send a call that includes the PhraseSet. (phraseSets.create)
|
---|
39 | *
|
---|
40 | * @param string $parent Required. The parent resource where this phrase set
|
---|
41 | * will be created. Format: `projects/{project}/locations/{location}` Speech-to-
|
---|
42 | * Text supports three locations: `global`, `us` (US North America), and `eu`
|
---|
43 | * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the
|
---|
44 | * `global` location. To specify a region, use a [regional
|
---|
45 | * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with
|
---|
46 | * matching `us` or `eu` location value.
|
---|
47 | * @param CreatePhraseSetRequest $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | * @return PhraseSet
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function create($parent, CreatePhraseSetRequest $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('create', [$params], PhraseSet::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Delete a phrase set. (phraseSets.delete)
|
---|
60 | *
|
---|
61 | * @param string $name Required. The name of the phrase set to delete. Format:
|
---|
62 | * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return SpeechEmpty
|
---|
65 | * @throws \Google\Service\Exception
|
---|
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 phrase set. (phraseSets.get)
|
---|
75 | *
|
---|
76 | * @param string $name Required. The name of the phrase set to retrieve. Format:
|
---|
77 | * `projects/{project}/locations/{location}/phraseSets/{phrase_set}` Speech-to-
|
---|
78 | * Text supports three locations: `global`, `us` (US North America), and `eu`
|
---|
79 | * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the
|
---|
80 | * `global` location. To specify a region, use a [regional
|
---|
81 | * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with
|
---|
82 | * matching `us` or `eu` location value.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return PhraseSet
|
---|
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], PhraseSet::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * List phrase sets. (phraseSets.listProjectsLocationsPhraseSets)
|
---|
95 | *
|
---|
96 | * @param string $parent Required. The parent, which owns this collection of
|
---|
97 | * phrase set. Format: `projects/{project}/locations/{location}` Speech-to-Text
|
---|
98 | * supports three locations: `global`, `us` (US North America), and `eu`
|
---|
99 | * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the
|
---|
100 | * `global` location. To specify a region, use a [regional
|
---|
101 | * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with
|
---|
102 | * matching `us` or `eu` location value.
|
---|
103 | * @param array $optParams Optional parameters.
|
---|
104 | *
|
---|
105 | * @opt_param int pageSize The maximum number of phrase sets to return. The
|
---|
106 | * service may return fewer than this value. If unspecified, at most 50 phrase
|
---|
107 | * sets will be returned. The maximum value is 1000; values above 1000 will be
|
---|
108 | * coerced to 1000.
|
---|
109 | * @opt_param string pageToken A page token, received from a previous
|
---|
110 | * `ListPhraseSet` call. Provide this to retrieve the subsequent page. When
|
---|
111 | * paginating, all other parameters provided to `ListPhraseSet` must match the
|
---|
112 | * call that provided the page token.
|
---|
113 | * @return ListPhraseSetResponse
|
---|
114 | * @throws \Google\Service\Exception
|
---|
115 | */
|
---|
116 | public function listProjectsLocationsPhraseSets($parent, $optParams = [])
|
---|
117 | {
|
---|
118 | $params = ['parent' => $parent];
|
---|
119 | $params = array_merge($params, $optParams);
|
---|
120 | return $this->call('list', [$params], ListPhraseSetResponse::class);
|
---|
121 | }
|
---|
122 | /**
|
---|
123 | * Update a phrase set. (phraseSets.patch)
|
---|
124 | *
|
---|
125 | * @param string $name The resource name of the phrase set.
|
---|
126 | * @param PhraseSet $postBody
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | *
|
---|
129 | * @opt_param string updateMask The list of fields to be updated.
|
---|
130 | * @return PhraseSet
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function patch($name, PhraseSet $postBody, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('patch', [$params], PhraseSet::class);
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
142 | class_alias(ProjectsLocationsPhraseSets::class, 'Google_Service_Speech_Resource_ProjectsLocationsPhraseSets');
|
---|