# 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
        arg = args[0].parent
        mock_val = "parent_value"
        assert arg == mock_val


@pytest.mark.asyncio
async def test_create_feed_flattened_error_async():
    client = AssetServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)

    # Attempting to call a method with both a request object and flattened
    # fields is an error.
    with pytest.raises(ValueError):
        await client.create_feed(
            asset_service.CreateFeedRequest(), parent="parent_value",
        )


@pytest.mark.parametrize("request_type", [asset_service.GetFeedRequest, dict,])
def test_get_feed(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.get_feed), "__call__") as call:
        # Designate an appropriate return value for the call.

# 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

        arg = args[0].parent
        mock_val = "parent_value"
        assert arg == mock_val


@pytest.mark.asyncio
async def test_create_feed_flattened_error_async():
    client = AssetServiceAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)

    # Attempting to call a method with both a request object and flattened
    # fields is an error.
    with pytest.raises(ValueError):
        await client.create_feed(
            asset_service.CreateFeedRequest(), parent="parent_value",
        )


@pytest.mark.parametrize("request_type", [asset_service.GetFeedRequest, dict,])
def test_get_feed(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.get_feed), "__call__") as call:
        # Designate an appropriate return value for the call.

        call.return_value = asset_service.Feed(