# Path: google/cloud/asset_v1p2beta1/types/asset_service.py
# class ContentType(proto.Enum):
# class CreateFeedRequest(proto.Message):
# class GetFeedRequest(proto.Message):
# class ListFeedsRequest(proto.Message):
# class ListFeedsResponse(proto.Message):
# class UpdateFeedRequest(proto.Message):
# class DeleteFeedRequest(proto.Message):
# class OutputConfig(proto.Message):
# class GcsDestination(proto.Message):
# class PubsubDestination(proto.Message):
# class FeedOutputConfig(proto.Message):
# class Feed(proto.Message):
#     CONTENT_TYPE_UNSPECIFIED = 0
#     RESOURCE = 1
#     IAM_POLICY = 2


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_v1p2beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p2beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p2beta1.services.asset_service import transports
from google.cloud.asset_v1p2beta1.types import asset_service
from google.oauth2 import service_account
from google.protobuf import field_mask_pb2  # type: ignore
    # Mock the actual call within the gRPC stub, and fake the request.
    with mock.patch.object(type(client.transport.get_feed), "__call__") as call:
        client.get_feed()
        call.assert_called()
        _, args, _ = call.mock_calls[0]
        assert args[0] == asset_service.GetFeedRequest()


@pytest.mark.asyncio
async def test_get_feed_async(
    transport: str = "grpc_asyncio", request_type=asset_service.GetFeedRequest
):
    client = AssetServiceAsyncClient(
        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.get_feed), "__call__") as call:
        # Designate an appropriate return value for the call.
        call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
            asset_service.Feed(
                name="name_value",
                asset_names=["asset_names_value"],
                asset_types=["asset_types_value"],
                content_type=asset_service.ContentType.RESOURCE,
            )

# Path: google/cloud/asset_v1p2beta1/types/asset_service.py
# class ContentType(proto.Enum):
# class CreateFeedRequest(proto.Message):
# class GetFeedRequest(proto.Message):
# class ListFeedsRequest(proto.Message):
# class ListFeedsResponse(proto.Message):
# class UpdateFeedRequest(proto.Message):
# class DeleteFeedRequest(proto.Message):
# class OutputConfig(proto.Message):
# class GcsDestination(proto.Message):
# class PubsubDestination(proto.Message):
# class FeedOutputConfig(proto.Message):
# class Feed(proto.Message):
#     CONTENT_TYPE_UNSPECIFIED = 0
#     RESOURCE = 1
#     IAM_POLICY = 2


# Path: tests/unit/gapic/asset_v1p2beta1/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_v1p2beta1.services.asset_service import AssetServiceAsyncClient
from google.cloud.asset_v1p2beta1.services.asset_service import AssetServiceClient
from google.cloud.asset_v1p2beta1.services.asset_service import transports
from google.cloud.asset_v1p2beta1.types import asset_service
from google.oauth2 import service_account
from google.protobuf import field_mask_pb2  # type: ignore

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


@pytest.mark.asyncio
async def test_get_feed_async(
    transport: str = "grpc_asyncio", request_type=asset_service.GetFeedRequest
):
    client = AssetServiceAsyncClient(
        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.get_feed), "__call__") as call:
        # Designate an appropriate return value for the call.
        call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
            asset_service.Feed(
                name="name_value",
                asset_names=["asset_names_value"],
                asset_types=["asset_types_value"],
                content_type=asset_service.ContentType.RESOURCE,
            )

        )