google-cloud-eventarc-v1 0.1.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -273,9 +273,9 @@ module Google
273
273
  # When paginating, all other parameters provided to `ListTriggers` must match
274
274
  # the call that provided the page token.
275
275
  # @param order_by [::String]
276
- # The sorting order of the resources returned. Value should be a comma
277
- # separated list of fields. The default sorting oder is ascending. To specify
278
- # descending order for a field, append a ` desc` suffix; for example:
276
+ # The sorting order of the resources returned. Value should be a
277
+ # comma-separated list of fields. The default sorting order is ascending. To
278
+ # specify descending order for a field, append a `desc` suffix; for example:
279
279
  # `name desc, trigger_id`.
280
280
  #
281
281
  # @yield [response, operation] Access the result along with the RPC operation
@@ -374,7 +374,7 @@ module Google
374
374
  # @param trigger_id [::String]
375
375
  # Required. The user-provided ID to be assigned to the trigger.
376
376
  # @param validate_only [::Boolean]
377
- # Required. If set, validate the request and preview the review, but do not actually
377
+ # Required. If set, validate the request and preview the review, but do not
378
378
  # post it.
379
379
  #
380
380
  # @yield [response, operation] Access the result along with the RPC operation
@@ -470,14 +470,14 @@ module Google
470
470
  # @param trigger [::Google::Cloud::Eventarc::V1::Trigger, ::Hash]
471
471
  # The trigger to be updated.
472
472
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
473
- # The fields to be updated; only fields explicitly provided will be updated.
474
- # If no field mask is provided, all provided fields in the request will be
473
+ # The fields to be updated; only fields explicitly provided are updated.
474
+ # If no field mask is provided, all provided fields in the request are
475
475
  # updated. To update all fields, provide a field mask of "*".
476
476
  # @param allow_missing [::Boolean]
477
477
  # If set to true, and the trigger is not found, a new trigger will be
478
478
  # created. In this situation, `update_mask` is ignored.
479
479
  # @param validate_only [::Boolean]
480
- # Required. If set, validate the request and preview the review, but do not actually
480
+ # Required. If set, validate the request and preview the review, but do not
481
481
  # post it.
482
482
  #
483
483
  # @yield [response, operation] Access the result along with the RPC operation
@@ -579,7 +579,7 @@ module Google
579
579
  # If set to true, and the trigger is not found, the request will succeed
580
580
  # but no action will be taken on the server.
581
581
  # @param validate_only [::Boolean]
582
- # Required. If set, validate the request and preview the review, but do not actually
582
+ # Required. If set, validate the request and preview the review, but do not
583
583
  # post it.
584
584
  #
585
585
  # @yield [response, operation] Access the result along with the RPC operation
@@ -654,6 +654,1061 @@ module Google
654
654
  raise ::Google::Cloud::Error.from_error(e)
655
655
  end
656
656
 
657
+ ##
658
+ # Get a single Channel.
659
+ #
660
+ # @overload get_channel(request, options = nil)
661
+ # Pass arguments to `get_channel` via a request object, either of type
662
+ # {::Google::Cloud::Eventarc::V1::GetChannelRequest} or an equivalent Hash.
663
+ #
664
+ # @param request [::Google::Cloud::Eventarc::V1::GetChannelRequest, ::Hash]
665
+ # A request object representing the call parameters. Required. To specify no
666
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
667
+ # @param options [::Gapic::CallOptions, ::Hash]
668
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
669
+ #
670
+ # @overload get_channel(name: nil)
671
+ # Pass arguments to `get_channel` via keyword arguments. Note that at
672
+ # least one keyword argument is required. To specify no parameters, or to keep all
673
+ # the default parameter values, pass an empty Hash as a request object (see above).
674
+ #
675
+ # @param name [::String]
676
+ # Required. The name of the channel to get.
677
+ #
678
+ # @yield [response, operation] Access the result along with the RPC operation
679
+ # @yieldparam response [::Google::Cloud::Eventarc::V1::Channel]
680
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
681
+ #
682
+ # @return [::Google::Cloud::Eventarc::V1::Channel]
683
+ #
684
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
685
+ #
686
+ # @example Basic example
687
+ # require "google/cloud/eventarc/v1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::Eventarc::V1::GetChannelRequest.new
694
+ #
695
+ # # Call the get_channel method.
696
+ # result = client.get_channel request
697
+ #
698
+ # # The returned object is of type Google::Cloud::Eventarc::V1::Channel.
699
+ # p result
700
+ #
701
+ def get_channel request, options = nil
702
+ raise ::ArgumentError, "request must be provided" if request.nil?
703
+
704
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::GetChannelRequest
705
+
706
+ # Converts hash and nil to an options object
707
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
708
+
709
+ # Customize the options with defaults
710
+ metadata = @config.rpcs.get_channel.metadata.to_h
711
+
712
+ # Set x-goog-api-client and x-goog-user-project headers
713
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
714
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
715
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
716
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
717
+
718
+ header_params = {}
719
+ if request.name
720
+ header_params["name"] = request.name
721
+ end
722
+
723
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
724
+ metadata[:"x-goog-request-params"] ||= request_params_header
725
+
726
+ options.apply_defaults timeout: @config.rpcs.get_channel.timeout,
727
+ metadata: metadata,
728
+ retry_policy: @config.rpcs.get_channel.retry_policy
729
+
730
+ options.apply_defaults timeout: @config.timeout,
731
+ metadata: @config.metadata,
732
+ retry_policy: @config.retry_policy
733
+
734
+ @eventarc_stub.call_rpc :get_channel, request, options: options do |response, operation|
735
+ yield response, operation if block_given?
736
+ return response
737
+ end
738
+ rescue ::GRPC::BadStatus => e
739
+ raise ::Google::Cloud::Error.from_error(e)
740
+ end
741
+
742
+ ##
743
+ # List channels.
744
+ #
745
+ # @overload list_channels(request, options = nil)
746
+ # Pass arguments to `list_channels` via a request object, either of type
747
+ # {::Google::Cloud::Eventarc::V1::ListChannelsRequest} or an equivalent Hash.
748
+ #
749
+ # @param request [::Google::Cloud::Eventarc::V1::ListChannelsRequest, ::Hash]
750
+ # A request object representing the call parameters. Required. To specify no
751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
752
+ # @param options [::Gapic::CallOptions, ::Hash]
753
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
754
+ #
755
+ # @overload list_channels(parent: nil, page_size: nil, page_token: nil, order_by: nil)
756
+ # Pass arguments to `list_channels` via keyword arguments. Note that at
757
+ # least one keyword argument is required. To specify no parameters, or to keep all
758
+ # the default parameter values, pass an empty Hash as a request object (see above).
759
+ #
760
+ # @param parent [::String]
761
+ # Required. The parent collection to list channels on.
762
+ # @param page_size [::Integer]
763
+ # The maximum number of channels to return on each page.
764
+ # Note: The service may send fewer.
765
+ # @param page_token [::String]
766
+ # The page token; provide the value from the `next_page_token` field in a
767
+ # previous `ListChannels` call to retrieve the subsequent page.
768
+ #
769
+ # When paginating, all other parameters provided to `ListChannels` must
770
+ # match the call that provided the page token.
771
+ # @param order_by [::String]
772
+ # The sorting order of the resources returned. Value should be a
773
+ # comma-separated list of fields. The default sorting order is ascending. To
774
+ # specify descending order for a field, append a `desc` suffix; for example:
775
+ # `name desc, channel_id`.
776
+ #
777
+ # @yield [response, operation] Access the result along with the RPC operation
778
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::Channel>]
779
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
780
+ #
781
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::Channel>]
782
+ #
783
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
784
+ #
785
+ # @example Basic example
786
+ # require "google/cloud/eventarc/v1"
787
+ #
788
+ # # Create a client object. The client can be reused for multiple calls.
789
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
790
+ #
791
+ # # Create a request. To set request fields, pass in keyword arguments.
792
+ # request = Google::Cloud::Eventarc::V1::ListChannelsRequest.new
793
+ #
794
+ # # Call the list_channels method.
795
+ # result = client.list_channels request
796
+ #
797
+ # # The returned object is of type Gapic::PagedEnumerable. You can
798
+ # # iterate over all elements by calling #each, and the enumerable
799
+ # # will lazily make API calls to fetch subsequent pages. Other
800
+ # # methods are also available for managing paging directly.
801
+ # result.each do |response|
802
+ # # Each element is of type ::Google::Cloud::Eventarc::V1::Channel.
803
+ # p response
804
+ # end
805
+ #
806
+ def list_channels request, options = nil
807
+ raise ::ArgumentError, "request must be provided" if request.nil?
808
+
809
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::ListChannelsRequest
810
+
811
+ # Converts hash and nil to an options object
812
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
813
+
814
+ # Customize the options with defaults
815
+ metadata = @config.rpcs.list_channels.metadata.to_h
816
+
817
+ # Set x-goog-api-client and x-goog-user-project headers
818
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
819
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
820
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
821
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
822
+
823
+ header_params = {}
824
+ if request.parent
825
+ header_params["parent"] = request.parent
826
+ end
827
+
828
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
829
+ metadata[:"x-goog-request-params"] ||= request_params_header
830
+
831
+ options.apply_defaults timeout: @config.rpcs.list_channels.timeout,
832
+ metadata: metadata,
833
+ retry_policy: @config.rpcs.list_channels.retry_policy
834
+
835
+ options.apply_defaults timeout: @config.timeout,
836
+ metadata: @config.metadata,
837
+ retry_policy: @config.retry_policy
838
+
839
+ @eventarc_stub.call_rpc :list_channels, request, options: options do |response, operation|
840
+ response = ::Gapic::PagedEnumerable.new @eventarc_stub, :list_channels, request, response, operation, options
841
+ yield response, operation if block_given?
842
+ return response
843
+ end
844
+ rescue ::GRPC::BadStatus => e
845
+ raise ::Google::Cloud::Error.from_error(e)
846
+ end
847
+
848
+ ##
849
+ # Create a new channel in a particular project and location.
850
+ #
851
+ # @overload create_channel(request, options = nil)
852
+ # Pass arguments to `create_channel` via a request object, either of type
853
+ # {::Google::Cloud::Eventarc::V1::CreateChannelRequest} or an equivalent Hash.
854
+ #
855
+ # @param request [::Google::Cloud::Eventarc::V1::CreateChannelRequest, ::Hash]
856
+ # A request object representing the call parameters. Required. To specify no
857
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
858
+ # @param options [::Gapic::CallOptions, ::Hash]
859
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
860
+ #
861
+ # @overload create_channel(parent: nil, channel: nil, channel_id: nil, validate_only: nil)
862
+ # Pass arguments to `create_channel` via keyword arguments. Note that at
863
+ # least one keyword argument is required. To specify no parameters, or to keep all
864
+ # the default parameter values, pass an empty Hash as a request object (see above).
865
+ #
866
+ # @param parent [::String]
867
+ # Required. The parent collection in which to add this channel.
868
+ # @param channel [::Google::Cloud::Eventarc::V1::Channel, ::Hash]
869
+ # Required. The channel to create.
870
+ # @param channel_id [::String]
871
+ # Required. The user-provided ID to be assigned to the channel.
872
+ # @param validate_only [::Boolean]
873
+ # Required. If set, validate the request and preview the review, but do not
874
+ # post it.
875
+ #
876
+ # @yield [response, operation] Access the result along with the RPC operation
877
+ # @yieldparam response [::Gapic::Operation]
878
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
879
+ #
880
+ # @return [::Gapic::Operation]
881
+ #
882
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
883
+ #
884
+ # @example Basic example
885
+ # require "google/cloud/eventarc/v1"
886
+ #
887
+ # # Create a client object. The client can be reused for multiple calls.
888
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
889
+ #
890
+ # # Create a request. To set request fields, pass in keyword arguments.
891
+ # request = Google::Cloud::Eventarc::V1::CreateChannelRequest.new
892
+ #
893
+ # # Call the create_channel method.
894
+ # result = client.create_channel request
895
+ #
896
+ # # The returned object is of type Gapic::Operation. You can use this
897
+ # # object to check the status of an operation, cancel it, or wait
898
+ # # for results. Here is how to block until completion:
899
+ # result.wait_until_done! timeout: 60
900
+ # if result.response?
901
+ # p result.response
902
+ # else
903
+ # puts "Error!"
904
+ # end
905
+ #
906
+ def create_channel request, options = nil
907
+ raise ::ArgumentError, "request must be provided" if request.nil?
908
+
909
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::CreateChannelRequest
910
+
911
+ # Converts hash and nil to an options object
912
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
913
+
914
+ # Customize the options with defaults
915
+ metadata = @config.rpcs.create_channel.metadata.to_h
916
+
917
+ # Set x-goog-api-client and x-goog-user-project headers
918
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
919
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
920
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
921
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
922
+
923
+ header_params = {}
924
+ if request.parent
925
+ header_params["parent"] = request.parent
926
+ end
927
+
928
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
929
+ metadata[:"x-goog-request-params"] ||= request_params_header
930
+
931
+ options.apply_defaults timeout: @config.rpcs.create_channel.timeout,
932
+ metadata: metadata,
933
+ retry_policy: @config.rpcs.create_channel.retry_policy
934
+
935
+ options.apply_defaults timeout: @config.timeout,
936
+ metadata: @config.metadata,
937
+ retry_policy: @config.retry_policy
938
+
939
+ @eventarc_stub.call_rpc :create_channel, request, options: options do |response, operation|
940
+ response = ::Gapic::Operation.new response, @operations_client, options: options
941
+ yield response, operation if block_given?
942
+ return response
943
+ end
944
+ rescue ::GRPC::BadStatus => e
945
+ raise ::Google::Cloud::Error.from_error(e)
946
+ end
947
+
948
+ ##
949
+ # Update a single channel.
950
+ #
951
+ # @overload update_channel(request, options = nil)
952
+ # Pass arguments to `update_channel` via a request object, either of type
953
+ # {::Google::Cloud::Eventarc::V1::UpdateChannelRequest} or an equivalent Hash.
954
+ #
955
+ # @param request [::Google::Cloud::Eventarc::V1::UpdateChannelRequest, ::Hash]
956
+ # A request object representing the call parameters. Required. To specify no
957
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
958
+ # @param options [::Gapic::CallOptions, ::Hash]
959
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
960
+ #
961
+ # @overload update_channel(channel: nil, update_mask: nil, validate_only: nil)
962
+ # Pass arguments to `update_channel` via keyword arguments. Note that at
963
+ # least one keyword argument is required. To specify no parameters, or to keep all
964
+ # the default parameter values, pass an empty Hash as a request object (see above).
965
+ #
966
+ # @param channel [::Google::Cloud::Eventarc::V1::Channel, ::Hash]
967
+ # The channel to be updated.
968
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
969
+ # The fields to be updated; only fields explicitly provided are updated.
970
+ # If no field mask is provided, all provided fields in the request are
971
+ # updated. To update all fields, provide a field mask of "*".
972
+ # @param validate_only [::Boolean]
973
+ # Required. If set, validate the request and preview the review, but do not
974
+ # post it.
975
+ #
976
+ # @yield [response, operation] Access the result along with the RPC operation
977
+ # @yieldparam response [::Gapic::Operation]
978
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
979
+ #
980
+ # @return [::Gapic::Operation]
981
+ #
982
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
983
+ #
984
+ # @example Basic example
985
+ # require "google/cloud/eventarc/v1"
986
+ #
987
+ # # Create a client object. The client can be reused for multiple calls.
988
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
989
+ #
990
+ # # Create a request. To set request fields, pass in keyword arguments.
991
+ # request = Google::Cloud::Eventarc::V1::UpdateChannelRequest.new
992
+ #
993
+ # # Call the update_channel method.
994
+ # result = client.update_channel request
995
+ #
996
+ # # The returned object is of type Gapic::Operation. You can use this
997
+ # # object to check the status of an operation, cancel it, or wait
998
+ # # for results. Here is how to block until completion:
999
+ # result.wait_until_done! timeout: 60
1000
+ # if result.response?
1001
+ # p result.response
1002
+ # else
1003
+ # puts "Error!"
1004
+ # end
1005
+ #
1006
+ def update_channel request, options = nil
1007
+ raise ::ArgumentError, "request must be provided" if request.nil?
1008
+
1009
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::UpdateChannelRequest
1010
+
1011
+ # Converts hash and nil to an options object
1012
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1013
+
1014
+ # Customize the options with defaults
1015
+ metadata = @config.rpcs.update_channel.metadata.to_h
1016
+
1017
+ # Set x-goog-api-client and x-goog-user-project headers
1018
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1019
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1020
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1021
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1022
+
1023
+ header_params = {}
1024
+ if request.channel&.name
1025
+ header_params["channel.name"] = request.channel.name
1026
+ end
1027
+
1028
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1029
+ metadata[:"x-goog-request-params"] ||= request_params_header
1030
+
1031
+ options.apply_defaults timeout: @config.rpcs.update_channel.timeout,
1032
+ metadata: metadata,
1033
+ retry_policy: @config.rpcs.update_channel.retry_policy
1034
+
1035
+ options.apply_defaults timeout: @config.timeout,
1036
+ metadata: @config.metadata,
1037
+ retry_policy: @config.retry_policy
1038
+
1039
+ @eventarc_stub.call_rpc :update_channel, request, options: options do |response, operation|
1040
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1041
+ yield response, operation if block_given?
1042
+ return response
1043
+ end
1044
+ rescue ::GRPC::BadStatus => e
1045
+ raise ::Google::Cloud::Error.from_error(e)
1046
+ end
1047
+
1048
+ ##
1049
+ # Delete a single channel.
1050
+ #
1051
+ # @overload delete_channel(request, options = nil)
1052
+ # Pass arguments to `delete_channel` via a request object, either of type
1053
+ # {::Google::Cloud::Eventarc::V1::DeleteChannelRequest} or an equivalent Hash.
1054
+ #
1055
+ # @param request [::Google::Cloud::Eventarc::V1::DeleteChannelRequest, ::Hash]
1056
+ # A request object representing the call parameters. Required. To specify no
1057
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1058
+ # @param options [::Gapic::CallOptions, ::Hash]
1059
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1060
+ #
1061
+ # @overload delete_channel(name: nil, validate_only: nil)
1062
+ # Pass arguments to `delete_channel` via keyword arguments. Note that at
1063
+ # least one keyword argument is required. To specify no parameters, or to keep all
1064
+ # the default parameter values, pass an empty Hash as a request object (see above).
1065
+ #
1066
+ # @param name [::String]
1067
+ # Required. The name of the channel to be deleted.
1068
+ # @param validate_only [::Boolean]
1069
+ # Required. If set, validate the request and preview the review, but do not
1070
+ # post it.
1071
+ #
1072
+ # @yield [response, operation] Access the result along with the RPC operation
1073
+ # @yieldparam response [::Gapic::Operation]
1074
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1075
+ #
1076
+ # @return [::Gapic::Operation]
1077
+ #
1078
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1079
+ #
1080
+ # @example Basic example
1081
+ # require "google/cloud/eventarc/v1"
1082
+ #
1083
+ # # Create a client object. The client can be reused for multiple calls.
1084
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1085
+ #
1086
+ # # Create a request. To set request fields, pass in keyword arguments.
1087
+ # request = Google::Cloud::Eventarc::V1::DeleteChannelRequest.new
1088
+ #
1089
+ # # Call the delete_channel method.
1090
+ # result = client.delete_channel request
1091
+ #
1092
+ # # The returned object is of type Gapic::Operation. You can use this
1093
+ # # object to check the status of an operation, cancel it, or wait
1094
+ # # for results. Here is how to block until completion:
1095
+ # result.wait_until_done! timeout: 60
1096
+ # if result.response?
1097
+ # p result.response
1098
+ # else
1099
+ # puts "Error!"
1100
+ # end
1101
+ #
1102
+ def delete_channel request, options = nil
1103
+ raise ::ArgumentError, "request must be provided" if request.nil?
1104
+
1105
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::DeleteChannelRequest
1106
+
1107
+ # Converts hash and nil to an options object
1108
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1109
+
1110
+ # Customize the options with defaults
1111
+ metadata = @config.rpcs.delete_channel.metadata.to_h
1112
+
1113
+ # Set x-goog-api-client and x-goog-user-project headers
1114
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1115
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1116
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1117
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
+
1119
+ header_params = {}
1120
+ if request.name
1121
+ header_params["name"] = request.name
1122
+ end
1123
+
1124
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1125
+ metadata[:"x-goog-request-params"] ||= request_params_header
1126
+
1127
+ options.apply_defaults timeout: @config.rpcs.delete_channel.timeout,
1128
+ metadata: metadata,
1129
+ retry_policy: @config.rpcs.delete_channel.retry_policy
1130
+
1131
+ options.apply_defaults timeout: @config.timeout,
1132
+ metadata: @config.metadata,
1133
+ retry_policy: @config.retry_policy
1134
+
1135
+ @eventarc_stub.call_rpc :delete_channel, request, options: options do |response, operation|
1136
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1137
+ yield response, operation if block_given?
1138
+ return response
1139
+ end
1140
+ rescue ::GRPC::BadStatus => e
1141
+ raise ::Google::Cloud::Error.from_error(e)
1142
+ end
1143
+
1144
+ ##
1145
+ # Get a single Provider.
1146
+ #
1147
+ # @overload get_provider(request, options = nil)
1148
+ # Pass arguments to `get_provider` via a request object, either of type
1149
+ # {::Google::Cloud::Eventarc::V1::GetProviderRequest} or an equivalent Hash.
1150
+ #
1151
+ # @param request [::Google::Cloud::Eventarc::V1::GetProviderRequest, ::Hash]
1152
+ # A request object representing the call parameters. Required. To specify no
1153
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1154
+ # @param options [::Gapic::CallOptions, ::Hash]
1155
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1156
+ #
1157
+ # @overload get_provider(name: nil)
1158
+ # Pass arguments to `get_provider` via keyword arguments. Note that at
1159
+ # least one keyword argument is required. To specify no parameters, or to keep all
1160
+ # the default parameter values, pass an empty Hash as a request object (see above).
1161
+ #
1162
+ # @param name [::String]
1163
+ # Required. The name of the provider to get.
1164
+ #
1165
+ # @yield [response, operation] Access the result along with the RPC operation
1166
+ # @yieldparam response [::Google::Cloud::Eventarc::V1::Provider]
1167
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1168
+ #
1169
+ # @return [::Google::Cloud::Eventarc::V1::Provider]
1170
+ #
1171
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1172
+ #
1173
+ # @example Basic example
1174
+ # require "google/cloud/eventarc/v1"
1175
+ #
1176
+ # # Create a client object. The client can be reused for multiple calls.
1177
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1178
+ #
1179
+ # # Create a request. To set request fields, pass in keyword arguments.
1180
+ # request = Google::Cloud::Eventarc::V1::GetProviderRequest.new
1181
+ #
1182
+ # # Call the get_provider method.
1183
+ # result = client.get_provider request
1184
+ #
1185
+ # # The returned object is of type Google::Cloud::Eventarc::V1::Provider.
1186
+ # p result
1187
+ #
1188
+ def get_provider request, options = nil
1189
+ raise ::ArgumentError, "request must be provided" if request.nil?
1190
+
1191
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::GetProviderRequest
1192
+
1193
+ # Converts hash and nil to an options object
1194
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1195
+
1196
+ # Customize the options with defaults
1197
+ metadata = @config.rpcs.get_provider.metadata.to_h
1198
+
1199
+ # Set x-goog-api-client and x-goog-user-project headers
1200
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1201
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1202
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1203
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1204
+
1205
+ header_params = {}
1206
+ if request.name
1207
+ header_params["name"] = request.name
1208
+ end
1209
+
1210
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1211
+ metadata[:"x-goog-request-params"] ||= request_params_header
1212
+
1213
+ options.apply_defaults timeout: @config.rpcs.get_provider.timeout,
1214
+ metadata: metadata,
1215
+ retry_policy: @config.rpcs.get_provider.retry_policy
1216
+
1217
+ options.apply_defaults timeout: @config.timeout,
1218
+ metadata: @config.metadata,
1219
+ retry_policy: @config.retry_policy
1220
+
1221
+ @eventarc_stub.call_rpc :get_provider, request, options: options do |response, operation|
1222
+ yield response, operation if block_given?
1223
+ return response
1224
+ end
1225
+ rescue ::GRPC::BadStatus => e
1226
+ raise ::Google::Cloud::Error.from_error(e)
1227
+ end
1228
+
1229
+ ##
1230
+ # List providers.
1231
+ #
1232
+ # @overload list_providers(request, options = nil)
1233
+ # Pass arguments to `list_providers` via a request object, either of type
1234
+ # {::Google::Cloud::Eventarc::V1::ListProvidersRequest} or an equivalent Hash.
1235
+ #
1236
+ # @param request [::Google::Cloud::Eventarc::V1::ListProvidersRequest, ::Hash]
1237
+ # A request object representing the call parameters. Required. To specify no
1238
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1239
+ # @param options [::Gapic::CallOptions, ::Hash]
1240
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1241
+ #
1242
+ # @overload list_providers(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil)
1243
+ # Pass arguments to `list_providers` via keyword arguments. Note that at
1244
+ # least one keyword argument is required. To specify no parameters, or to keep all
1245
+ # the default parameter values, pass an empty Hash as a request object (see above).
1246
+ #
1247
+ # @param parent [::String]
1248
+ # Required. The parent of the provider to get.
1249
+ # @param page_size [::Integer]
1250
+ # The maximum number of providers to return on each page.
1251
+ # @param page_token [::String]
1252
+ # The page token; provide the value from the `next_page_token` field in a
1253
+ # previous `ListProviders` call to retrieve the subsequent page.
1254
+ #
1255
+ # When paginating, all other parameters provided to `ListProviders` must
1256
+ # match the call that provided the page token.
1257
+ # @param order_by [::String]
1258
+ # The sorting order of the resources returned. Value should be a
1259
+ # comma-separated list of fields. The default sorting oder is ascending. To
1260
+ # specify descending order for a field, append a `desc` suffix; for example:
1261
+ # `name desc, _id`.
1262
+ # @param filter [::String]
1263
+ # The filter field that the list request will filter on.
1264
+ #
1265
+ # @yield [response, operation] Access the result along with the RPC operation
1266
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::Provider>]
1267
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1268
+ #
1269
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::Provider>]
1270
+ #
1271
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1272
+ #
1273
+ # @example Basic example
1274
+ # require "google/cloud/eventarc/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1278
+ #
1279
+ # # Create a request. To set request fields, pass in keyword arguments.
1280
+ # request = Google::Cloud::Eventarc::V1::ListProvidersRequest.new
1281
+ #
1282
+ # # Call the list_providers method.
1283
+ # result = client.list_providers request
1284
+ #
1285
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1286
+ # # iterate over all elements by calling #each, and the enumerable
1287
+ # # will lazily make API calls to fetch subsequent pages. Other
1288
+ # # methods are also available for managing paging directly.
1289
+ # result.each do |response|
1290
+ # # Each element is of type ::Google::Cloud::Eventarc::V1::Provider.
1291
+ # p response
1292
+ # end
1293
+ #
1294
+ def list_providers request, options = nil
1295
+ raise ::ArgumentError, "request must be provided" if request.nil?
1296
+
1297
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::ListProvidersRequest
1298
+
1299
+ # Converts hash and nil to an options object
1300
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1301
+
1302
+ # Customize the options with defaults
1303
+ metadata = @config.rpcs.list_providers.metadata.to_h
1304
+
1305
+ # Set x-goog-api-client and x-goog-user-project headers
1306
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1307
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1308
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1309
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1310
+
1311
+ header_params = {}
1312
+ if request.parent
1313
+ header_params["parent"] = request.parent
1314
+ end
1315
+
1316
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1317
+ metadata[:"x-goog-request-params"] ||= request_params_header
1318
+
1319
+ options.apply_defaults timeout: @config.rpcs.list_providers.timeout,
1320
+ metadata: metadata,
1321
+ retry_policy: @config.rpcs.list_providers.retry_policy
1322
+
1323
+ options.apply_defaults timeout: @config.timeout,
1324
+ metadata: @config.metadata,
1325
+ retry_policy: @config.retry_policy
1326
+
1327
+ @eventarc_stub.call_rpc :list_providers, request, options: options do |response, operation|
1328
+ response = ::Gapic::PagedEnumerable.new @eventarc_stub, :list_providers, request, response, operation, options
1329
+ yield response, operation if block_given?
1330
+ return response
1331
+ end
1332
+ rescue ::GRPC::BadStatus => e
1333
+ raise ::Google::Cloud::Error.from_error(e)
1334
+ end
1335
+
1336
+ ##
1337
+ # Get a single ChannelConnection.
1338
+ #
1339
+ # @overload get_channel_connection(request, options = nil)
1340
+ # Pass arguments to `get_channel_connection` via a request object, either of type
1341
+ # {::Google::Cloud::Eventarc::V1::GetChannelConnectionRequest} or an equivalent Hash.
1342
+ #
1343
+ # @param request [::Google::Cloud::Eventarc::V1::GetChannelConnectionRequest, ::Hash]
1344
+ # A request object representing the call parameters. Required. To specify no
1345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1346
+ # @param options [::Gapic::CallOptions, ::Hash]
1347
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1348
+ #
1349
+ # @overload get_channel_connection(name: nil)
1350
+ # Pass arguments to `get_channel_connection` via keyword arguments. Note that at
1351
+ # least one keyword argument is required. To specify no parameters, or to keep all
1352
+ # the default parameter values, pass an empty Hash as a request object (see above).
1353
+ #
1354
+ # @param name [::String]
1355
+ # Required. The name of the channel connection to get.
1356
+ #
1357
+ # @yield [response, operation] Access the result along with the RPC operation
1358
+ # @yieldparam response [::Google::Cloud::Eventarc::V1::ChannelConnection]
1359
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1360
+ #
1361
+ # @return [::Google::Cloud::Eventarc::V1::ChannelConnection]
1362
+ #
1363
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1364
+ #
1365
+ # @example Basic example
1366
+ # require "google/cloud/eventarc/v1"
1367
+ #
1368
+ # # Create a client object. The client can be reused for multiple calls.
1369
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1370
+ #
1371
+ # # Create a request. To set request fields, pass in keyword arguments.
1372
+ # request = Google::Cloud::Eventarc::V1::GetChannelConnectionRequest.new
1373
+ #
1374
+ # # Call the get_channel_connection method.
1375
+ # result = client.get_channel_connection request
1376
+ #
1377
+ # # The returned object is of type Google::Cloud::Eventarc::V1::ChannelConnection.
1378
+ # p result
1379
+ #
1380
+ def get_channel_connection request, options = nil
1381
+ raise ::ArgumentError, "request must be provided" if request.nil?
1382
+
1383
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::GetChannelConnectionRequest
1384
+
1385
+ # Converts hash and nil to an options object
1386
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1387
+
1388
+ # Customize the options with defaults
1389
+ metadata = @config.rpcs.get_channel_connection.metadata.to_h
1390
+
1391
+ # Set x-goog-api-client and x-goog-user-project headers
1392
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1393
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1394
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1395
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1396
+
1397
+ header_params = {}
1398
+ if request.name
1399
+ header_params["name"] = request.name
1400
+ end
1401
+
1402
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1403
+ metadata[:"x-goog-request-params"] ||= request_params_header
1404
+
1405
+ options.apply_defaults timeout: @config.rpcs.get_channel_connection.timeout,
1406
+ metadata: metadata,
1407
+ retry_policy: @config.rpcs.get_channel_connection.retry_policy
1408
+
1409
+ options.apply_defaults timeout: @config.timeout,
1410
+ metadata: @config.metadata,
1411
+ retry_policy: @config.retry_policy
1412
+
1413
+ @eventarc_stub.call_rpc :get_channel_connection, request, options: options do |response, operation|
1414
+ yield response, operation if block_given?
1415
+ return response
1416
+ end
1417
+ rescue ::GRPC::BadStatus => e
1418
+ raise ::Google::Cloud::Error.from_error(e)
1419
+ end
1420
+
1421
+ ##
1422
+ # List channel connections.
1423
+ #
1424
+ # @overload list_channel_connections(request, options = nil)
1425
+ # Pass arguments to `list_channel_connections` via a request object, either of type
1426
+ # {::Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest} or an equivalent Hash.
1427
+ #
1428
+ # @param request [::Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest, ::Hash]
1429
+ # A request object representing the call parameters. Required. To specify no
1430
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1431
+ # @param options [::Gapic::CallOptions, ::Hash]
1432
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1433
+ #
1434
+ # @overload list_channel_connections(parent: nil, page_size: nil, page_token: nil)
1435
+ # Pass arguments to `list_channel_connections` via keyword arguments. Note that at
1436
+ # least one keyword argument is required. To specify no parameters, or to keep all
1437
+ # the default parameter values, pass an empty Hash as a request object (see above).
1438
+ #
1439
+ # @param parent [::String]
1440
+ # Required. The parent collection from which to list channel connections.
1441
+ # @param page_size [::Integer]
1442
+ # The maximum number of channel connections to return on each page.
1443
+ # Note: The service may send fewer responses.
1444
+ # @param page_token [::String]
1445
+ # The page token; provide the value from the `next_page_token` field in a
1446
+ # previous `ListChannelConnections` call to retrieve the subsequent page.
1447
+ #
1448
+ # When paginating, all other parameters provided to `ListChannelConnetions`
1449
+ # match the call that provided the page token.
1450
+ #
1451
+ # @yield [response, operation] Access the result along with the RPC operation
1452
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::ChannelConnection>]
1453
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1454
+ #
1455
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::ChannelConnection>]
1456
+ #
1457
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1458
+ #
1459
+ # @example Basic example
1460
+ # require "google/cloud/eventarc/v1"
1461
+ #
1462
+ # # Create a client object. The client can be reused for multiple calls.
1463
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1464
+ #
1465
+ # # Create a request. To set request fields, pass in keyword arguments.
1466
+ # request = Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest.new
1467
+ #
1468
+ # # Call the list_channel_connections method.
1469
+ # result = client.list_channel_connections request
1470
+ #
1471
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1472
+ # # iterate over all elements by calling #each, and the enumerable
1473
+ # # will lazily make API calls to fetch subsequent pages. Other
1474
+ # # methods are also available for managing paging directly.
1475
+ # result.each do |response|
1476
+ # # Each element is of type ::Google::Cloud::Eventarc::V1::ChannelConnection.
1477
+ # p response
1478
+ # end
1479
+ #
1480
+ def list_channel_connections request, options = nil
1481
+ raise ::ArgumentError, "request must be provided" if request.nil?
1482
+
1483
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest
1484
+
1485
+ # Converts hash and nil to an options object
1486
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1487
+
1488
+ # Customize the options with defaults
1489
+ metadata = @config.rpcs.list_channel_connections.metadata.to_h
1490
+
1491
+ # Set x-goog-api-client and x-goog-user-project headers
1492
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1493
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1494
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1495
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1496
+
1497
+ header_params = {}
1498
+ if request.parent
1499
+ header_params["parent"] = request.parent
1500
+ end
1501
+
1502
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1503
+ metadata[:"x-goog-request-params"] ||= request_params_header
1504
+
1505
+ options.apply_defaults timeout: @config.rpcs.list_channel_connections.timeout,
1506
+ metadata: metadata,
1507
+ retry_policy: @config.rpcs.list_channel_connections.retry_policy
1508
+
1509
+ options.apply_defaults timeout: @config.timeout,
1510
+ metadata: @config.metadata,
1511
+ retry_policy: @config.retry_policy
1512
+
1513
+ @eventarc_stub.call_rpc :list_channel_connections, request, options: options do |response, operation|
1514
+ response = ::Gapic::PagedEnumerable.new @eventarc_stub, :list_channel_connections, request, response, operation, options
1515
+ yield response, operation if block_given?
1516
+ return response
1517
+ end
1518
+ rescue ::GRPC::BadStatus => e
1519
+ raise ::Google::Cloud::Error.from_error(e)
1520
+ end
1521
+
1522
+ ##
1523
+ # Create a new ChannelConnection in a particular project and location.
1524
+ #
1525
+ # @overload create_channel_connection(request, options = nil)
1526
+ # Pass arguments to `create_channel_connection` via a request object, either of type
1527
+ # {::Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest} or an equivalent Hash.
1528
+ #
1529
+ # @param request [::Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest, ::Hash]
1530
+ # A request object representing the call parameters. Required. To specify no
1531
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1532
+ # @param options [::Gapic::CallOptions, ::Hash]
1533
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1534
+ #
1535
+ # @overload create_channel_connection(parent: nil, channel_connection: nil, channel_connection_id: nil)
1536
+ # Pass arguments to `create_channel_connection` via keyword arguments. Note that at
1537
+ # least one keyword argument is required. To specify no parameters, or to keep all
1538
+ # the default parameter values, pass an empty Hash as a request object (see above).
1539
+ #
1540
+ # @param parent [::String]
1541
+ # Required. The parent collection in which to add this channel connection.
1542
+ # @param channel_connection [::Google::Cloud::Eventarc::V1::ChannelConnection, ::Hash]
1543
+ # Required. Channel connection to create.
1544
+ # @param channel_connection_id [::String]
1545
+ # Required. The user-provided ID to be assigned to the channel connection.
1546
+ #
1547
+ # @yield [response, operation] Access the result along with the RPC operation
1548
+ # @yieldparam response [::Gapic::Operation]
1549
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1550
+ #
1551
+ # @return [::Gapic::Operation]
1552
+ #
1553
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1554
+ #
1555
+ # @example Basic example
1556
+ # require "google/cloud/eventarc/v1"
1557
+ #
1558
+ # # Create a client object. The client can be reused for multiple calls.
1559
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1560
+ #
1561
+ # # Create a request. To set request fields, pass in keyword arguments.
1562
+ # request = Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest.new
1563
+ #
1564
+ # # Call the create_channel_connection method.
1565
+ # result = client.create_channel_connection request
1566
+ #
1567
+ # # The returned object is of type Gapic::Operation. You can use this
1568
+ # # object to check the status of an operation, cancel it, or wait
1569
+ # # for results. Here is how to block until completion:
1570
+ # result.wait_until_done! timeout: 60
1571
+ # if result.response?
1572
+ # p result.response
1573
+ # else
1574
+ # puts "Error!"
1575
+ # end
1576
+ #
1577
+ def create_channel_connection request, options = nil
1578
+ raise ::ArgumentError, "request must be provided" if request.nil?
1579
+
1580
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest
1581
+
1582
+ # Converts hash and nil to an options object
1583
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1584
+
1585
+ # Customize the options with defaults
1586
+ metadata = @config.rpcs.create_channel_connection.metadata.to_h
1587
+
1588
+ # Set x-goog-api-client and x-goog-user-project headers
1589
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1590
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1591
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1592
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1593
+
1594
+ header_params = {}
1595
+ if request.parent
1596
+ header_params["parent"] = request.parent
1597
+ end
1598
+
1599
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1600
+ metadata[:"x-goog-request-params"] ||= request_params_header
1601
+
1602
+ options.apply_defaults timeout: @config.rpcs.create_channel_connection.timeout,
1603
+ metadata: metadata,
1604
+ retry_policy: @config.rpcs.create_channel_connection.retry_policy
1605
+
1606
+ options.apply_defaults timeout: @config.timeout,
1607
+ metadata: @config.metadata,
1608
+ retry_policy: @config.retry_policy
1609
+
1610
+ @eventarc_stub.call_rpc :create_channel_connection, request, options: options do |response, operation|
1611
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1612
+ yield response, operation if block_given?
1613
+ return response
1614
+ end
1615
+ rescue ::GRPC::BadStatus => e
1616
+ raise ::Google::Cloud::Error.from_error(e)
1617
+ end
1618
+
1619
+ ##
1620
+ # Delete a single ChannelConnection.
1621
+ #
1622
+ # @overload delete_channel_connection(request, options = nil)
1623
+ # Pass arguments to `delete_channel_connection` via a request object, either of type
1624
+ # {::Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest} or an equivalent Hash.
1625
+ #
1626
+ # @param request [::Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest, ::Hash]
1627
+ # A request object representing the call parameters. Required. To specify no
1628
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1629
+ # @param options [::Gapic::CallOptions, ::Hash]
1630
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1631
+ #
1632
+ # @overload delete_channel_connection(name: nil)
1633
+ # Pass arguments to `delete_channel_connection` via keyword arguments. Note that at
1634
+ # least one keyword argument is required. To specify no parameters, or to keep all
1635
+ # the default parameter values, pass an empty Hash as a request object (see above).
1636
+ #
1637
+ # @param name [::String]
1638
+ # Required. The name of the channel connection to delete.
1639
+ #
1640
+ # @yield [response, operation] Access the result along with the RPC operation
1641
+ # @yieldparam response [::Gapic::Operation]
1642
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1643
+ #
1644
+ # @return [::Gapic::Operation]
1645
+ #
1646
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1647
+ #
1648
+ # @example Basic example
1649
+ # require "google/cloud/eventarc/v1"
1650
+ #
1651
+ # # Create a client object. The client can be reused for multiple calls.
1652
+ # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new
1653
+ #
1654
+ # # Create a request. To set request fields, pass in keyword arguments.
1655
+ # request = Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest.new
1656
+ #
1657
+ # # Call the delete_channel_connection method.
1658
+ # result = client.delete_channel_connection request
1659
+ #
1660
+ # # The returned object is of type Gapic::Operation. You can use this
1661
+ # # object to check the status of an operation, cancel it, or wait
1662
+ # # for results. Here is how to block until completion:
1663
+ # result.wait_until_done! timeout: 60
1664
+ # if result.response?
1665
+ # p result.response
1666
+ # else
1667
+ # puts "Error!"
1668
+ # end
1669
+ #
1670
+ def delete_channel_connection request, options = nil
1671
+ raise ::ArgumentError, "request must be provided" if request.nil?
1672
+
1673
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest
1674
+
1675
+ # Converts hash and nil to an options object
1676
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1677
+
1678
+ # Customize the options with defaults
1679
+ metadata = @config.rpcs.delete_channel_connection.metadata.to_h
1680
+
1681
+ # Set x-goog-api-client and x-goog-user-project headers
1682
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1683
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1684
+ gapic_version: ::Google::Cloud::Eventarc::V1::VERSION
1685
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1686
+
1687
+ header_params = {}
1688
+ if request.name
1689
+ header_params["name"] = request.name
1690
+ end
1691
+
1692
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1693
+ metadata[:"x-goog-request-params"] ||= request_params_header
1694
+
1695
+ options.apply_defaults timeout: @config.rpcs.delete_channel_connection.timeout,
1696
+ metadata: metadata,
1697
+ retry_policy: @config.rpcs.delete_channel_connection.retry_policy
1698
+
1699
+ options.apply_defaults timeout: @config.timeout,
1700
+ metadata: @config.metadata,
1701
+ retry_policy: @config.retry_policy
1702
+
1703
+ @eventarc_stub.call_rpc :delete_channel_connection, request, options: options do |response, operation|
1704
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1705
+ yield response, operation if block_given?
1706
+ return response
1707
+ end
1708
+ rescue ::GRPC::BadStatus => e
1709
+ raise ::Google::Cloud::Error.from_error(e)
1710
+ end
1711
+
657
1712
  ##
658
1713
  # Configuration class for the Eventarc API.
659
1714
  #
@@ -814,6 +1869,61 @@ module Google
814
1869
  # @return [::Gapic::Config::Method]
815
1870
  #
816
1871
  attr_reader :delete_trigger
1872
+ ##
1873
+ # RPC-specific configuration for `get_channel`
1874
+ # @return [::Gapic::Config::Method]
1875
+ #
1876
+ attr_reader :get_channel
1877
+ ##
1878
+ # RPC-specific configuration for `list_channels`
1879
+ # @return [::Gapic::Config::Method]
1880
+ #
1881
+ attr_reader :list_channels
1882
+ ##
1883
+ # RPC-specific configuration for `create_channel`
1884
+ # @return [::Gapic::Config::Method]
1885
+ #
1886
+ attr_reader :create_channel
1887
+ ##
1888
+ # RPC-specific configuration for `update_channel`
1889
+ # @return [::Gapic::Config::Method]
1890
+ #
1891
+ attr_reader :update_channel
1892
+ ##
1893
+ # RPC-specific configuration for `delete_channel`
1894
+ # @return [::Gapic::Config::Method]
1895
+ #
1896
+ attr_reader :delete_channel
1897
+ ##
1898
+ # RPC-specific configuration for `get_provider`
1899
+ # @return [::Gapic::Config::Method]
1900
+ #
1901
+ attr_reader :get_provider
1902
+ ##
1903
+ # RPC-specific configuration for `list_providers`
1904
+ # @return [::Gapic::Config::Method]
1905
+ #
1906
+ attr_reader :list_providers
1907
+ ##
1908
+ # RPC-specific configuration for `get_channel_connection`
1909
+ # @return [::Gapic::Config::Method]
1910
+ #
1911
+ attr_reader :get_channel_connection
1912
+ ##
1913
+ # RPC-specific configuration for `list_channel_connections`
1914
+ # @return [::Gapic::Config::Method]
1915
+ #
1916
+ attr_reader :list_channel_connections
1917
+ ##
1918
+ # RPC-specific configuration for `create_channel_connection`
1919
+ # @return [::Gapic::Config::Method]
1920
+ #
1921
+ attr_reader :create_channel_connection
1922
+ ##
1923
+ # RPC-specific configuration for `delete_channel_connection`
1924
+ # @return [::Gapic::Config::Method]
1925
+ #
1926
+ attr_reader :delete_channel_connection
817
1927
 
818
1928
  # @private
819
1929
  def initialize parent_rpcs = nil
@@ -827,6 +1937,28 @@ module Google
827
1937
  @update_trigger = ::Gapic::Config::Method.new update_trigger_config
828
1938
  delete_trigger_config = parent_rpcs.delete_trigger if parent_rpcs.respond_to? :delete_trigger
829
1939
  @delete_trigger = ::Gapic::Config::Method.new delete_trigger_config
1940
+ get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel
1941
+ @get_channel = ::Gapic::Config::Method.new get_channel_config
1942
+ list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels
1943
+ @list_channels = ::Gapic::Config::Method.new list_channels_config
1944
+ create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel
1945
+ @create_channel = ::Gapic::Config::Method.new create_channel_config
1946
+ update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel
1947
+ @update_channel = ::Gapic::Config::Method.new update_channel_config
1948
+ delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel
1949
+ @delete_channel = ::Gapic::Config::Method.new delete_channel_config
1950
+ get_provider_config = parent_rpcs.get_provider if parent_rpcs.respond_to? :get_provider
1951
+ @get_provider = ::Gapic::Config::Method.new get_provider_config
1952
+ list_providers_config = parent_rpcs.list_providers if parent_rpcs.respond_to? :list_providers
1953
+ @list_providers = ::Gapic::Config::Method.new list_providers_config
1954
+ get_channel_connection_config = parent_rpcs.get_channel_connection if parent_rpcs.respond_to? :get_channel_connection
1955
+ @get_channel_connection = ::Gapic::Config::Method.new get_channel_connection_config
1956
+ list_channel_connections_config = parent_rpcs.list_channel_connections if parent_rpcs.respond_to? :list_channel_connections
1957
+ @list_channel_connections = ::Gapic::Config::Method.new list_channel_connections_config
1958
+ create_channel_connection_config = parent_rpcs.create_channel_connection if parent_rpcs.respond_to? :create_channel_connection
1959
+ @create_channel_connection = ::Gapic::Config::Method.new create_channel_connection_config
1960
+ delete_channel_connection_config = parent_rpcs.delete_channel_connection if parent_rpcs.respond_to? :delete_channel_connection
1961
+ @delete_channel_connection = ::Gapic::Config::Method.new delete_channel_connection_config
830
1962
 
831
1963
  yield self if block_given?
832
1964
  end