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; 19 20use Google\Client; 21 22/** 23 * Service definition for Speech (v1). 24 * 25 * <p> 26 * Converts audio to text by applying powerful neural network models.</p> 27 * 28 * <p> 29 * For more information about this service, see the API 30 * <a href="https://cloud.google.com/speech-to-text/docs/quickstart-protocol" target="_blank">Documentation</a> 31 * </p> 32 * 33 * @author Google, Inc. 34 */ 35class Speech extends \Google\Service 36{ 37 /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */ 38 const CLOUD_PLATFORM = 39 "https://www.googleapis.com/auth/cloud-platform"; 40 41 public $operations; 42 public $projects_locations_customClasses; 43 public $projects_locations_phraseSets; 44 public $speech; 45 46 /** 47 * Constructs the internal representation of the Speech service. 48 * 49 * @param Client|array $clientOrConfig The client used to deliver requests, or a 50 * config array to pass to a new Client instance. 51 * @param string $rootUrl The root URL used for requests to the service. 52 */ 53 public function __construct($clientOrConfig = [], $rootUrl = null) 54 { 55 parent::__construct($clientOrConfig); 56 $this->rootUrl = $rootUrl ?: 'https://speech.googleapis.com/'; 57 $this->servicePath = ''; 58 $this->batchPath = 'batch'; 59 $this->version = 'v1'; 60 $this->serviceName = 'speech'; 61 62 $this->operations = new Speech\Resource\Operations( 63 $this, 64 $this->serviceName, 65 'operations', 66 [ 67 'methods' => [ 68 'get' => [ 69 'path' => 'v1/operations/{+name}', 70 'httpMethod' => 'GET', 71 'parameters' => [ 72 'name' => [ 73 'location' => 'path', 74 'type' => 'string', 75 'required' => true, 76 ], 77 ], 78 ],'list' => [ 79 'path' => 'v1/operations', 80 'httpMethod' => 'GET', 81 'parameters' => [ 82 'filter' => [ 83 'location' => 'query', 84 'type' => 'string', 85 ], 86 'name' => [ 87 'location' => 'query', 88 'type' => 'string', 89 ], 90 'pageSize' => [ 91 'location' => 'query', 92 'type' => 'integer', 93 ], 94 'pageToken' => [ 95 'location' => 'query', 96 'type' => 'string', 97 ], 98 ], 99 ], 100 ] 101 ] 102 ); 103 $this->projects_locations_customClasses = new Speech\Resource\ProjectsLocationsCustomClasses( 104 $this, 105 $this->serviceName, 106 'customClasses', 107 [ 108 'methods' => [ 109 'create' => [ 110 'path' => 'v1/{+parent}/customClasses', 111 'httpMethod' => 'POST', 112 'parameters' => [ 113 'parent' => [ 114 'location' => 'path', 115 'type' => 'string', 116 'required' => true, 117 ], 118 ], 119 ],'delete' => [ 120 'path' => 'v1/{+name}', 121 'httpMethod' => 'DELETE', 122 'parameters' => [ 123 'name' => [ 124 'location' => 'path', 125 'type' => 'string', 126 'required' => true, 127 ], 128 ], 129 ],'get' => [ 130 'path' => 'v1/{+name}', 131 'httpMethod' => 'GET', 132 'parameters' => [ 133 'name' => [ 134 'location' => 'path', 135 'type' => 'string', 136 'required' => true, 137 ], 138 ], 139 ],'list' => [ 140 'path' => 'v1/{+parent}/customClasses', 141 'httpMethod' => 'GET', 142 'parameters' => [ 143 'parent' => [ 144 'location' => 'path', 145 'type' => 'string', 146 'required' => true, 147 ], 148 'pageSize' => [ 149 'location' => 'query', 150 'type' => 'integer', 151 ], 152 'pageToken' => [ 153 'location' => 'query', 154 'type' => 'string', 155 ], 156 ], 157 ],'patch' => [ 158 'path' => 'v1/{+name}', 159 'httpMethod' => 'PATCH', 160 'parameters' => [ 161 'name' => [ 162 'location' => 'path', 163 'type' => 'string', 164 'required' => true, 165 ], 166 'updateMask' => [ 167 'location' => 'query', 168 'type' => 'string', 169 ], 170 ], 171 ], 172 ] 173 ] 174 ); 175 $this->projects_locations_phraseSets = new Speech\Resource\ProjectsLocationsPhraseSets( 176 $this, 177 $this->serviceName, 178 'phraseSets', 179 [ 180 'methods' => [ 181 'create' => [ 182 'path' => 'v1/{+parent}/phraseSets', 183 'httpMethod' => 'POST', 184 'parameters' => [ 185 'parent' => [ 186 'location' => 'path', 187 'type' => 'string', 188 'required' => true, 189 ], 190 ], 191 ],'delete' => [ 192 'path' => 'v1/{+name}', 193 'httpMethod' => 'DELETE', 194 'parameters' => [ 195 'name' => [ 196 'location' => 'path', 197 'type' => 'string', 198 'required' => true, 199 ], 200 ], 201 ],'get' => [ 202 'path' => 'v1/{+name}', 203 'httpMethod' => 'GET', 204 'parameters' => [ 205 'name' => [ 206 'location' => 'path', 207 'type' => 'string', 208 'required' => true, 209 ], 210 ], 211 ],'list' => [ 212 'path' => 'v1/{+parent}/phraseSets', 213 'httpMethod' => 'GET', 214 'parameters' => [ 215 'parent' => [ 216 'location' => 'path', 217 'type' => 'string', 218 'required' => true, 219 ], 220 'pageSize' => [ 221 'location' => 'query', 222 'type' => 'integer', 223 ], 224 'pageToken' => [ 225 'location' => 'query', 226 'type' => 'string', 227 ], 228 ], 229 ],'patch' => [ 230 'path' => 'v1/{+name}', 231 'httpMethod' => 'PATCH', 232 'parameters' => [ 233 'name' => [ 234 'location' => 'path', 235 'type' => 'string', 236 'required' => true, 237 ], 238 'updateMask' => [ 239 'location' => 'query', 240 'type' => 'string', 241 ], 242 ], 243 ], 244 ] 245 ] 246 ); 247 $this->speech = new Speech\Resource\Speech( 248 $this, 249 $this->serviceName, 250 'speech', 251 [ 252 'methods' => [ 253 'longrunningrecognize' => [ 254 'path' => 'v1/speech:longrunningrecognize', 255 'httpMethod' => 'POST', 256 'parameters' => [], 257 ],'recognize' => [ 258 'path' => 'v1/speech:recognize', 259 'httpMethod' => 'POST', 260 'parameters' => [], 261 ], 262 ] 263 ] 264 ); 265 } 266} 267 268// Adding a class alias for backwards compatibility with the previous class name. 269class_alias(Speech::class, 'Google_Service_Speech'); 270