# Path: google/cloud/scheduler_v1/services/cloud_scheduler/pagers.py
# class ListJobsPager:
# class ListJobsAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., cloudscheduler.ListJobsResponse],
#         request: cloudscheduler.ListJobsRequest,
#         response: cloudscheduler.ListJobsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[cloudscheduler.ListJobsResponse]:
#     def __iter__(self) -> Iterator[job.Job]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[cloudscheduler.ListJobsResponse]],
#         request: cloudscheduler.ListJobsRequest,
#         response: cloudscheduler.ListJobsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[cloudscheduler.ListJobsResponse]:
#     def __aiter__(self) -> AsyncIterator[job.Job]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/scheduler_v1/types/cloudscheduler.py
# class ListJobsRequest(proto.Message):
# class ListJobsResponse(proto.Message):
# class GetJobRequest(proto.Message):
# class CreateJobRequest(proto.Message):
# class UpdateJobRequest(proto.Message):
# class DeleteJobRequest(proto.Message):
# class PauseJobRequest(proto.Message):
# class ResumeJobRequest(proto.Message):
# class RunJobRequest(proto.Message):
#     def raw_page(self):
# 
# Path: google/cloud/scheduler_v1/types/job.py
# class Job(proto.Message):
#     class State(proto.Enum):
# class RetryConfig(proto.Message):
#         STATE_UNSPECIFIED = 0
#         ENABLED = 1
#         PAUSED = 2
#         DISABLED = 3
#         UPDATE_FAILED = 4
# 
# Path: google/cloud/scheduler_v1/types/job.py
# class Job(proto.Message):
#     class State(proto.Enum):
# class RetryConfig(proto.Message):
#         STATE_UNSPECIFIED = 0
#         ENABLED = 1
#         PAUSED = 2
#         DISABLED = 3
#         UPDATE_FAILED = 4
# 
# Path: google/cloud/scheduler_v1/types/target.py
# class HttpMethod(proto.Enum):
# class HttpTarget(proto.Message):
# class AppEngineHttpTarget(proto.Message):
# class PubsubTarget(proto.Message):
# class AppEngineRouting(proto.Message):
# class OAuthToken(proto.Message):
# class OidcToken(proto.Message):
#     HTTP_METHOD_UNSPECIFIED = 0
#     POST = 1
#     GET = 2
#     HEAD = 3
#     PUT = 4
#     DELETE = 5
#     PATCH = 6
#     OPTIONS = 7


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.scheduler_v1.services.cloud_scheduler import CloudSchedulerAsyncClient
from google.cloud.scheduler_v1.services.cloud_scheduler import CloudSchedulerClient
from google.cloud.scheduler_v1.services.cloud_scheduler import pagers
from google.cloud.scheduler_v1.services.cloud_scheduler import transports
from google.cloud.scheduler_v1.types import cloudscheduler
from google.cloud.scheduler_v1.types import job
from google.cloud.scheduler_v1.types import job as gcs_job
from google.cloud.scheduler_v1.types import target
from google.oauth2 import service_account
from google.protobuf import any_pb2  # type: ignore
from google.protobuf import duration_pb2  # type: ignore
from google.protobuf import field_mask_pb2  # type: ignore
from google.protobuf import timestamp_pb2  # type: ignore
from google.rpc import status_pb2  # type: ignore
        assert arg == mock_val


@pytest.mark.asyncio
async def test_get_job_flattened_error_async():
    client = CloudSchedulerAsyncClient(
        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.get_job(
            cloudscheduler.GetJobRequest(), name="name_value",
        )


@pytest.mark.parametrize("request_type", [cloudscheduler.CreateJobRequest, dict,])
def test_create_job(request_type, transport: str = "grpc"):
    client = CloudSchedulerClient(
        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.create_job), "__call__") as call:
        # Designate an appropriate return value for the call.

# Path: google/cloud/scheduler_v1/services/cloud_scheduler/pagers.py
# class ListJobsPager:
# class ListJobsAsyncPager:
#     def __init__(
#         self,
#         method: Callable[..., cloudscheduler.ListJobsResponse],
#         request: cloudscheduler.ListJobsRequest,
#         response: cloudscheduler.ListJobsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     def pages(self) -> Iterator[cloudscheduler.ListJobsResponse]:
#     def __iter__(self) -> Iterator[job.Job]:
#     def __repr__(self) -> str:
#     def __init__(
#         self,
#         method: Callable[..., Awaitable[cloudscheduler.ListJobsResponse]],
#         request: cloudscheduler.ListJobsRequest,
#         response: cloudscheduler.ListJobsResponse,
#         *,
#         metadata: Sequence[Tuple[str, str]] = ()
#     ):
#     def __getattr__(self, name: str) -> Any:
#     async def pages(self) -> AsyncIterator[cloudscheduler.ListJobsResponse]:
#     def __aiter__(self) -> AsyncIterator[job.Job]:
#         async def async_generator():
#     def __repr__(self) -> str:
# 
# Path: google/cloud/scheduler_v1/types/cloudscheduler.py
# class ListJobsRequest(proto.Message):
# class ListJobsResponse(proto.Message):
# class GetJobRequest(proto.Message):
# class CreateJobRequest(proto.Message):
# class UpdateJobRequest(proto.Message):
# class DeleteJobRequest(proto.Message):
# class PauseJobRequest(proto.Message):
# class ResumeJobRequest(proto.Message):
# class RunJobRequest(proto.Message):
#     def raw_page(self):
# 
# Path: google/cloud/scheduler_v1/types/job.py
# class Job(proto.Message):
#     class State(proto.Enum):
# class RetryConfig(proto.Message):
#         STATE_UNSPECIFIED = 0
#         ENABLED = 1
#         PAUSED = 2
#         DISABLED = 3
#         UPDATE_FAILED = 4
# 
# Path: google/cloud/scheduler_v1/types/job.py
# class Job(proto.Message):
#     class State(proto.Enum):
# class RetryConfig(proto.Message):
#         STATE_UNSPECIFIED = 0
#         ENABLED = 1
#         PAUSED = 2
#         DISABLED = 3
#         UPDATE_FAILED = 4
# 
# Path: google/cloud/scheduler_v1/types/target.py
# class HttpMethod(proto.Enum):
# class HttpTarget(proto.Message):
# class AppEngineHttpTarget(proto.Message):
# class PubsubTarget(proto.Message):
# class AppEngineRouting(proto.Message):
# class OAuthToken(proto.Message):
# class OidcToken(proto.Message):
#     HTTP_METHOD_UNSPECIFIED = 0
#     POST = 1
#     GET = 2
#     HEAD = 3
#     PUT = 4
#     DELETE = 5
#     PATCH = 6
#     OPTIONS = 7


# Path: tests/unit/gapic/scheduler_v1/test_cloud_scheduler.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.scheduler_v1.services.cloud_scheduler import CloudSchedulerAsyncClient
from google.cloud.scheduler_v1.services.cloud_scheduler import CloudSchedulerClient
from google.cloud.scheduler_v1.services.cloud_scheduler import pagers
from google.cloud.scheduler_v1.services.cloud_scheduler import transports
from google.cloud.scheduler_v1.types import cloudscheduler
from google.cloud.scheduler_v1.types import job
from google.cloud.scheduler_v1.types import job as gcs_job
from google.cloud.scheduler_v1.types import target
from google.oauth2 import service_account
from google.protobuf import any_pb2  # type: ignore
from google.protobuf import duration_pb2  # type: ignore
from google.protobuf import field_mask_pb2  # type: ignore
from google.protobuf import timestamp_pb2  # type: ignore
from google.rpc import status_pb2  # type: ignore

        assert arg == mock_val


@pytest.mark.asyncio
async def test_get_job_flattened_error_async():
    client = CloudSchedulerAsyncClient(
        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.get_job(
            cloudscheduler.GetJobRequest(), name="name_value",
        )


@pytest.mark.parametrize("request_type", [cloudscheduler.CreateJobRequest, dict,])
def test_create_job(request_type, transport: str = "grpc"):
    client = CloudSchedulerClient(
        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.create_job), "__call__") as call:
        # Designate an appropriate return value for the call.

        call.return_value = gcs_job.Job(