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 Texttospeech (v1).
24 *
25 * <p>
26 * Synthesizes natural-sounding speech by applying powerful neural network
27 * models.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://cloud.google.com/text-to-speech/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class Texttospeech extends \Google\Service
37{
38  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
39  const CLOUD_PLATFORM =
40      "https://www.googleapis.com/auth/cloud-platform";
41
42  public $text;
43  public $voices;
44
45  /**
46   * Constructs the internal representation of the Texttospeech service.
47   *
48   * @param Client|array $clientOrConfig The client used to deliver requests, or a
49   *                                     config array to pass to a new Client instance.
50   * @param string $rootUrl The root URL used for requests to the service.
51   */
52  public function __construct($clientOrConfig = [], $rootUrl = null)
53  {
54    parent::__construct($clientOrConfig);
55    $this->rootUrl = $rootUrl ?: 'https://texttospeech.googleapis.com/';
56    $this->servicePath = '';
57    $this->batchPath = 'batch';
58    $this->version = 'v1';
59    $this->serviceName = 'texttospeech';
60
61    $this->text = new Texttospeech\Resource\Text(
62        $this,
63        $this->serviceName,
64        'text',
65        [
66          'methods' => [
67            'synthesize' => [
68              'path' => 'v1/text:synthesize',
69              'httpMethod' => 'POST',
70              'parameters' => [],
71            ],
72          ]
73        ]
74    );
75    $this->voices = new Texttospeech\Resource\Voices(
76        $this,
77        $this->serviceName,
78        'voices',
79        [
80          'methods' => [
81            'list' => [
82              'path' => 'v1/voices',
83              'httpMethod' => 'GET',
84              'parameters' => [
85                'languageCode' => [
86                  'location' => 'query',
87                  'type' => 'string',
88                ],
89              ],
90            ],
91          ]
92        ]
93    );
94  }
95}
96
97// Adding a class alias for backwards compatibility with the previous class name.
98class_alias(Texttospeech::class, 'Google_Service_Texttospeech');
99