1919from typing import Dict , Sequence , Tuple , Type , Union
2020import pkg_resources
2121
22- import google .api_core .client_options as ClientOptions # type: ignore
22+ from google .api_core .client_options import ClientOptions # type: ignore
2323from google .api_core import exceptions as core_exceptions # type: ignore
2424from google .api_core import gapic_v1 # type: ignore
2525from google .api_core import retry as retries # type: ignore
2626from google .auth import credentials as ga_credentials # type: ignore
2727from google .oauth2 import service_account # type: ignore
2828
29+ OptionalRetry = Union [retries .Retry , object ]
30+
2931from google .cloud .osconfig_v1 .services .os_config_service import pagers
3032from google .cloud .osconfig_v1 .types import patch_deployments
3133from google .cloud .osconfig_v1 .types import patch_jobs
@@ -176,17 +178,17 @@ def __init__(
176178
177179 async def execute_patch_job (
178180 self ,
179- request : patch_jobs .ExecutePatchJobRequest = None ,
181+ request : Union [ patch_jobs .ExecutePatchJobRequest , dict ] = None ,
180182 * ,
181- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
183+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
182184 timeout : float = None ,
183185 metadata : Sequence [Tuple [str , str ]] = (),
184186 ) -> patch_jobs .PatchJob :
185187 r"""Patch VM instances by creating and running a patch
186188 job.
187189
188190 Args:
189- request (:class:` google.cloud.osconfig_v1.types.ExecutePatchJobRequest` ):
191+ request (Union[ google.cloud.osconfig_v1.types.ExecutePatchJobRequest, dict] ):
190192 The request object. A request message to initiate
191193 patching across Compute Engine instances.
192194 retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -234,10 +236,10 @@ async def execute_patch_job(
234236
235237 async def get_patch_job (
236238 self ,
237- request : patch_jobs .GetPatchJobRequest = None ,
239+ request : Union [ patch_jobs .GetPatchJobRequest , dict ] = None ,
238240 * ,
239241 name : str = None ,
240- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
242+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
241243 timeout : float = None ,
242244 metadata : Sequence [Tuple [str , str ]] = (),
243245 ) -> patch_jobs .PatchJob :
@@ -246,7 +248,7 @@ async def get_patch_job(
246248 of completed jobs.
247249
248250 Args:
249- request (:class:` google.cloud.osconfig_v1.types.GetPatchJobRequest` ):
251+ request (Union[ google.cloud.osconfig_v1.types.GetPatchJobRequest, dict] ):
250252 The request object. Request to get an active or
251253 completed patch job.
252254 name (:class:`str`):
@@ -315,17 +317,17 @@ async def get_patch_job(
315317
316318 async def cancel_patch_job (
317319 self ,
318- request : patch_jobs .CancelPatchJobRequest = None ,
320+ request : Union [ patch_jobs .CancelPatchJobRequest , dict ] = None ,
319321 * ,
320- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
322+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
321323 timeout : float = None ,
322324 metadata : Sequence [Tuple [str , str ]] = (),
323325 ) -> patch_jobs .PatchJob :
324326 r"""Cancel a patch job. The patch job must be active.
325327 Canceled patch jobs cannot be restarted.
326328
327329 Args:
328- request (:class:` google.cloud.osconfig_v1.types.CancelPatchJobRequest` ):
330+ request (Union[ google.cloud.osconfig_v1.types.CancelPatchJobRequest, dict] ):
329331 The request object. Message for canceling a patch job.
330332 retry (google.api_core.retry.Retry): Designation of what errors, if any,
331333 should be retried.
@@ -372,17 +374,17 @@ async def cancel_patch_job(
372374
373375 async def list_patch_jobs (
374376 self ,
375- request : patch_jobs .ListPatchJobsRequest = None ,
377+ request : Union [ patch_jobs .ListPatchJobsRequest , dict ] = None ,
376378 * ,
377379 parent : str = None ,
378- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
380+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
379381 timeout : float = None ,
380382 metadata : Sequence [Tuple [str , str ]] = (),
381383 ) -> pagers .ListPatchJobsAsyncPager :
382384 r"""Get a list of patch jobs.
383385
384386 Args:
385- request (:class:` google.cloud.osconfig_v1.types.ListPatchJobsRequest` ):
387+ request (Union[ google.cloud.osconfig_v1.types.ListPatchJobsRequest, dict] ):
386388 The request object. A request message for listing patch
387389 jobs.
388390 parent (:class:`str`):
@@ -450,17 +452,17 @@ async def list_patch_jobs(
450452
451453 async def list_patch_job_instance_details (
452454 self ,
453- request : patch_jobs .ListPatchJobInstanceDetailsRequest = None ,
455+ request : Union [ patch_jobs .ListPatchJobInstanceDetailsRequest , dict ] = None ,
454456 * ,
455457 parent : str = None ,
456- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
458+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
457459 timeout : float = None ,
458460 metadata : Sequence [Tuple [str , str ]] = (),
459461 ) -> pagers .ListPatchJobInstanceDetailsAsyncPager :
460462 r"""Get a list of instance details for a given patch job.
461463
462464 Args:
463- request (:class:` google.cloud.osconfig_v1.types.ListPatchJobInstanceDetailsRequest` ):
465+ request (Union[ google.cloud.osconfig_v1.types.ListPatchJobInstanceDetailsRequest, dict] ):
464466 The request object. Request to list details for all
465467 instances that are part of a patch job.
466468 parent (:class:`str`):
@@ -530,19 +532,19 @@ async def list_patch_job_instance_details(
530532
531533 async def create_patch_deployment (
532534 self ,
533- request : patch_deployments .CreatePatchDeploymentRequest = None ,
535+ request : Union [ patch_deployments .CreatePatchDeploymentRequest , dict ] = None ,
534536 * ,
535537 parent : str = None ,
536538 patch_deployment : patch_deployments .PatchDeployment = None ,
537539 patch_deployment_id : str = None ,
538- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
540+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
539541 timeout : float = None ,
540542 metadata : Sequence [Tuple [str , str ]] = (),
541543 ) -> patch_deployments .PatchDeployment :
542544 r"""Create an OS Config patch deployment.
543545
544546 Args:
545- request (:class:` google.cloud.osconfig_v1.types.CreatePatchDeploymentRequest` ):
547+ request (Union[ google.cloud.osconfig_v1.types.CreatePatchDeploymentRequest, dict] ):
546548 The request object. A request message for creating a
547549 patch deployment.
548550 parent (:class:`str`):
@@ -633,17 +635,17 @@ async def create_patch_deployment(
633635
634636 async def get_patch_deployment (
635637 self ,
636- request : patch_deployments .GetPatchDeploymentRequest = None ,
638+ request : Union [ patch_deployments .GetPatchDeploymentRequest , dict ] = None ,
637639 * ,
638640 name : str = None ,
639- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
641+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
640642 timeout : float = None ,
641643 metadata : Sequence [Tuple [str , str ]] = (),
642644 ) -> patch_deployments .PatchDeployment :
643645 r"""Get an OS Config patch deployment.
644646
645647 Args:
646- request (:class:` google.cloud.osconfig_v1.types.GetPatchDeploymentRequest` ):
648+ request (Union[ google.cloud.osconfig_v1.types.GetPatchDeploymentRequest, dict] ):
647649 The request object. A request message for retrieving a
648650 patch deployment.
649651 name (:class:`str`):
@@ -708,17 +710,17 @@ async def get_patch_deployment(
708710
709711 async def list_patch_deployments (
710712 self ,
711- request : patch_deployments .ListPatchDeploymentsRequest = None ,
713+ request : Union [ patch_deployments .ListPatchDeploymentsRequest , dict ] = None ,
712714 * ,
713715 parent : str = None ,
714- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
716+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
715717 timeout : float = None ,
716718 metadata : Sequence [Tuple [str , str ]] = (),
717719 ) -> pagers .ListPatchDeploymentsAsyncPager :
718720 r"""Get a page of OS Config patch deployments.
719721
720722 Args:
721- request (:class:` google.cloud.osconfig_v1.types.ListPatchDeploymentsRequest` ):
723+ request (Union[ google.cloud.osconfig_v1.types.ListPatchDeploymentsRequest, dict] ):
722724 The request object. A request message for listing patch
723725 deployments.
724726 parent (:class:`str`):
@@ -788,17 +790,17 @@ async def list_patch_deployments(
788790
789791 async def delete_patch_deployment (
790792 self ,
791- request : patch_deployments .DeletePatchDeploymentRequest = None ,
793+ request : Union [ patch_deployments .DeletePatchDeploymentRequest , dict ] = None ,
792794 * ,
793795 name : str = None ,
794- retry : retries . Retry = gapic_v1 .method .DEFAULT ,
796+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
795797 timeout : float = None ,
796798 metadata : Sequence [Tuple [str , str ]] = (),
797799 ) -> None :
798800 r"""Delete an OS Config patch deployment.
799801
800802 Args:
801- request (:class:` google.cloud.osconfig_v1.types.DeletePatchDeploymentRequest` ):
803+ request (Union[ google.cloud.osconfig_v1.types.DeletePatchDeploymentRequest, dict] ):
802804 The request object. A request message for deleting a
803805 patch deployment.
804806 name (:class:`str`):
0 commit comments