# Path: google/cloud/texttospeech_v1/types/cloud_tts.py
# class SsmlVoiceGender(proto.Enum):
# class AudioEncoding(proto.Enum):
# class ListVoicesRequest(proto.Message):
# class ListVoicesResponse(proto.Message):
# class Voice(proto.Message):
# class SynthesizeSpeechRequest(proto.Message):
# class SynthesisInput(proto.Message):
# class VoiceSelectionParams(proto.Message):
# class AudioConfig(proto.Message):
# class SynthesizeSpeechResponse(proto.Message):
#     SSML_VOICE_GENDER_UNSPECIFIED = 0
#     MALE = 1
#     FEMALE = 2
#     NEUTRAL = 3
#     AUDIO_ENCODING_UNSPECIFIED = 0
#     LINEAR16 = 1
#     MP3 = 2
#     OGG_OPUS = 3
#     MULAW = 5
#     ALAW = 6


import os
import mock
import grpc
import math
import pytest
import google.auth
from grpc.experimental import aio
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.api_core import grpc_helpers_async
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.texttospeech_v1.services.text_to_speech import TextToSpeechAsyncClient
from google.cloud.texttospeech_v1.services.text_to_speech import TextToSpeechClient
from google.cloud.texttospeech_v1.services.text_to_speech import transports
from google.cloud.texttospeech_v1.types import cloud_tts
from google.oauth2 import service_account

    # test that the credentials from file are saved and used as the credentials.
    with mock.patch.object(
        google.auth, "load_credentials_from_file", autospec=True
    ) as load_creds, mock.patch.object(
        google.auth, "default", autospec=True
    ) as adc, mock.patch.object(
        grpc_helpers, "create_channel"
    ) as create_channel:
        creds = ga_credentials.AnonymousCredentials()
        file_creds = ga_credentials.AnonymousCredentials()
        load_creds.return_value = (file_creds, None)
        adc.return_value = (creds, None)
        client = client_class(client_options=options, transport=transport_name)
        create_channel.assert_called_with(
            "texttospeech.googleapis.com:443",
            credentials=file_creds,
            credentials_file=None,
            quota_project_id=None,
            default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
            scopes=None,
            default_host="texttospeech.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



# Path: google/cloud/texttospeech_v1/types/cloud_tts.py
# class SsmlVoiceGender(proto.Enum):
# class AudioEncoding(proto.Enum):
# class ListVoicesRequest(proto.Message):
# class ListVoicesResponse(proto.Message):
# class Voice(proto.Message):
# class SynthesizeSpeechRequest(proto.Message):
# class SynthesisInput(proto.Message):
# class VoiceSelectionParams(proto.Message):
# class AudioConfig(proto.Message):
# class SynthesizeSpeechResponse(proto.Message):
#     SSML_VOICE_GENDER_UNSPECIFIED = 0
#     MALE = 1
#     FEMALE = 2
#     NEUTRAL = 3
#     AUDIO_ENCODING_UNSPECIFIED = 0
#     LINEAR16 = 1
#     MP3 = 2
#     OGG_OPUS = 3
#     MULAW = 5
#     ALAW = 6


# Path: tests/unit/gapic/texttospeech_v1/test_text_to_speech.py
import os
import mock
import grpc
import math
import pytest
import google.auth
from grpc.experimental import aio
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.api_core import grpc_helpers_async
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.texttospeech_v1.services.text_to_speech import TextToSpeechAsyncClient
from google.cloud.texttospeech_v1.services.text_to_speech import TextToSpeechClient
from google.cloud.texttospeech_v1.services.text_to_speech import transports
from google.cloud.texttospeech_v1.types import cloud_tts
from google.oauth2 import service_account


    # test that the credentials from file are saved and used as the credentials.
    with mock.patch.object(
        google.auth, "load_credentials_from_file", autospec=True
    ) as load_creds, mock.patch.object(
        google.auth, "default", autospec=True
    ) as adc, mock.patch.object(
        grpc_helpers, "create_channel"
    ) as create_channel:
        creds = ga_credentials.AnonymousCredentials()
        file_creds = ga_credentials.AnonymousCredentials()
        load_creds.return_value = (file_creds, None)
        adc.return_value = (creds, None)
        client = client_class(client_options=options, transport=transport_name)
        create_channel.assert_called_with(
            "texttospeech.googleapis.com:443",
            credentials=file_creds,
            credentials_file=None,
            quota_project_id=None,
            default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
            scopes=None,
            default_host="texttospeech.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



@pytest.mark.parametrize("request_type", [cloud_tts.ListVoicesRequest, dict,])