# Path: google/cloud/asset_v1p1beta1/services/asset_service/pagers.py
# class SearchAllResourcesPager:
# class SearchAllResourcesAsyncPager:
# class SearchAllIamPoliciesPager:
# class SearchAllIamPoliciesAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., asset_service.SearchAllResourcesResponse],
#         request: asset_service.SearchAllResourcesRequest,
#         response: asset_service.SearchAllResourcesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[asset_service.SearchAllResourcesResponse]:
#     def __iter__(self) -> Iterator[assets.StandardResourceMetadata]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[asset_service.SearchAllResourcesResponse]],
#         request: asset_service.SearchAllResourcesRequest,
#         response: asset_service.SearchAllResourcesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[asset_service.SearchAllResourcesResponse]:
#     def __aiter__(self) -> AsyncIterator[assets.StandardResourceMetadata]:
#         async def async_generator():
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., asset_service.SearchAllIamPoliciesResponse],
#         request: asset_service.SearchAllIamPoliciesRequest,
#         response: asset_service.SearchAllIamPoliciesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[asset_service.SearchAllIamPoliciesResponse]:
#     def __iter__(self) -> Iterator[assets.IamPolicySearchResult]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[asset_service.SearchAllIamPoliciesResponse]],
#         request: asset_service.SearchAllIamPoliciesRequest,
#         response: asset_service.SearchAllIamPoliciesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[asset_service.SearchAllIamPoliciesResponse]:
#     def __aiter__(self) -> AsyncIterator[assets.IamPolicySearchResult]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/asset_v1p1beta1/types/asset_service.py
# class SearchAllResourcesRequest(proto.Message):
# class SearchAllResourcesResponse(proto.Message):
# class SearchAllIamPoliciesRequest(proto.Message):
# class SearchAllIamPoliciesResponse(proto.Message):
#     def raw_page(self):
#     def raw_page(self):
# 
# Path: google/cloud/asset_v1p1beta1/types/assets.py
# class StandardResourceMetadata(proto.Message):
# class IamPolicySearchResult(proto.Message):
#     class Explanation(proto.Message):
# class Permissions(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 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.asset_v1p1beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p1beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p1beta1.services.asset_service import pagers
from google.cloud.asset_v1p1beta1.services.asset_service import transports
from google.cloud.asset_v1p1beta1.types import asset_service
from google.cloud.asset_v1p1beta1.types import assets
from google.oauth2 import service_account


@pytest.mark.parametrize(
    "request_type", [asset_service.SearchAllIamPoliciesRequest, dict,]
)
def test_search_all_iam_policies(request_type, transport: str = "grpc"):
    client = AssetServiceClient(
        credentials=ga_credentials.AnonymousCredentials(), transport=transport,
    )

    # Everything is optional in proto3 as far as the runtime is concerned,
    # and we are mocking out the actual API, so just send an empty request.
    request = request_type()

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.search_all_iam_policies), "__call__"
    ) as call:
        # Designate an appropriate return value for the call.
        call.return_value = asset_service.SearchAllIamPoliciesResponse(
            next_page_token="next_page_token_value",
        )
        response = client.search_all_iam_policies(request)

        # 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.SearchAllIamPoliciesRequest()

    # Establish that the response is the type that we expect.

# Path: google/cloud/asset_v1p1beta1/services/asset_service/pagers.py
# class SearchAllResourcesPager:
# class SearchAllResourcesAsyncPager:
# class SearchAllIamPoliciesPager:
# class SearchAllIamPoliciesAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., asset_service.SearchAllResourcesResponse],
#         request: asset_service.SearchAllResourcesRequest,
#         response: asset_service.SearchAllResourcesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[asset_service.SearchAllResourcesResponse]:
#     def __iter__(self) -> Iterator[assets.StandardResourceMetadata]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[asset_service.SearchAllResourcesResponse]],
#         request: asset_service.SearchAllResourcesRequest,
#         response: asset_service.SearchAllResourcesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[asset_service.SearchAllResourcesResponse]:
#     def __aiter__(self) -> AsyncIterator[assets.StandardResourceMetadata]:
#         async def async_generator():
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., asset_service.SearchAllIamPoliciesResponse],
#         request: asset_service.SearchAllIamPoliciesRequest,
#         response: asset_service.SearchAllIamPoliciesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[asset_service.SearchAllIamPoliciesResponse]:
#     def __iter__(self) -> Iterator[assets.IamPolicySearchResult]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[asset_service.SearchAllIamPoliciesResponse]],
#         request: asset_service.SearchAllIamPoliciesRequest,
#         response: asset_service.SearchAllIamPoliciesResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[asset_service.SearchAllIamPoliciesResponse]:
#     def __aiter__(self) -> AsyncIterator[assets.IamPolicySearchResult]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/asset_v1p1beta1/types/asset_service.py
# class SearchAllResourcesRequest(proto.Message):
# class SearchAllResourcesResponse(proto.Message):
# class SearchAllIamPoliciesRequest(proto.Message):
# class SearchAllIamPoliciesResponse(proto.Message):
#     def raw_page(self):
#     def raw_page(self):
# 
# Path: google/cloud/asset_v1p1beta1/types/assets.py
# class StandardResourceMetadata(proto.Message):
# class IamPolicySearchResult(proto.Message):
#     class Explanation(proto.Message):
# class Permissions(proto.Message):


# Path: tests/unit/gapic/asset_v1p1beta1/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 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.asset_v1p1beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p1beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p1beta1.services.asset_service import pagers
from google.cloud.asset_v1p1beta1.services.asset_service import transports
from google.cloud.asset_v1p1beta1.types import asset_service
from google.cloud.asset_v1p1beta1.types import assets
from google.oauth2 import service_account



@pytest.mark.parametrize(
    "request_type", [asset_service.SearchAllIamPoliciesRequest, dict,]
)
def test_search_all_iam_policies(request_type, transport: str = "grpc"):
    client = AssetServiceClient(
        credentials=ga_credentials.AnonymousCredentials(), transport=transport,
    )

    # Everything is optional in proto3 as far as the runtime is concerned,
    # and we are mocking out the actual API, so just send an empty request.
    request = request_type()

    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(
        type(client.transport.search_all_iam_policies), "__call__"
    ) as call:
        # Designate an appropriate return value for the call.
        call.return_value = asset_service.SearchAllIamPoliciesResponse(
            next_page_token="next_page_token_value",
        )
        response = client.search_all_iam_policies(request)

        # 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.SearchAllIamPoliciesRequest()

    # Establish that the response is the type that we expect.

    assert isinstance(response, pagers.SearchAllIamPoliciesPager)