# 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

        # Establish that the underlying gRPC stub method was called.
        assert len(call.mock_calls) == 1
        _, args, _ = call.mock_calls[0]
        assert args[0] == asset_service.ExportIamPolicyAnalysisRequest()

    # Establish that the response is the type that we expect.
    assert isinstance(response, future.Future)


def test_export_iam_policy_analysis_empty_call():
    # This test is a coverage failsafe to make sure that totally empty calls,
    # i.e. request == None and no flattened fields passed, work.
    client = AssetServiceClient(
        credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
    )

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.export_iam_policy_analysis), "__call__"
    ) as call:
        client.export_iam_policy_analysis()
        call.assert_called()
        _, args, _ = call.mock_calls[0]
        assert args[0] == asset_service.ExportIamPolicyAnalysisRequest()


@pytest.mark.asyncio
async def test_export_iam_policy_analysis_async(
    transport: str = "grpc_asyncio",

# 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


        # Establish that the underlying gRPC stub method was called.
        assert len(call.mock_calls) == 1
        _, args, _ = call.mock_calls[0]
        assert args[0] == asset_service.ExportIamPolicyAnalysisRequest()

    # Establish that the response is the type that we expect.
    assert isinstance(response, future.Future)


def test_export_iam_policy_analysis_empty_call():
    # This test is a coverage failsafe to make sure that totally empty calls,
    # i.e. request == None and no flattened fields passed, work.
    client = AssetServiceClient(
        credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
    )

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.export_iam_policy_analysis), "__call__"
    ) as call:
        client.export_iam_policy_analysis()
        call.assert_called()
        _, args, _ = call.mock_calls[0]
        assert args[0] == asset_service.ExportIamPolicyAnalysisRequest()


@pytest.mark.asyncio
async def test_export_iam_policy_analysis_async(
    transport: str = "grpc_asyncio",

    request_type=asset_service.ExportIamPolicyAnalysisRequest,