# Path: google/api_core/client_options.py
# class ClientOptions(object):
#     def __init__(
#         self,
#         api_endpoint=None,
#         client_cert_source=None,
#         client_encrypted_cert_source=None,
#         quota_project_id=None,
#         credentials_file=None,
#         scopes=None,
#         api_key=None,
#     ):
#     def __repr__(self):
# def from_dict(options):
# 
# Path: google/api_core/exceptions.py
# _HTTP_CODE_TO_EXCEPTION: Dict[int, Exception] = {}
# _GRPC_CODE_TO_EXCEPTION: Dict[int, Exception] = {}
# _INT_TO_GRPC_CODE = {}
# class GoogleAPIError(Exception):
# class DuplicateCredentialArgs(GoogleAPIError):
# class RetryError(GoogleAPIError):
# class _GoogleAPICallErrorMeta(type):
# class GoogleAPICallError(GoogleAPIError, metaclass=_GoogleAPICallErrorMeta):
# class Redirection(GoogleAPICallError):
# class MovedPermanently(Redirection):
# class NotModified(Redirection):
# class TemporaryRedirect(Redirection):
# class ResumeIncomplete(Redirection):
# class ClientError(GoogleAPICallError):
# class BadRequest(ClientError):
# class InvalidArgument(BadRequest):
# class FailedPrecondition(BadRequest):
# class OutOfRange(BadRequest):
# class Unauthorized(ClientError):
# class Unauthenticated(Unauthorized):
# class Forbidden(ClientError):
# class PermissionDenied(Forbidden):
# class NotFound(ClientError):
# class MethodNotAllowed(ClientError):
# class Conflict(ClientError):
# class AlreadyExists(Conflict):
# class Aborted(Conflict):
# class LengthRequired(ClientError):
# class PreconditionFailed(ClientError):
# class RequestRangeNotSatisfiable(ClientError):
# class TooManyRequests(ClientError):
# class ResourceExhausted(TooManyRequests):
# class Cancelled(ClientError):
# class ServerError(GoogleAPICallError):
# class InternalServerError(ServerError):
# class Unknown(ServerError):
# class DataLoss(ServerError):
# class MethodNotImplemented(ServerError):
# class BadGateway(ServerError):
# class ServiceUnavailable(ServerError):
# class GatewayTimeout(ServerError):
# class DeadlineExceeded(GatewayTimeout):
#     def __init__(self, message, cause):
#     def cause(self):
#     def __str__(self):
#     def __new__(mcs, name, bases, class_dict):
#     def __init__(self, message, errors=(), details=(), response=None, error_info=None):
#     def __str__(self):
#     def reason(self):
#     def domain(self):
#     def metadata(self):
#     def errors(self):
#     def details(self):
#     def response(self):
# def exception_class_for_http_status(status_code):
# def from_http_status(status_code, message, **kwargs):
# def from_http_response(response):
# def exception_class_for_grpc_status(status_code):
# def from_grpc_status(status_code, message, **kwargs):
# def _is_informative_grpc_error(rpc_exc):
# def _parse_grpc_error_details(rpc_exc):
# def from_grpc_error(rpc_exc):


import os
import mock
import pytest
    import grpc  # noqa: F401
import google.auth
from requests import Response  # noqa I201
from requests.sessions import Session
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.operations_v1 import AbstractOperationsClient
from google.api_core.operations_v1 import pagers
from google.api_core.operations_v1 import transports
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.longrunning import operations_pb2
from google.oauth2 import service_account
from google.protobuf import json_format  # type: ignore
from google.rpc import status_pb2  # type: ignore
    assert transport == transports.OperationsRestTransport


@pytest.mark.parametrize(
    "client_class,transport_class,transport_name",
    [(AbstractOperationsClient, transports.OperationsRestTransport, "rest")],
)
@mock.patch.object(
    AbstractOperationsClient,
    "DEFAULT_ENDPOINT",
    modify_default_endpoint(AbstractOperationsClient),
)
def test_operations_client_client_options(
    client_class, transport_class, transport_name
):
    # Check that if channel is provided we won't create a new one.
    with mock.patch.object(AbstractOperationsClient, "get_transport_class") as gtc:
        transport = transport_class(credentials=ga_credentials.AnonymousCredentials())
        client = client_class(transport=transport)
        gtc.assert_not_called()

    # Check that if channel is provided via str we will create a new one.
    with mock.patch.object(AbstractOperationsClient, "get_transport_class") as gtc:
        client = client_class(transport=transport_name)
        gtc.assert_called()

    # Check the case api_endpoint is provided.
    options = client_options.ClientOptions(api_endpoint="squid.clam.whelk")
    with mock.patch.object(transport_class, "__init__") as patched:
        patched.return_value = None

# Path: google/api_core/client_options.py
# class ClientOptions(object):
#     def __init__(
#         self,
#         api_endpoint=None,
#         client_cert_source=None,
#         client_encrypted_cert_source=None,
#         quota_project_id=None,
#         credentials_file=None,
#         scopes=None,
#         api_key=None,
#     ):
#     def __repr__(self):
# def from_dict(options):
# 
# Path: google/api_core/exceptions.py
# _HTTP_CODE_TO_EXCEPTION: Dict[int, Exception] = {}
# _GRPC_CODE_TO_EXCEPTION: Dict[int, Exception] = {}
# _INT_TO_GRPC_CODE = {}
# class GoogleAPIError(Exception):
# class DuplicateCredentialArgs(GoogleAPIError):
# class RetryError(GoogleAPIError):
# class _GoogleAPICallErrorMeta(type):
# class GoogleAPICallError(GoogleAPIError, metaclass=_GoogleAPICallErrorMeta):
# class Redirection(GoogleAPICallError):
# class MovedPermanently(Redirection):
# class NotModified(Redirection):
# class TemporaryRedirect(Redirection):
# class ResumeIncomplete(Redirection):
# class ClientError(GoogleAPICallError):
# class BadRequest(ClientError):
# class InvalidArgument(BadRequest):
# class FailedPrecondition(BadRequest):
# class OutOfRange(BadRequest):
# class Unauthorized(ClientError):
# class Unauthenticated(Unauthorized):
# class Forbidden(ClientError):
# class PermissionDenied(Forbidden):
# class NotFound(ClientError):
# class MethodNotAllowed(ClientError):
# class Conflict(ClientError):
# class AlreadyExists(Conflict):
# class Aborted(Conflict):
# class LengthRequired(ClientError):
# class PreconditionFailed(ClientError):
# class RequestRangeNotSatisfiable(ClientError):
# class TooManyRequests(ClientError):
# class ResourceExhausted(TooManyRequests):
# class Cancelled(ClientError):
# class ServerError(GoogleAPICallError):
# class InternalServerError(ServerError):
# class Unknown(ServerError):
# class DataLoss(ServerError):
# class MethodNotImplemented(ServerError):
# class BadGateway(ServerError):
# class ServiceUnavailable(ServerError):
# class GatewayTimeout(ServerError):
# class DeadlineExceeded(GatewayTimeout):
#     def __init__(self, message, cause):
#     def cause(self):
#     def __str__(self):
#     def __new__(mcs, name, bases, class_dict):
#     def __init__(self, message, errors=(), details=(), response=None, error_info=None):
#     def __str__(self):
#     def reason(self):
#     def domain(self):
#     def metadata(self):
#     def errors(self):
#     def details(self):
#     def response(self):
# def exception_class_for_http_status(status_code):
# def from_http_status(status_code, message, **kwargs):
# def from_http_response(response):
# def exception_class_for_grpc_status(status_code):
# def from_grpc_status(status_code, message, **kwargs):
# def _is_informative_grpc_error(rpc_exc):
# def _parse_grpc_error_details(rpc_exc):
# def from_grpc_error(rpc_exc):


# Path: tests/unit/operations_v1/test_operations_rest_client.py
import os
import mock
import pytest
    import grpc  # noqa: F401
import google.auth
from requests import Response  # noqa I201
from requests.sessions import Session
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.operations_v1 import AbstractOperationsClient
from google.api_core.operations_v1 import pagers
from google.api_core.operations_v1 import transports
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.longrunning import operations_pb2
from google.oauth2 import service_account
from google.protobuf import json_format  # type: ignore
from google.rpc import status_pb2  # type: ignore

    assert transport == transports.OperationsRestTransport


@pytest.mark.parametrize(
    "client_class,transport_class,transport_name",
    [(AbstractOperationsClient, transports.OperationsRestTransport, "rest")],
)
@mock.patch.object(
    AbstractOperationsClient,
    "DEFAULT_ENDPOINT",
    modify_default_endpoint(AbstractOperationsClient),
)
def test_operations_client_client_options(
    client_class, transport_class, transport_name
):
    # Check that if channel is provided we won't create a new one.
    with mock.patch.object(AbstractOperationsClient, "get_transport_class") as gtc:
        transport = transport_class(credentials=ga_credentials.AnonymousCredentials())
        client = client_class(transport=transport)
        gtc.assert_not_called()

    # Check that if channel is provided via str we will create a new one.
    with mock.patch.object(AbstractOperationsClient, "get_transport_class") as gtc:
        client = client_class(transport=transport_name)
        gtc.assert_called()

    # Check the case api_endpoint is provided.
    options = client_options.ClientOptions(api_endpoint="squid.clam.whelk")
    with mock.patch.object(transport_class, "__init__") as patched:
        patched.return_value = None

        client = client_class(client_options=options)