# Path: google/cloud/asset_v1p4beta1/types/asset_service.py
# class IamPolicyAnalysisQuery(proto.Message):
#     class ResourceSelector(proto.Message):
#     class IdentitySelector(proto.Message):
#     class AccessSelector(proto.Message):
# class AnalyzeIamPolicyRequest(proto.Message):
#     class Options(proto.Message):
# class AnalyzeIamPolicyResponse(proto.Message):
#     class IamPolicyAnalysis(proto.Message):
# class IamPolicyAnalysisOutputConfig(proto.Message):
#     class GcsDestination(proto.Message):
# class ExportIamPolicyAnalysisRequest(proto.Message):
#     class Options(proto.Message):
# class ExportIamPolicyAnalysisResponse(proto.Message):
# 
# Path: google/cloud/asset_v1p4beta1/types/assets.py
# class IamPolicyAnalysisResult(proto.Message):
#     class AnalysisState(proto.Message):
#     class Resource(proto.Message):
#     class Access(proto.Message):
#     class Edge(proto.Message):
#     class Identity(proto.Message):
#     class AccessControlList(proto.Message):
#     class IdentityList(proto.Message):


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 future
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 operation
from google.api_core import operation_async  # type: ignore
from google.api_core import operations_v1
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.asset_v1p4beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p4beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p4beta1.services.asset_service import transports
from google.cloud.asset_v1p4beta1.types import asset_service
from google.cloud.asset_v1p4beta1.types import assets
from google.longrunning import operations_pb2
from google.oauth2 import service_account
from google.protobuf import duration_pb2  # type: ignore
    modify_default_endpoint(AssetServiceAsyncClient),
)
def test_asset_service_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(AssetServiceClient, "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(AssetServiceClient, "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(transport=transport_name, client_options=options)
        patched.assert_called_once_with(
            credentials=None,
            credentials_file=None,
            host="squid.clam.whelk",
            scopes=None,
            client_cert_source_for_mtls=None,
            quota_project_id=None,
            client_info=transports.base.DEFAULT_CLIENT_INFO,
            always_use_jwt_access=True,

# Path: google/cloud/asset_v1p4beta1/types/asset_service.py
# class IamPolicyAnalysisQuery(proto.Message):
#     class ResourceSelector(proto.Message):
#     class IdentitySelector(proto.Message):
#     class AccessSelector(proto.Message):
# class AnalyzeIamPolicyRequest(proto.Message):
#     class Options(proto.Message):
# class AnalyzeIamPolicyResponse(proto.Message):
#     class IamPolicyAnalysis(proto.Message):
# class IamPolicyAnalysisOutputConfig(proto.Message):
#     class GcsDestination(proto.Message):
# class ExportIamPolicyAnalysisRequest(proto.Message):
#     class Options(proto.Message):
# class ExportIamPolicyAnalysisResponse(proto.Message):
# 
# Path: google/cloud/asset_v1p4beta1/types/assets.py
# class IamPolicyAnalysisResult(proto.Message):
#     class AnalysisState(proto.Message):
#     class Resource(proto.Message):
#     class Access(proto.Message):
#     class Edge(proto.Message):
#     class Identity(proto.Message):
#     class AccessControlList(proto.Message):
#     class IdentityList(proto.Message):


# Path: tests/unit/gapic/asset_v1p4beta1/test_asset_service.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 future
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 operation
from google.api_core import operation_async  # type: ignore
from google.api_core import operations_v1
from google.api_core import path_template
from google.auth import credentials as ga_credentials
from google.auth.exceptions import MutualTLSChannelError
from google.cloud.asset_v1p4beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p4beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p4beta1.services.asset_service import transports
from google.cloud.asset_v1p4beta1.types import asset_service
from google.cloud.asset_v1p4beta1.types import assets
from google.longrunning import operations_pb2
from google.oauth2 import service_account
from google.protobuf import duration_pb2  # type: ignore

    modify_default_endpoint(AssetServiceAsyncClient),
)
def test_asset_service_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(AssetServiceClient, "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(AssetServiceClient, "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(transport=transport_name, client_options=options)
        patched.assert_called_once_with(
            credentials=None,
            credentials_file=None,
            host="squid.clam.whelk",
            scopes=None,
            client_cert_source_for_mtls=None,
            quota_project_id=None,
            client_info=transports.base.DEFAULT_CLIENT_INFO,
            always_use_jwt_access=True,

        )