# 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

    # 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(
            "cloudasset.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="cloudasset.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



# 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


    # 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(
            "cloudasset.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="cloudasset.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



@pytest.mark.parametrize("request_type", [asset_service.AnalyzeIamPolicyRequest, dict,])