@@ -68,6 +68,10 @@ class AdvisoryNotificationsServiceAsyncClient:
6868 parse_notification_path  =  staticmethod (
6969 AdvisoryNotificationsServiceClient .parse_notification_path 
7070 )
71+  settings_path  =  staticmethod (AdvisoryNotificationsServiceClient .settings_path )
72+  parse_settings_path  =  staticmethod (
73+  AdvisoryNotificationsServiceClient .parse_settings_path 
74+  )
7175 common_billing_account_path  =  staticmethod (
7276 AdvisoryNotificationsServiceClient .common_billing_account_path 
7377 )
@@ -468,6 +472,209 @@ async def sample_get_notification():
468472 # Done; return the response. 
469473 return  response 
470474
475+  async  def  get_settings (
476+  self ,
477+  request : Optional [Union [service .GetSettingsRequest , dict ]] =  None ,
478+  * ,
479+  name : Optional [str ] =  None ,
480+  retry : OptionalRetry  =  gapic_v1 .method .DEFAULT ,
481+  timeout : Union [float , object ] =  gapic_v1 .method .DEFAULT ,
482+  metadata : Sequence [Tuple [str , str ]] =  (),
483+  ) ->  service .Settings :
484+  r"""Get notification settings. 
485+ 
486+  .. code-block:: python 
487+ 
488+  # This snippet has been automatically generated and should be regarded as a 
489+  # code template only. 
490+  # It will require modifications to work: 
491+  # - It may require correct/in-range values for request initialization. 
492+  # - It may require specifying regional endpoints when creating the service 
493+  # client as shown in: 
494+  # https://googleapis.dev/python/google-api-core/latest/client_options.html 
495+  from google.cloud import advisorynotifications_v1 
496+ 
497+  async def sample_get_settings(): 
498+  # Create a client 
499+  client = advisorynotifications_v1.AdvisoryNotificationsServiceAsyncClient() 
500+ 
501+  # Initialize request argument(s) 
502+  request = advisorynotifications_v1.GetSettingsRequest( 
503+  name="name_value", 
504+  ) 
505+ 
506+  # Make the request 
507+  response = await client.get_settings(request=request) 
508+ 
509+  # Handle the response 
510+  print(response) 
511+ 
512+  Args: 
513+  request (Optional[Union[google.cloud.advisorynotifications_v1.types.GetSettingsRequest, dict]]): 
514+  The request object. Request of GetSettings endpoint. 
515+  name (:class:`str`): 
516+  Required. The resource name of the 
517+  settings to retrieve. Format: 
518+ 
519+  organizations/{organization}/locations/{location}/settings. 
520+ 
521+  This corresponds to the ``name`` field 
522+  on the ``request`` instance; if ``request`` is provided, this 
523+  should not be set. 
524+  retry (google.api_core.retry.Retry): Designation of what errors, if any, 
525+  should be retried. 
526+  timeout (float): The timeout for this request. 
527+  metadata (Sequence[Tuple[str, str]]): Strings which should be 
528+  sent along with the request as metadata. 
529+ 
530+  Returns: 
531+  google.cloud.advisorynotifications_v1.types.Settings: 
532+  Settings for Advisory Notifications. 
533+  """ 
534+  # Create or coerce a protobuf request object. 
535+  # Quick check: If we got a request object, we should *not* have 
536+  # gotten any keyword arguments that map to the request. 
537+  has_flattened_params  =  any ([name ])
538+  if  request  is  not   None  and  has_flattened_params :
539+  raise  ValueError (
540+  "If the `request` argument is set, then none of " 
541+  "the individual field arguments should be set." 
542+  )
543+ 
544+  request  =  service .GetSettingsRequest (request )
545+ 
546+  # If we have keyword arguments corresponding to fields on the 
547+  # request, apply these. 
548+  if  name  is  not   None :
549+  request .name  =  name 
550+ 
551+  # Wrap the RPC method; this adds retry and timeout information, 
552+  # and friendly error handling. 
553+  rpc  =  gapic_v1 .method_async .wrap_method (
554+  self ._client ._transport .get_settings ,
555+  default_timeout = None ,
556+  client_info = DEFAULT_CLIENT_INFO ,
557+  )
558+ 
559+  # Certain fields should be provided within the metadata header; 
560+  # add these here. 
561+  metadata  =  tuple (metadata ) +  (
562+  gapic_v1 .routing_header .to_grpc_metadata ((("name" , request .name ),)),
563+  )
564+ 
565+  # Send the request. 
566+  response  =  await  rpc (
567+  request ,
568+  retry = retry ,
569+  timeout = timeout ,
570+  metadata = metadata ,
571+  )
572+ 
573+  # Done; return the response. 
574+  return  response 
575+ 
576+  async  def  update_settings (
577+  self ,
578+  request : Optional [Union [service .UpdateSettingsRequest , dict ]] =  None ,
579+  * ,
580+  settings : Optional [service .Settings ] =  None ,
581+  retry : OptionalRetry  =  gapic_v1 .method .DEFAULT ,
582+  timeout : Union [float , object ] =  gapic_v1 .method .DEFAULT ,
583+  metadata : Sequence [Tuple [str , str ]] =  (),
584+  ) ->  service .Settings :
585+  r"""Update notification settings. 
586+ 
587+  .. code-block:: python 
588+ 
589+  # This snippet has been automatically generated and should be regarded as a 
590+  # code template only. 
591+  # It will require modifications to work: 
592+  # - It may require correct/in-range values for request initialization. 
593+  # - It may require specifying regional endpoints when creating the service 
594+  # client as shown in: 
595+  # https://googleapis.dev/python/google-api-core/latest/client_options.html 
596+  from google.cloud import advisorynotifications_v1 
597+ 
598+  async def sample_update_settings(): 
599+  # Create a client 
600+  client = advisorynotifications_v1.AdvisoryNotificationsServiceAsyncClient() 
601+ 
602+  # Initialize request argument(s) 
603+  settings = advisorynotifications_v1.Settings() 
604+  settings.etag = "etag_value" 
605+ 
606+  request = advisorynotifications_v1.UpdateSettingsRequest( 
607+  settings=settings, 
608+  ) 
609+ 
610+  # Make the request 
611+  response = await client.update_settings(request=request) 
612+ 
613+  # Handle the response 
614+  print(response) 
615+ 
616+  Args: 
617+  request (Optional[Union[google.cloud.advisorynotifications_v1.types.UpdateSettingsRequest, dict]]): 
618+  The request object. Request of UpdateSettings endpoint. 
619+  settings (:class:`google.cloud.advisorynotifications_v1.types.Settings`): 
620+  Required. New settings. 
621+  This corresponds to the ``settings`` field 
622+  on the ``request`` instance; if ``request`` is provided, this 
623+  should not be set. 
624+  retry (google.api_core.retry.Retry): Designation of what errors, if any, 
625+  should be retried. 
626+  timeout (float): The timeout for this request. 
627+  metadata (Sequence[Tuple[str, str]]): Strings which should be 
628+  sent along with the request as metadata. 
629+ 
630+  Returns: 
631+  google.cloud.advisorynotifications_v1.types.Settings: 
632+  Settings for Advisory Notifications. 
633+  """ 
634+  # Create or coerce a protobuf request object. 
635+  # Quick check: If we got a request object, we should *not* have 
636+  # gotten any keyword arguments that map to the request. 
637+  has_flattened_params  =  any ([settings ])
638+  if  request  is  not   None  and  has_flattened_params :
639+  raise  ValueError (
640+  "If the `request` argument is set, then none of " 
641+  "the individual field arguments should be set." 
642+  )
643+ 
644+  request  =  service .UpdateSettingsRequest (request )
645+ 
646+  # If we have keyword arguments corresponding to fields on the 
647+  # request, apply these. 
648+  if  settings  is  not   None :
649+  request .settings  =  settings 
650+ 
651+  # Wrap the RPC method; this adds retry and timeout information, 
652+  # and friendly error handling. 
653+  rpc  =  gapic_v1 .method_async .wrap_method (
654+  self ._client ._transport .update_settings ,
655+  default_timeout = None ,
656+  client_info = DEFAULT_CLIENT_INFO ,
657+  )
658+ 
659+  # Certain fields should be provided within the metadata header; 
660+  # add these here. 
661+  metadata  =  tuple (metadata ) +  (
662+  gapic_v1 .routing_header .to_grpc_metadata (
663+  (("settings.name" , request .settings .name ),)
664+  ),
665+  )
666+ 
667+  # Send the request. 
668+  response  =  await  rpc (
669+  request ,
670+  retry = retry ,
671+  timeout = timeout ,
672+  metadata = metadata ,
673+  )
674+ 
675+  # Done; return the response. 
676+  return  response 
677+ 
471678 async  def  __aenter__ (self ) ->  "AdvisoryNotificationsServiceAsyncClient" :
472679 return  self 
473680
0 commit comments