@@ -2608,6 +2608,223 @@ async def list_purchasable_offers(
26082608 # Done; return the response.
26092609 return response
26102610
2611+ async def register_subscriber (
2612+ self ,
2613+ request : service .RegisterSubscriberRequest = None ,
2614+ * ,
2615+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
2616+ timeout : float = None ,
2617+ metadata : Sequence [Tuple [str , str ]] = (),
2618+ ) -> service .RegisterSubscriberResponse :
2619+ r"""Registers a service account with subscriber privileges on the
2620+ Cloud Pub/Sub topic created for this Channel Services account.
2621+ Once you create a subscriber, you will get the events as per
2622+ [SubscriberEvent][google.cloud.channel.v1.SubscriberEvent]
2623+
2624+ Possible Error Codes:
2625+
2626+ - PERMISSION_DENIED: If the reseller account making the request
2627+ and the reseller account being provided are different, or if
2628+ the impersonated user is not a super admin.
2629+ - INVALID_ARGUMENT: Missing or invalid required parameters in
2630+ the request.
2631+ - INTERNAL: Any non-user error related to a technical issue in
2632+ the backend. In this case, contact Cloud Channel support.
2633+ - UNKNOWN: Any non-user error related to a technical issue in
2634+ the backend. In this case, contact Cloud Channel support.
2635+
2636+ Return Value: Topic name with service email address registered
2637+ if successful, otherwise error is returned.
2638+
2639+ Args:
2640+ request (:class:`google.cloud.channel_v1.types.RegisterSubscriberRequest`):
2641+ The request object. Request Message for
2642+ RegisterSubscriber.
2643+
2644+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2645+ should be retried.
2646+ timeout (float): The timeout for this request.
2647+ metadata (Sequence[Tuple[str, str]]): Strings which should be
2648+ sent along with the request as metadata.
2649+
2650+ Returns:
2651+ google.cloud.channel_v1.types.RegisterSubscriberResponse:
2652+ Response Message for
2653+ RegisterSubscriber.
2654+
2655+ """
2656+ # Create or coerce a protobuf request object.
2657+
2658+ request = service .RegisterSubscriberRequest (request )
2659+
2660+ # Wrap the RPC method; this adds retry and timeout information,
2661+ # and friendly error handling.
2662+ rpc = gapic_v1 .method_async .wrap_method (
2663+ self ._client ._transport .register_subscriber ,
2664+ default_timeout = None ,
2665+ client_info = DEFAULT_CLIENT_INFO ,
2666+ )
2667+
2668+ # Certain fields should be provided within the metadata header;
2669+ # add these here.
2670+ metadata = tuple (metadata ) + (
2671+ gapic_v1 .routing_header .to_grpc_metadata ((("account" , request .account ),)),
2672+ )
2673+
2674+ # Send the request.
2675+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
2676+
2677+ # Done; return the response.
2678+ return response
2679+
2680+ async def unregister_subscriber (
2681+ self ,
2682+ request : service .UnregisterSubscriberRequest = None ,
2683+ * ,
2684+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
2685+ timeout : float = None ,
2686+ metadata : Sequence [Tuple [str , str ]] = (),
2687+ ) -> service .UnregisterSubscriberResponse :
2688+ r"""Unregisters a service account with subscriber privileges on the
2689+ Cloud Pub/Sub topic created for this Channel Services account.
2690+ If there are no more service account left with sunbscriber
2691+ privileges, the topic will be deleted. You can check this by
2692+ calling ListSubscribers api.
2693+
2694+ Possible Error Codes:
2695+
2696+ - PERMISSION_DENIED: If the reseller account making the request
2697+ and the reseller account being provided are different, or if
2698+ the impersonated user is not a super admin.
2699+ - INVALID_ARGUMENT: Missing or invalid required parameters in
2700+ the request.
2701+ - NOT_FOUND: If the topic resource doesn't exist.
2702+ - INTERNAL: Any non-user error related to a technical issue in
2703+ the backend. In this case, contact Cloud Channel support.
2704+ - UNKNOWN: Any non-user error related to a technical issue in
2705+ the backend. In this case, contact Cloud Channel support.
2706+
2707+ Return Value: Topic name from which service email address has
2708+ been unregistered if successful, otherwise error is returned. If
2709+ the service email was already not associated with the topic, the
2710+ success response will be returned.
2711+
2712+ Args:
2713+ request (:class:`google.cloud.channel_v1.types.UnregisterSubscriberRequest`):
2714+ The request object. Request Message for
2715+ UnregisterSubscriber.
2716+
2717+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2718+ should be retried.
2719+ timeout (float): The timeout for this request.
2720+ metadata (Sequence[Tuple[str, str]]): Strings which should be
2721+ sent along with the request as metadata.
2722+
2723+ Returns:
2724+ google.cloud.channel_v1.types.UnregisterSubscriberResponse:
2725+ Response Message for
2726+ UnregisterSubscriber.
2727+
2728+ """
2729+ # Create or coerce a protobuf request object.
2730+
2731+ request = service .UnregisterSubscriberRequest (request )
2732+
2733+ # Wrap the RPC method; this adds retry and timeout information,
2734+ # and friendly error handling.
2735+ rpc = gapic_v1 .method_async .wrap_method (
2736+ self ._client ._transport .unregister_subscriber ,
2737+ default_timeout = None ,
2738+ client_info = DEFAULT_CLIENT_INFO ,
2739+ )
2740+
2741+ # Certain fields should be provided within the metadata header;
2742+ # add these here.
2743+ metadata = tuple (metadata ) + (
2744+ gapic_v1 .routing_header .to_grpc_metadata ((("account" , request .account ),)),
2745+ )
2746+
2747+ # Send the request.
2748+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
2749+
2750+ # Done; return the response.
2751+ return response
2752+
2753+ async def list_subscribers (
2754+ self ,
2755+ request : service .ListSubscribersRequest = None ,
2756+ * ,
2757+ retry : retries .Retry = gapic_v1 .method .DEFAULT ,
2758+ timeout : float = None ,
2759+ metadata : Sequence [Tuple [str , str ]] = (),
2760+ ) -> pagers .ListSubscribersAsyncPager :
2761+ r"""Lists service accounts with subscriber privileges on the Cloud
2762+ Pub/Sub topic created for this Channel Services account.
2763+
2764+ Possible Error Codes:
2765+
2766+ - PERMISSION_DENIED: If the reseller account making the request
2767+ and the reseller account being provided are different, or if
2768+ the account is not a super admin.
2769+ - INVALID_ARGUMENT: Missing or invalid required parameters in
2770+ the request.
2771+ - NOT_FOUND: If the topic resource doesn't exist.
2772+ - INTERNAL: Any non-user error related to a technical issue in
2773+ the backend. In this case, contact Cloud Channel support.
2774+ - UNKNOWN: Any non-user error related to a technical issue in
2775+ the backend. In this case, contact Cloud Channel support.
2776+
2777+ Return Value: List of service email addresses if successful,
2778+ otherwise error is returned.
2779+
2780+ Args:
2781+ request (:class:`google.cloud.channel_v1.types.ListSubscribersRequest`):
2782+ The request object. Request Message for ListSubscribers.
2783+
2784+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2785+ should be retried.
2786+ timeout (float): The timeout for this request.
2787+ metadata (Sequence[Tuple[str, str]]): Strings which should be
2788+ sent along with the request as metadata.
2789+
2790+ Returns:
2791+ google.cloud.channel_v1.services.cloud_channel_service.pagers.ListSubscribersAsyncPager:
2792+ Response Message for ListSubscribers.
2793+ Iterating over this object will yield
2794+ results and resolve additional pages
2795+ automatically.
2796+
2797+ """
2798+ # Create or coerce a protobuf request object.
2799+
2800+ request = service .ListSubscribersRequest (request )
2801+
2802+ # Wrap the RPC method; this adds retry and timeout information,
2803+ # and friendly error handling.
2804+ rpc = gapic_v1 .method_async .wrap_method (
2805+ self ._client ._transport .list_subscribers ,
2806+ default_timeout = None ,
2807+ client_info = DEFAULT_CLIENT_INFO ,
2808+ )
2809+
2810+ # Certain fields should be provided within the metadata header;
2811+ # add these here.
2812+ metadata = tuple (metadata ) + (
2813+ gapic_v1 .routing_header .to_grpc_metadata ((("account" , request .account ),)),
2814+ )
2815+
2816+ # Send the request.
2817+ response = await rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
2818+
2819+ # This method is paged; wrap the response in a pager, which provides
2820+ # an `__aiter__` convenience method.
2821+ response = pagers .ListSubscribersAsyncPager (
2822+ method = rpc , request = request , response = response , metadata = metadata ,
2823+ )
2824+
2825+ # Done; return the response.
2826+ return response
2827+
26112828
26122829try :
26132830 DEFAULT_CLIENT_INFO = gapic_v1 .client_info .ClientInfo (
0 commit comments