# 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

    # test that the credentials from file are saved and used as the credentials.
    with mock.patch.object(
        google.auth, "load_credentials_from_file", autospec=True
    ) as load_creds, mock.patch.object(
        google.auth, "default", autospec=True
    ) as adc, mock.patch.object(
        grpc_helpers, "create_channel"
    ) as create_channel:
        creds = ga_credentials.AnonymousCredentials()
        file_creds = ga_credentials.AnonymousCredentials()
        load_creds.return_value = (file_creds, None)
        adc.return_value = (creds, None)
        client = client_class(client_options=options, transport=transport_name)
        create_channel.assert_called_with(
            "cloudscheduler.googleapis.com:443",
            credentials=file_creds,
            credentials_file=None,
            quota_project_id=None,
            default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
            scopes=None,
            default_host="cloudscheduler.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



# 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


    # test that the credentials from file are saved and used as the credentials.
    with mock.patch.object(
        google.auth, "load_credentials_from_file", autospec=True
    ) as load_creds, mock.patch.object(
        google.auth, "default", autospec=True
    ) as adc, mock.patch.object(
        grpc_helpers, "create_channel"
    ) as create_channel:
        creds = ga_credentials.AnonymousCredentials()
        file_creds = ga_credentials.AnonymousCredentials()
        load_creds.return_value = (file_creds, None)
        adc.return_value = (creds, None)
        client = client_class(client_options=options, transport=transport_name)
        create_channel.assert_called_with(
            "cloudscheduler.googleapis.com:443",
            credentials=file_creds,
            credentials_file=None,
            quota_project_id=None,
            default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
            scopes=None,
            default_host="cloudscheduler.googleapis.com",
            ssl_credentials=None,
            options=[
                ("grpc.max_send_message_length", -1),
                ("grpc.max_receive_message_length", -1),
            ],
        )



@pytest.mark.parametrize("request_type", [cloudscheduler.ListJobsRequest, dict,])