diff --git a/google-cloud-data_fusion-v1/google-cloud-data_fusion-v1.gemspec b/google-cloud-data_fusion-v1/google-cloud-data_fusion-v1.gemspec index 2d5c1a47c179..109b6cfec29e 100644 --- a/google-cloud-data_fusion-v1/google-cloud-data_fusion-v1.gemspec +++ b/google-cloud-data_fusion-v1/google-cloud-data_fusion-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/client.rb b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/client.rb index 91ce91707816..ae77b68bbef3 100644 --- a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/client.rb +++ b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/client.rb @@ -148,7 +148,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -958,6 +959,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DataFusion API. # diff --git a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/operations.rb b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/operations.rb index fd68f640f516..35f41f3a7057 100644 --- a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/operations.rb +++ b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/client.rb b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/client.rb index be4bf2f05e6a..e6539d0b876c 100644 --- a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/client.rb +++ b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/client.rb @@ -190,6 +190,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::ListAvailableVersionsRequest.new + # + # # Call the list_available_versions method. + # result = client.list_available_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataFusion::V1::Version. + # p item + # end + # def list_available_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -265,6 +285,26 @@ def list_available_versions request, options = nil # @return [::Google::Cloud::DataFusion::V1::ListInstancesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_instances request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DataFusion::V1::Instance. + # p item + # end + # def list_instances request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -328,6 +368,22 @@ def list_instances request, options = nil # @return [::Google::Cloud::DataFusion::V1::Instance] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::DataFusion::V1::Instance. + # p result + # def get_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -395,6 +451,29 @@ def get_instance request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::CreateInstanceRequest.new + # + # # Call the create_instance method. + # result = client.create_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -459,6 +538,29 @@ def create_instance request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -531,6 +633,29 @@ def delete_instance request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::UpdateInstanceRequest.new + # + # # Call the update_instance method. + # result = client.update_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -596,6 +721,29 @@ def update_instance request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/data_fusion/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataFusion::V1::RestartInstanceRequest.new + # + # # Call the restart_instance method. + # result = client.restart_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def restart_instance request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/operations.rb b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/operations.rb index a5ca7f1b2a59..35a67c76f550 100644 --- a/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/operations.rb +++ b/google-cloud-data_fusion-v1/lib/google/cloud/data_fusion/v1/data_fusion/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-data_labeling-v1beta1/google-cloud-data_labeling-v1beta1.gemspec b/google-cloud-data_labeling-v1beta1/google-cloud-data_labeling-v1beta1.gemspec index 8615f3c7d696..47a2d4bd75d2 100644 --- a/google-cloud-data_labeling-v1beta1/google-cloud-data_labeling-v1beta1.gemspec +++ b/google-cloud-data_labeling-v1beta1/google-cloud-data_labeling-v1beta1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb b/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb index 3020d3ae8fe7..3c2300b6ce93 100644 --- a/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb +++ b/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/client.rb @@ -273,7 +273,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -3685,6 +3686,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DataLabelingService API. # diff --git a/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/operations.rb b/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/operations.rb index 8aec377a010a..83b5c058d420 100644 --- a/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/operations.rb +++ b/google-cloud-data_labeling-v1beta1/lib/google/cloud/data_labeling/v1beta1/data_labeling_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataflow-v1beta3/google-cloud-dataflow-v1beta3.gemspec b/google-cloud-dataflow-v1beta3/google-cloud-dataflow-v1beta3.gemspec index 7817e710ad50..43d9dacfb8af 100644 --- a/google-cloud-dataflow-v1beta3/google-cloud-dataflow-v1beta3.gemspec +++ b/google-cloud-dataflow-v1beta3/google-cloud-dataflow-v1beta3.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb index b772cc6e5cc6..9fd99fe27a8e 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/client.rb @@ -136,7 +136,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -358,6 +359,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the FlexTemplatesService API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb index 870deff7c5c2..1946a92521a9 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/flex_templates_service/rest/client.rb @@ -169,6 +169,22 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest.new + # + # # Call the launch_flex_template method. + # result = client.launch_flex_template request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse. + # p result + # def launch_flex_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/client.rb index e3d3a1ed6d71..6ba240c28a23 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/client.rb @@ -139,7 +139,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -979,6 +980,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Jobs API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb index ea55dd47864f..c7ba738ddbce 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/jobs/rest/client.rb @@ -179,6 +179,22 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + # p result + # def create_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -255,6 +271,22 @@ def create_job request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + # p result + # def get_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -332,6 +364,22 @@ def get_job request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + # p result + # def update_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -417,6 +465,26 @@ def update_job request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. + # p item + # end + # def list_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -495,6 +563,26 @@ def list_jobs request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::ListJobsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new + # + # # Call the aggregated_list_jobs method. + # result = client.aggregated_list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. + # p item + # end + # def aggregated_list_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -567,6 +655,22 @@ def aggregated_list_jobs request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::Snapshot] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Jobs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new + # + # # Call the snapshot_job method. + # result = client.snapshot_job request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. + # p result + # def snapshot_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/client.rb index 563feec345e3..6c1cc72a0766 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/client.rb @@ -139,7 +139,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -388,6 +389,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Messages API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb index 332e2ab0735b..64c8c46294b7 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/messages/rest/client.rb @@ -191,6 +191,26 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::ListJobMessagesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Messages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::ListJobMessagesRequest.new + # + # # Call the list_job_messages method. + # result = client.list_job_messages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataflow::V1beta3::JobMessage. + # p item + # end + # def list_job_messages request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/client.rb index 8c9c1dc1b67e..9f04fa413add 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/client.rb @@ -139,7 +139,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -604,6 +605,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Metrics API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb index 81536c3ed4d5..d229ed1260b5 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/metrics/rest/client.rb @@ -178,6 +178,22 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::JobMetrics] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Metrics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetJobMetricsRequest.new + # + # # Call the get_job_metrics method. + # result = client.get_job_metrics request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::JobMetrics. + # p result + # def get_job_metrics request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -256,6 +272,26 @@ def get_job_metrics request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::StageSummary>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Metrics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetJobExecutionDetailsRequest.new + # + # # Call the get_job_execution_details method. + # result = client.get_job_execution_details request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataflow::V1beta3::StageSummary. + # p item + # end + # def get_job_execution_details request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -342,6 +378,26 @@ def get_job_execution_details request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::WorkerDetails>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Metrics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetStageExecutionDetailsRequest.new + # + # # Call the get_stage_execution_details method. + # result = client.get_stage_execution_details request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataflow::V1beta3::WorkerDetails. + # p item + # end + # def get_stage_execution_details request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb index be9c24561bbf..7edc195d03eb 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/client.rb @@ -138,7 +138,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -548,6 +549,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Snapshots API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb index 8da04c94d77e..3a7ebf6df7f4 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/snapshots/rest/client.rb @@ -166,6 +166,22 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::Snapshot] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Snapshots::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest.new + # + # # Call the get_snapshot method. + # result = client.get_snapshot request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. + # p result + # def get_snapshot request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -232,6 +248,22 @@ def get_snapshot request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Snapshots::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest.new + # + # # Call the delete_snapshot method. + # result = client.delete_snapshot request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse. + # p result + # def delete_snapshot request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -298,6 +330,22 @@ def delete_snapshot request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::Snapshots::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest.new + # + # # Call the list_snapshots method. + # result = client.list_snapshots request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse. + # p result + # def list_snapshots request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb index 5a0a1c41f988..eeb743c954e3 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/client.rb @@ -138,7 +138,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -567,6 +568,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the TemplatesService API. # diff --git a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb index d1f72af37ee5..9d6053e0374d 100644 --- a/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb +++ b/google-cloud-dataflow-v1beta3/lib/google/cloud/dataflow/v1beta3/templates_service/rest/client.rb @@ -176,6 +176,22 @@ def initialize # @return [::Google::Cloud::Dataflow::V1beta3::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest.new + # + # # Call the create_job_from_template method. + # result = client.create_job_from_template request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + # p result + # def create_job_from_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -254,6 +270,22 @@ def create_job_from_template request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest.new + # + # # Call the launch_template method. + # result = client.launch_template request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse. + # p result + # def launch_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -326,6 +358,22 @@ def launch_template request, options = nil # @return [::Google::Cloud::Dataflow::V1beta3::GetTemplateResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataflow/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataflow::V1beta3::GetTemplateRequest.new + # + # # Call the get_template method. + # result = client.get_template request + # + # # The returned object is of type Google::Cloud::Dataflow::V1beta3::GetTemplateResponse. + # p result + # def get_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataform-v1beta1/google-cloud-dataform-v1beta1.gemspec b/google-cloud-dataform-v1beta1/google-cloud-dataform-v1beta1.gemspec index 1a933ca0c139..b550f3fa0968 100644 --- a/google-cloud-dataform-v1beta1/google-cloud-dataform-v1beta1.gemspec +++ b/google-cloud-dataform-v1beta1/google-cloud-dataform-v1beta1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" gem.add_dependency "google-iam-v1", ">= 0.4", "< 2.a" diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb index 40bd31dfad75..74b8fe0658cd 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/client.rb @@ -153,7 +153,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -3559,6 +3560,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Dataform API. # diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb index cc2dc1b1c27f..18a06290e419 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/dataform/rest/client.rb @@ -209,6 +209,26 @@ def initialize # @return [::Google::Cloud::Dataform::V1beta1::ListRepositoriesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ListRepositoriesRequest.new + # + # # Call the list_repositories method. + # result = client.list_repositories request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::Repository. + # p item + # end + # def list_repositories request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -271,6 +291,22 @@ def list_repositories request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::Repository] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::GetRepositoryRequest.new + # + # # Call the get_repository method. + # result = client.get_repository request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + # p result + # def get_repository request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +375,22 @@ def get_repository request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::Repository] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CreateRepositoryRequest.new + # + # # Call the create_repository method. + # result = client.create_repository request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + # p result + # def create_repository request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -404,6 +456,22 @@ def create_repository request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::Repository] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::UpdateRepositoryRequest.new + # + # # Call the update_repository method. + # result = client.update_repository request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + # p result + # def update_repository request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -470,6 +538,22 @@ def update_repository request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::DeleteRepositoryRequest.new + # + # # Call the delete_repository method. + # result = client.delete_repository request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_repository request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -532,6 +616,22 @@ def delete_repository request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesRequest.new + # + # # Call the fetch_remote_branches method. + # result = client.fetch_remote_branches request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesResponse. + # p result + # def fetch_remote_branches request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -611,6 +711,26 @@ def fetch_remote_branches request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::ListWorkspacesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ListWorkspacesRequest.new + # + # # Call the list_workspaces method. + # result = client.list_workspaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::Workspace. + # p item + # end + # def list_workspaces request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -673,6 +793,22 @@ def list_workspaces request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::Workspace] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::GetWorkspaceRequest.new + # + # # Call the get_workspace method. + # result = client.get_workspace request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. + # p result + # def get_workspace request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -741,6 +877,22 @@ def get_workspace request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::Workspace] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CreateWorkspaceRequest.new + # + # # Call the create_workspace method. + # result = client.create_workspace request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. + # p result + # def create_workspace request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -803,6 +955,22 @@ def create_workspace request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::DeleteWorkspaceRequest.new + # + # # Call the delete_workspace method. + # result = client.delete_workspace request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_workspace request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -865,6 +1033,22 @@ def delete_workspace request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::InstallNpmPackagesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::InstallNpmPackagesRequest.new + # + # # Call the install_npm_packages method. + # result = client.install_npm_packages request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::InstallNpmPackagesResponse. + # p result + # def install_npm_packages request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -933,6 +1117,22 @@ def install_npm_packages request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::PullGitCommitsRequest.new + # + # # Call the pull_git_commits method. + # result = client.pull_git_commits request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def pull_git_commits request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -998,6 +1198,22 @@ def pull_git_commits request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::PushGitCommitsRequest.new + # + # # Call the push_git_commits method. + # result = client.push_git_commits request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def push_git_commits request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1060,6 +1276,22 @@ def push_git_commits request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesRequest.new + # + # # Call the fetch_file_git_statuses method. + # result = client.fetch_file_git_statuses request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesResponse. + # p result + # def fetch_file_git_statuses request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1126,6 +1358,22 @@ def fetch_file_git_statuses request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindRequest.new + # + # # Call the fetch_git_ahead_behind method. + # result = client.fetch_git_ahead_behind request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindResponse. + # p result + # def fetch_git_ahead_behind request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1195,6 +1443,22 @@ def fetch_git_ahead_behind request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CommitWorkspaceChangesRequest.new + # + # # Call the commit_workspace_changes method. + # result = client.commit_workspace_changes request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def commit_workspace_changes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1262,6 +1526,22 @@ def commit_workspace_changes request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ResetWorkspaceChangesRequest.new + # + # # Call the reset_workspace_changes method. + # result = client.reset_workspace_changes request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def reset_workspace_changes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1326,6 +1606,22 @@ def reset_workspace_changes request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::FetchFileDiffResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::FetchFileDiffRequest.new + # + # # Call the fetch_file_diff method. + # result = client.fetch_file_diff request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileDiffResponse. + # p result + # def fetch_file_diff request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1402,6 +1698,26 @@ def fetch_file_diff request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsResponse::DirectoryEntry>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsRequest.new + # + # # Call the query_directory_contents method. + # result = client.query_directory_contents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsResponse::DirectoryEntry. + # p item + # end + # def query_directory_contents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1468,6 +1784,22 @@ def query_directory_contents request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::MakeDirectoryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::MakeDirectoryRequest.new + # + # # Call the make_directory method. + # result = client.make_directory request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::MakeDirectoryResponse. + # p result + # def make_directory request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1533,6 +1865,22 @@ def make_directory request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::RemoveDirectoryRequest.new + # + # # Call the remove_directory method. + # result = client.remove_directory request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def remove_directory request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1602,6 +1950,22 @@ def remove_directory request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::MoveDirectoryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::MoveDirectoryRequest.new + # + # # Call the move_directory method. + # result = client.move_directory request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::MoveDirectoryResponse. + # p result + # def move_directory request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1666,6 +2030,22 @@ def move_directory request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::ReadFileResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ReadFileRequest.new + # + # # Call the read_file method. + # result = client.read_file request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::ReadFileResponse. + # p result + # def read_file request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1730,6 +2110,22 @@ def read_file request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::RemoveFileRequest.new + # + # # Call the remove_file method. + # result = client.remove_file request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def remove_file request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1796,6 +2192,22 @@ def remove_file request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::MoveFileResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::MoveFileRequest.new + # + # # Call the move_file method. + # result = client.move_file request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::MoveFileResponse. + # p result + # def move_file request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1862,6 +2274,22 @@ def move_file request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::WriteFileResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::WriteFileRequest.new + # + # # Call the write_file method. + # result = client.write_file request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::WriteFileResponse. + # p result + # def write_file request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1935,6 +2363,26 @@ def write_file request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::ListCompilationResultsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ListCompilationResultsRequest.new + # + # # Call the list_compilation_results method. + # result = client.list_compilation_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResult. + # p item + # end + # def list_compilation_results request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1997,6 +2445,22 @@ def list_compilation_results request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::CompilationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::GetCompilationResultRequest.new + # + # # Call the get_compilation_result method. + # result = client.get_compilation_result request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. + # p result + # def get_compilation_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2062,6 +2526,22 @@ def get_compilation_result request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::CompilationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CreateCompilationResultRequest.new + # + # # Call the create_compilation_result method. + # result = client.create_compilation_result request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. + # p result + # def create_compilation_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2138,6 +2618,26 @@ def create_compilation_result request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataform::V1beta1::CompilationResultAction>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::QueryCompilationResultActionsRequest.new + # + # # Call the query_compilation_result_actions method. + # result = client.query_compilation_result_actions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResultAction. + # p item + # end + # def query_compilation_result_actions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2212,6 +2712,26 @@ def query_compilation_result_actions request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::ListWorkflowInvocationsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::ListWorkflowInvocationsRequest.new + # + # # Call the list_workflow_invocations method. + # result = client.list_workflow_invocations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + # p item + # end + # def list_workflow_invocations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2274,6 +2794,22 @@ def list_workflow_invocations request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::WorkflowInvocation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::GetWorkflowInvocationRequest.new + # + # # Call the get_workflow_invocation method. + # result = client.get_workflow_invocation request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + # p result + # def get_workflow_invocation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2339,6 +2875,22 @@ def get_workflow_invocation request, options = nil # @return [::Google::Cloud::Dataform::V1beta1::WorkflowInvocation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CreateWorkflowInvocationRequest.new + # + # # Call the create_workflow_invocation method. + # result = client.create_workflow_invocation request + # + # # The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + # p result + # def create_workflow_invocation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2401,6 +2953,22 @@ def create_workflow_invocation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::DeleteWorkflowInvocationRequest.new + # + # # Call the delete_workflow_invocation method. + # result = client.delete_workflow_invocation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_workflow_invocation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2463,6 +3031,22 @@ def delete_workflow_invocation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::CancelWorkflowInvocationRequest.new + # + # # Call the cancel_workflow_invocation method. + # result = client.cancel_workflow_invocation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_workflow_invocation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2536,6 +3120,26 @@ def cancel_workflow_invocation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataform::V1beta1::WorkflowInvocationAction>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataform/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataform::V1beta1::Dataform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataform::V1beta1::QueryWorkflowInvocationActionsRequest.new + # + # # Call the query_workflow_invocation_actions method. + # result = client.query_workflow_invocation_actions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocationAction. + # p item + # end + # def query_workflow_invocation_actions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/google-cloud-dataplex-v1.gemspec b/google-cloud-dataplex-v1/google-cloud-dataplex-v1.gemspec index 5c42e842010e..f2116256e738 100644 --- a/google-cloud-dataplex-v1/google-cloud-dataplex-v1.gemspec +++ b/google-cloud-dataplex-v1/google-cloud-dataplex-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" gem.add_dependency "google-iam-v1", ">= 0.4", "< 2.a" diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb index 35f2b798e9c8..a0b99b869548 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/client.rb @@ -180,7 +180,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1080,6 +1081,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ContentService API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb index 33c0534574fd..8e6fd447da01 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/content_service/rest/client.rb @@ -226,6 +226,22 @@ def initialize # @return [::Google::Cloud::Dataplex::V1::Content] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateContentRequest.new + # + # # Call the create_content method. + # result = client.create_content request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Content. + # p result + # def create_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -294,6 +310,22 @@ def create_content request, options = nil # @return [::Google::Cloud::Dataplex::V1::Content] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateContentRequest.new + # + # # Call the update_content method. + # result = client.update_content request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Content. + # p result + # def update_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -357,6 +389,22 @@ def update_content request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteContentRequest.new + # + # # Call the delete_content method. + # result = client.delete_content request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -422,6 +470,22 @@ def delete_content request, options = nil # @return [::Google::Cloud::Dataplex::V1::Content] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetContentRequest.new + # + # # Call the get_content method. + # result = client.get_content request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Content. + # p result + # def get_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -493,6 +557,22 @@ def get_content request, options = nil # @return [::Google::Iam::V1::Policy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # def get_iam_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -571,6 +651,22 @@ def get_iam_policy request, options = nil # @return [::Google::Iam::V1::Policy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # def set_iam_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -648,6 +744,22 @@ def set_iam_policy request, options = nil # @return [::Google::Iam::V1::TestIamPermissionsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # def test_iam_permissions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -730,6 +842,26 @@ def test_iam_permissions request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Content>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::ContentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListContentRequest.new + # + # # Call the list_content method. + # result = client.list_content request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Content. + # p item + # end + # def list_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb index f6475248dd1e..15fd5f605212 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/client.rb @@ -160,7 +160,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1109,6 +1110,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DataScanService API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/operations.rb index ce70192fd73a..950f83010b9e 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb index 8bedcf873524..f87993ea7876 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/client.rb @@ -223,6 +223,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateDataScanRequest.new + # + # # Call the create_data_scan method. + # result = client.create_data_scan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_data_scan request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -293,6 +316,29 @@ def create_data_scan request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateDataScanRequest.new + # + # # Call the update_data_scan method. + # result = client.update_data_scan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_data_scan request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -359,6 +405,29 @@ def update_data_scan request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteDataScanRequest.new + # + # # Call the delete_data_scan method. + # result = client.delete_data_scan request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_data_scan request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -427,6 +496,22 @@ def delete_data_scan request, options = nil # @return [::Google::Cloud::Dataplex::V1::DataScan] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetDataScanRequest.new + # + # # Call the get_data_scan method. + # result = client.get_data_scan request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::DataScan. + # p result + # def get_data_scan request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -506,6 +591,26 @@ def get_data_scan request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListDataScansResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListDataScansRequest.new + # + # # Call the list_data_scans method. + # result = client.list_data_scans request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::DataScan. + # p item + # end + # def list_data_scans request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -573,6 +678,22 @@ def list_data_scans request, options = nil # @return [::Google::Cloud::Dataplex::V1::RunDataScanResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::RunDataScanRequest.new + # + # # Call the run_data_scan method. + # result = client.run_data_scan request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::RunDataScanResponse. + # p result + # def run_data_scan request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -640,6 +761,22 @@ def run_data_scan request, options = nil # @return [::Google::Cloud::Dataplex::V1::DataScanJob] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetDataScanJobRequest.new + # + # # Call the get_data_scan_job method. + # result = client.get_data_scan_job request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::DataScanJob. + # p result + # def get_data_scan_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -733,6 +870,26 @@ def get_data_scan_job request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::DataScanJob>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataScanService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListDataScanJobsRequest.new + # + # # Call the list_data_scan_jobs method. + # result = client.list_data_scan_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::DataScanJob. + # p item + # end + # def list_data_scan_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/operations.rb index 49ecfa585ad6..c798a6e3532a 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_scan_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb index c1d9840b8cee..4fd437b6d2e9 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/client.rb @@ -159,7 +159,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1792,6 +1793,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DataTaxonomyService API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/operations.rb index a7ebb5c33965..e80a228bb98f 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb index 3a3853f63a78..6f421e51c296 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/client.rb @@ -220,6 +220,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateDataTaxonomyRequest.new + # + # # Call the create_data_taxonomy method. + # result = client.create_data_taxonomy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_data_taxonomy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -288,6 +311,29 @@ def create_data_taxonomy request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateDataTaxonomyRequest.new + # + # # Call the update_data_taxonomy method. + # result = client.update_data_taxonomy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_data_taxonomy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -356,6 +402,29 @@ def update_data_taxonomy request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteDataTaxonomyRequest.new + # + # # Call the delete_data_taxonomy method. + # result = client.delete_data_taxonomy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_data_taxonomy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -435,6 +504,26 @@ def delete_data_taxonomy request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListDataTaxonomiesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListDataTaxonomiesRequest.new + # + # # Call the list_data_taxonomies method. + # result = client.list_data_taxonomies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::DataTaxonomy. + # p item + # end + # def list_data_taxonomies request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -498,6 +587,22 @@ def list_data_taxonomies request, options = nil # @return [::Google::Cloud::Dataplex::V1::DataTaxonomy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetDataTaxonomyRequest.new + # + # # Call the get_data_taxonomy method. + # result = client.get_data_taxonomy request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::DataTaxonomy. + # p result + # def get_data_taxonomy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -573,6 +678,29 @@ def get_data_taxonomy request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateDataAttributeBindingRequest.new + # + # # Call the create_data_attribute_binding method. + # result = client.create_data_attribute_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_data_attribute_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -641,6 +769,29 @@ def create_data_attribute_binding request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateDataAttributeBindingRequest.new + # + # # Call the update_data_attribute_binding method. + # result = client.update_data_attribute_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_data_attribute_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -712,6 +863,29 @@ def update_data_attribute_binding request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteDataAttributeBindingRequest.new + # + # # Call the delete_data_attribute_binding method. + # result = client.delete_data_attribute_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_data_attribute_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -794,6 +968,26 @@ def delete_data_attribute_binding request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListDataAttributeBindingsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListDataAttributeBindingsRequest.new + # + # # Call the list_data_attribute_bindings method. + # result = client.list_data_attribute_bindings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::DataAttributeBinding. + # p item + # end + # def list_data_attribute_bindings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -857,6 +1051,22 @@ def list_data_attribute_bindings request, options = nil # @return [::Google::Cloud::Dataplex::V1::DataAttributeBinding] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetDataAttributeBindingRequest.new + # + # # Call the get_data_attribute_binding method. + # result = client.get_data_attribute_binding request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::DataAttributeBinding. + # p result + # def get_data_attribute_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -932,6 +1142,29 @@ def get_data_attribute_binding request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateDataAttributeRequest.new + # + # # Call the create_data_attribute method. + # result = client.create_data_attribute request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_data_attribute request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1000,6 +1233,29 @@ def create_data_attribute request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateDataAttributeRequest.new + # + # # Call the update_data_attribute method. + # result = client.update_data_attribute request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_data_attribute request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1067,6 +1323,29 @@ def update_data_attribute request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteDataAttributeRequest.new + # + # # Call the delete_data_attribute method. + # result = client.delete_data_attribute request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_data_attribute request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1145,6 +1424,26 @@ def delete_data_attribute request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListDataAttributesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListDataAttributesRequest.new + # + # # Call the list_data_attributes method. + # result = client.list_data_attributes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::DataAttribute. + # p item + # end + # def list_data_attributes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1208,6 +1507,22 @@ def list_data_attributes request, options = nil # @return [::Google::Cloud::Dataplex::V1::DataAttribute] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataTaxonomyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetDataAttributeRequest.new + # + # # Call the get_data_attribute method. + # result = client.get_data_attribute request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::DataAttribute. + # p result + # def get_data_attribute request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/operations.rb index 7f7b9c3f42d9..bc24238c4eef 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/data_taxonomy_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb index 805f3c34be2a..3d7c5190ff7a 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/client.rb @@ -269,7 +269,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -3650,6 +3651,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DataplexService API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/operations.rb index 33bf18ce1835..defe1e4952d5 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb index 343eed5e7635..b0e9efe9a83b 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/client.rb @@ -332,6 +332,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateLakeRequest.new + # + # # Call the create_lake method. + # result = client.create_lake request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_lake request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -401,6 +424,29 @@ def create_lake request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateLakeRequest.new + # + # # Call the update_lake method. + # result = client.update_lake request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_lake request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -466,6 +512,29 @@ def update_lake request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteLakeRequest.new + # + # # Call the delete_lake method. + # result = client.delete_lake request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_lake request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -543,6 +612,26 @@ def delete_lake request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListLakesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListLakesRequest.new + # + # # Call the list_lakes method. + # result = client.list_lakes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Lake. + # p item + # end + # def list_lakes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -606,6 +695,22 @@ def list_lakes request, options = nil # @return [::Google::Cloud::Dataplex::V1::Lake] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetLakeRequest.new + # + # # Call the get_lake method. + # result = client.get_lake request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Lake. + # p result + # def get_lake request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -678,6 +783,26 @@ def get_lake request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Action>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListLakeActionsRequest.new + # + # # Call the list_lake_actions method. + # result = client.list_lake_actions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + # p item + # end + # def list_lake_actions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -757,6 +882,29 @@ def list_lake_actions request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateZoneRequest.new + # + # # Call the create_zone method. + # result = client.create_zone request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_zone request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -826,6 +974,29 @@ def create_zone request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateZoneRequest.new + # + # # Call the update_zone method. + # result = client.update_zone request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_zone request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -891,6 +1062,29 @@ def update_zone request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteZoneRequest.new + # + # # Call the delete_zone method. + # result = client.delete_zone request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_zone request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -967,6 +1161,26 @@ def delete_zone request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Zone>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListZonesRequest.new + # + # # Call the list_zones method. + # result = client.list_zones request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Zone. + # p item + # end + # def list_zones request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1031,6 +1245,22 @@ def list_zones request, options = nil # @return [::Google::Cloud::Dataplex::V1::Zone] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetZoneRequest.new + # + # # Call the get_zone method. + # result = client.get_zone request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Zone. + # p result + # def get_zone request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1103,6 +1333,26 @@ def get_zone request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Action>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListZoneActionsRequest.new + # + # # Call the list_zone_actions method. + # result = client.list_zone_actions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + # p item + # end + # def list_zone_actions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1181,6 +1431,29 @@ def list_zone_actions request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateAssetRequest.new + # + # # Call the create_asset method. + # result = client.create_asset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_asset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1250,6 +1523,29 @@ def create_asset request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateAssetRequest.new + # + # # Call the update_asset method. + # result = client.update_asset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_asset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1315,6 +1611,29 @@ def update_asset request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteAssetRequest.new + # + # # Call the delete_asset method. + # result = client.delete_asset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_asset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1392,6 +1711,26 @@ def delete_asset request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Asset>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Asset. + # p item + # end + # def list_assets request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1456,6 +1795,22 @@ def list_assets request, options = nil # @return [::Google::Cloud::Dataplex::V1::Asset] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetAssetRequest.new + # + # # Call the get_asset method. + # result = client.get_asset request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Asset. + # p result + # def get_asset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1528,6 +1883,26 @@ def get_asset request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Action>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListAssetActionsRequest.new + # + # # Call the list_asset_actions method. + # result = client.list_asset_actions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + # p item + # end + # def list_asset_actions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1599,6 +1974,29 @@ def list_asset_actions request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_task request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1668,6 +2066,29 @@ def create_task request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateTaskRequest.new + # + # # Call the update_task method. + # result = client.update_task request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_task request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1732,6 +2153,29 @@ def update_task request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_task request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1808,6 +2252,26 @@ def delete_task request, options = nil # @return [::Google::Cloud::Dataplex::V1::ListTasksResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Task. + # p item + # end + # def list_tasks request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1871,6 +2335,22 @@ def list_tasks request, options = nil # @return [::Google::Cloud::Dataplex::V1::Task] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Task. + # p result + # def get_task request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1943,6 +2423,26 @@ def get_task request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Job>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Job. + # p item + # end + # def list_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2023,6 +2523,22 @@ def list_jobs request, options = nil # @return [::Google::Cloud::Dataplex::V1::RunTaskResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::RunTaskResponse. + # p result + # def run_task request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2086,6 +2602,22 @@ def run_task request, options = nil # @return [::Google::Cloud::Dataplex::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Job. + # p result + # def get_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2149,6 +2681,22 @@ def get_job request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2224,6 +2772,29 @@ def cancel_job request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2293,6 +2864,29 @@ def create_environment request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2358,6 +2952,29 @@ def update_environment request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteEnvironmentRequest.new + # + # # Call the delete_environment method. + # result = client.delete_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2436,6 +3053,26 @@ def delete_environment request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Environment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListEnvironmentsRequest.new + # + # # Call the list_environments method. + # result = client.list_environments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Environment. + # p item + # end + # def list_environments request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2500,6 +3137,22 @@ def list_environments request, options = nil # @return [::Google::Cloud::Dataplex::V1::Environment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Environment. + # p result + # def get_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2582,6 +3235,26 @@ def get_environment request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Session>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::DataplexService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Session. + # p item + # end + # def list_sessions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/operations.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/operations.rb index bac3c9e8b26f..6c488bd27650 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/operations.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/dataplex_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb index 2f3cb7228cfe..c82e6bfebdb1 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/client.rb @@ -183,7 +183,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1182,6 +1183,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the MetadataService API. # diff --git a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb index 2651d626b4b4..50cb9729fcbb 100644 --- a/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb +++ b/google-cloud-dataplex-v1/lib/google/cloud/dataplex/v1/metadata_service/rest/client.rb @@ -229,6 +229,22 @@ def initialize # @return [::Google::Cloud::Dataplex::V1::Entity] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreateEntityRequest.new + # + # # Call the create_entity method. + # result = client.create_entity request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + # p result + # def create_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -294,6 +310,22 @@ def create_entity request, options = nil # @return [::Google::Cloud::Dataplex::V1::Entity] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::UpdateEntityRequest.new + # + # # Call the update_entity method. + # result = client.update_entity request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + # p result + # def update_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -360,6 +392,22 @@ def update_entity request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeleteEntityRequest.new + # + # # Call the delete_entity method. + # result = client.delete_entity request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -426,6 +474,22 @@ def delete_entity request, options = nil # @return [::Google::Cloud::Dataplex::V1::Entity] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetEntityRequest.new + # + # # Call the get_entity method. + # result = client.get_entity request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + # p result + # def get_entity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -510,6 +574,26 @@ def get_entity request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Entity>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListEntitiesRequest.new + # + # # Call the list_entities method. + # result = client.list_entities request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Entity. + # p item + # end + # def list_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -579,6 +663,22 @@ def list_entities request, options = nil # @return [::Google::Cloud::Dataplex::V1::Partition] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::CreatePartitionRequest.new + # + # # Call the create_partition method. + # result = client.create_partition request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Partition. + # p result + # def create_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -647,6 +747,22 @@ def create_partition request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::DeletePartitionRequest.new + # + # # Call the delete_partition method. + # result = client.delete_partition request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -712,6 +828,22 @@ def delete_partition request, options = nil # @return [::Google::Cloud::Dataplex::V1::Partition] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::GetPartitionRequest.new + # + # # Call the get_partition method. + # result = client.get_partition request + # + # # The returned object is of type Google::Cloud::Dataplex::V1::Partition. + # p result + # def get_partition request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -805,6 +937,26 @@ def get_partition request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataplex::V1::Partition>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataplex/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataplex::V1::MetadataService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataplex::V1::ListPartitionsRequest.new + # + # # Call the list_partitions method. + # result = client.list_partitions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataplex::V1::Partition. + # p item + # end + # def list_partitions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec b/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec index 82976d2846c9..1709ad559b6d 100644 --- a/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec +++ b/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-iam-v1", ">= 0.4", "< 2.a" diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb index c7821e597d5e..b4244f14a9e1 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb @@ -165,7 +165,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -775,6 +776,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the AutoscalingPolicyService API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb index b1e741b7868f..0df917091712 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb @@ -208,6 +208,22 @@ def initialize # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new + # + # # Call the create_autoscaling_policy method. + # result = client.create_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # def create_autoscaling_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -273,6 +289,22 @@ def create_autoscaling_policy request, options = nil # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new + # + # # Call the update_autoscaling_policy method. + # result = client.update_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # def update_autoscaling_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -344,6 +376,22 @@ def update_autoscaling_policy request, options = nil # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new + # + # # Call the get_autoscaling_policy method. + # result = client.get_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # def get_autoscaling_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -421,6 +469,26 @@ def get_autoscaling_policy request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new + # + # # Call the list_autoscaling_policies method. + # result = client.list_autoscaling_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p item + # end + # def list_autoscaling_policies request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -494,6 +562,22 @@ def list_autoscaling_policies request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new + # + # # Call the delete_autoscaling_policy method. + # result = client.delete_autoscaling_policy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_autoscaling_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb index 239b83c6b8d2..a1d95a87caa8 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -695,6 +696,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the BatchController API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb index 4bfffdf581dd..668424fb5858 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb index e8aef6bc9b02..971b2a633e7f 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb @@ -210,6 +210,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new + # + # # Call the create_batch method. + # result = client.create_batch request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_batch request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -275,6 +298,22 @@ def create_batch request, options = nil # @return [::Google::Cloud::Dataproc::V1::Batch] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new + # + # # Call the get_batch method. + # result = client.get_batch request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Batch. + # p result + # def get_batch request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -364,6 +403,26 @@ def get_batch request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new + # + # # Call the list_batches method. + # result = client.list_batches request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. + # p item + # end + # def list_batches request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -430,6 +489,22 @@ def list_batches request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new + # + # # Call the delete_batch method. + # result = client.delete_batch request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_batch request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb index 56f7714918cb..b0c2c339c752 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb index 93e6211a833c..9049ed2d5b3d 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb @@ -182,7 +182,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1313,6 +1314,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ClusterController API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb index 20dfa235c90a..976b2621bfb3 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb index 312b43ecf390..fd893d1aea7b 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb @@ -243,6 +243,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -393,6 +416,29 @@ def create_cluster request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -477,6 +523,29 @@ def update_cluster request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new + # + # # Call the stop_cluster method. + # result = client.stop_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def stop_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -561,6 +630,29 @@ def stop_cluster request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new + # + # # Call the start_cluster method. + # result = client.start_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def start_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -647,6 +739,29 @@ def start_cluster request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -715,6 +830,22 @@ def delete_cluster request, options = nil # @return [::Google::Cloud::Dataproc::V1::Cluster] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. + # p result + # def get_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -804,6 +935,26 @@ def get_cluster request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. + # p item + # end + # def list_clusters request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -878,6 +1029,29 @@ def list_clusters request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new + # + # # Call the diagnose_cluster method. + # result = client.diagnose_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def diagnose_cluster request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb index 4842d596bfd1..9118ce494960 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb index 70aa54685d4d..99396d768003 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb @@ -184,7 +184,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1065,6 +1066,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the JobController API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb index 485305dc8606..d09cabc3c677 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb index 0f750c65ca87..552cce12dae5 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb @@ -241,6 +241,22 @@ def initialize # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job method. + # result = client.submit_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def submit_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -321,6 +337,29 @@ def submit_job request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job_as_operation method. + # result = client.submit_job_as_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def submit_job_as_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -389,6 +428,22 @@ def submit_job_as_operation request, options = nil # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def get_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -482,6 +537,26 @@ def get_job request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + # p item + # end + # def list_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -559,6 +634,22 @@ def list_jobs request, options = nil # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def update_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -630,6 +721,22 @@ def update_job request, options = nil # @return [::Google::Cloud::Dataproc::V1::Job] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # def cancel_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -698,6 +805,22 @@ def cancel_job request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb index cb314af4cd69..63ecc8d2bbfb 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb index 307e28e4e273..193c0c52bd29 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb @@ -152,7 +152,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -623,6 +624,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the NodeGroupController API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb index a780531dee6e..9ccaeab603d4 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb index 657e2bf59cd8..27ac8f7760dd 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb @@ -215,6 +215,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new + # + # # Call the create_node_group method. + # result = client.create_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_node_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -312,6 +335,29 @@ def create_node_group request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new + # + # # Call the resize_node_group method. + # result = client.resize_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def resize_node_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -378,6 +424,22 @@ def resize_node_group request, options = nil # @return [::Google::Cloud::Dataproc::V1::NodeGroup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new + # + # # Call the get_node_group method. + # result = client.get_node_group request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. + # p result + # def get_node_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb index 1dd9752a1beb..85a075a7af15 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb index 327d9c632153..adf550b8ed4b 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb @@ -187,7 +187,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1093,6 +1094,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the WorkflowTemplateService API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb index ebf79f16bdc4..1955d6203684 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb index 4ea7eafc6667..65a8c8ad4d57 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb @@ -237,6 +237,22 @@ def initialize # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new + # + # # Call the create_workflow_template method. + # result = client.create_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # def create_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -316,6 +332,22 @@ def create_workflow_template request, options = nil # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new + # + # # Call the get_workflow_template method. + # result = client.get_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # def get_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -426,6 +458,29 @@ def get_workflow_template request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new + # + # # Call the instantiate_workflow_template method. + # result = client.instantiate_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def instantiate_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -534,6 +589,29 @@ def instantiate_workflow_template request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new + # + # # Call the instantiate_inline_workflow_template method. + # result = client.instantiate_inline_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def instantiate_inline_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -600,6 +678,22 @@ def instantiate_inline_workflow_template request, options = nil # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new + # + # # Call the update_workflow_template method. + # result = client.update_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # def update_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -676,6 +770,26 @@ def update_workflow_template request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new + # + # # Call the list_workflow_templates method. + # result = client.list_workflow_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p item + # end + # def list_workflow_templates request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -752,6 +866,22 @@ def list_workflow_templates request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new + # + # # Call the delete_workflow_template method. + # result = client.delete_workflow_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_workflow_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb index d58e14966543..fc9ccd8b8fc9 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dataqna-v1alpha/google-cloud-dataqna-v1alpha.gemspec b/google-cloud-dataqna-v1alpha/google-cloud-dataqna-v1alpha.gemspec index ff32c6f7c79c..8e1c29070e57 100644 --- a/google-cloud-dataqna-v1alpha/google-cloud-dataqna-v1alpha.gemspec +++ b/google-cloud-dataqna-v1alpha/google-cloud-dataqna-v1alpha.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/client.rb b/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/client.rb index 9f36c6cae2bb..5e1633e5bcad 100644 --- a/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/client.rb +++ b/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/auto_suggestion_service/client.rb @@ -205,7 +205,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -432,6 +433,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the AutoSuggestionService API. # diff --git a/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/question_service/client.rb b/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/question_service/client.rb index 594ee62a9427..121a03766e4e 100644 --- a/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/question_service/client.rb +++ b/google-cloud-dataqna-v1alpha/lib/google/cloud/dataqna/v1alpha/question_service/client.rb @@ -163,7 +163,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -730,6 +731,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the QuestionService API. # diff --git a/google-cloud-datastore-admin-v1/google-cloud-datastore-admin-v1.gemspec b/google-cloud-datastore-admin-v1/google-cloud-datastore-admin-v1.gemspec index 2f0bdf05873d..f8967ab14a22 100644 --- a/google-cloud-datastore-admin-v1/google-cloud-datastore-admin-v1.gemspec +++ b/google-cloud-datastore-admin-v1/google-cloud-datastore-admin-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/client.rb b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/client.rb index 623333f7f7c3..9b5de069b883 100644 --- a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/client.rb +++ b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/client.rb @@ -207,7 +207,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -986,6 +987,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DatastoreAdmin API. # diff --git a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/operations.rb b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/operations.rb index d96756cf042c..b0e3e362cc30 100644 --- a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/operations.rb +++ b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/client.rb b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/client.rb index e4ac0d2fc33e..335a8d7ebda7 100644 --- a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/client.rb +++ b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/client.rb @@ -268,6 +268,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new + # + # # Call the export_entities method. + # result = client.export_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -357,6 +380,29 @@ def export_entities request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest.new + # + # # Call the import_entities method. + # result = client.import_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -436,6 +482,29 @@ def import_entities request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_index request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -511,6 +580,29 @@ def create_index request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_index request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -576,6 +668,22 @@ def delete_index request, options = nil # @return [::Google::Cloud::Datastore::Admin::V1::Index] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::Datastore::Admin::V1::Index. + # p result + # def get_index request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -646,6 +754,26 @@ def get_index request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Datastore::Admin::V1::Index>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/admin/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::Admin::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastore::Admin::V1::Index. + # p item + # end + # def list_indexes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/operations.rb b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/operations.rb index 938b3092847b..8a45f279cd3c 100644 --- a/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/operations.rb +++ b/google-cloud-datastore-admin-v1/lib/google/cloud/datastore/admin/v1/datastore_admin/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec b/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec index b62b90968d63..2aac890fc7c1 100644 --- a/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec +++ b/google-cloud-datastore-v1/google-cloud-datastore-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb index 1977da2cf6b5..98ea1754a225 100644 --- a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb +++ b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/client.rb @@ -169,7 +169,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1103,6 +1104,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Datastore API. # diff --git a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb index dec1b9ea2033..a2ff1aa19789 100644 --- a/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb +++ b/google-cloud-datastore-v1/lib/google/cloud/datastore/v1/datastore/rest/client.rb @@ -202,6 +202,22 @@ def initialize # @return [::Google::Cloud::Datastore::V1::LookupResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::LookupRequest.new + # + # # Call the lookup method. + # result = client.lookup request + # + # # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. + # p result + # def lookup request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -280,6 +296,22 @@ def lookup request, options = nil # @return [::Google::Cloud::Datastore::V1::RunQueryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunQueryRequest.new + # + # # Call the run_query method. + # result = client.run_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. + # p result + # def run_query request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -358,6 +390,22 @@ def run_query request, options = nil # @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new + # + # # Call the run_aggregation_query method. + # result = client.run_aggregation_query request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. + # p result + # def run_aggregation_query request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -427,6 +475,22 @@ def run_aggregation_query request, options = nil # @return [::Google::Cloud::Datastore::V1::BeginTransactionResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new + # + # # Call the begin_transaction method. + # result = client.begin_transaction request + # + # # The returned object is of type Google::Cloud::Datastore::V1::BeginTransactionResponse. + # p result + # def begin_transaction request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -520,6 +584,22 @@ def begin_transaction request, options = nil # @return [::Google::Cloud::Datastore::V1::CommitResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::CommitRequest.new + # + # # Call the commit method. + # result = client.commit request + # + # # The returned object is of type Google::Cloud::Datastore::V1::CommitResponse. + # p result + # def commit request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -590,6 +670,22 @@ def commit request, options = nil # @return [::Google::Cloud::Datastore::V1::RollbackResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::RollbackRequest.new + # + # # Call the rollback method. + # result = client.rollback request + # + # # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. + # p result + # def rollback request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -661,6 +757,22 @@ def rollback request, options = nil # @return [::Google::Cloud::Datastore::V1::AllocateIdsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new + # + # # Call the allocate_ids method. + # result = client.allocate_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. + # p result + # def allocate_ids request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -732,6 +844,22 @@ def allocate_ids request, options = nil # @return [::Google::Cloud::Datastore::V1::ReserveIdsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastore/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastore::V1::Datastore::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new + # + # # Call the reserve_ids method. + # result = client.reserve_ids request + # + # # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. + # p result + # def reserve_ids request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastream-v1/google-cloud-datastream-v1.gemspec b/google-cloud-datastream-v1/google-cloud-datastream-v1.gemspec index d35248437185..ef2dee588886 100644 --- a/google-cloud-datastream-v1/google-cloud-datastream-v1.gemspec +++ b/google-cloud-datastream-v1/google-cloud-datastream-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" gem.add_dependency "google-iam-v1", ">= 0.4", "< 2.a" diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb index 0282abcfb4e6..c0bfcae2339e 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/client.rb @@ -183,7 +183,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -2857,6 +2858,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Datastream API. # diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/operations.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/operations.rb index f7fb28b5bfab..6b983bb13dd1 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/operations.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb index 90fc755cbb0d..e4e90a6c99ca 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/client.rb @@ -244,6 +244,26 @@ def initialize # @return [::Google::Cloud::Datastream::V1::ListConnectionProfilesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::ListConnectionProfilesRequest.new + # + # # Call the list_connection_profiles method. + # result = client.list_connection_profiles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1::ConnectionProfile. + # p item + # end + # def list_connection_profiles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -306,6 +326,22 @@ def list_connection_profiles request, options = nil # @return [::Google::Cloud::Datastream::V1::ConnectionProfile] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::GetConnectionProfileRequest.new + # + # # Call the get_connection_profile method. + # result = client.get_connection_profile request + # + # # The returned object is of type Google::Cloud::Datastream::V1::ConnectionProfile. + # p result + # def get_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -391,6 +427,29 @@ def get_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::CreateConnectionProfileRequest.new + # + # # Call the create_connection_profile method. + # result = client.create_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -479,6 +538,29 @@ def create_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest.new + # + # # Call the update_connection_profile method. + # result = client.update_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -556,6 +638,29 @@ def update_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest.new + # + # # Call the delete_connection_profile method. + # result = client.delete_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -638,6 +743,22 @@ def delete_connection_profile request, options = nil # @return [::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest.new + # + # # Call the discover_connection_profile method. + # result = client.discover_connection_profile request + # + # # The returned object is of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse. + # p result + # def discover_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -714,6 +835,26 @@ def discover_connection_profile request, options = nil # @return [::Google::Cloud::Datastream::V1::ListStreamsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::ListStreamsRequest.new + # + # # Call the list_streams method. + # result = client.list_streams request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1::Stream. + # p item + # end + # def list_streams request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -776,6 +917,22 @@ def list_streams request, options = nil # @return [::Google::Cloud::Datastream::V1::Stream] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::GetStreamRequest.new + # + # # Call the get_stream method. + # result = client.get_stream request + # + # # The returned object is of type Google::Cloud::Datastream::V1::Stream. + # p result + # def get_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -861,6 +1018,29 @@ def get_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::CreateStreamRequest.new + # + # # Call the create_stream method. + # result = client.create_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -949,6 +1129,29 @@ def create_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::UpdateStreamRequest.new + # + # # Call the update_stream method. + # result = client.update_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1026,6 +1229,29 @@ def update_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::DeleteStreamRequest.new + # + # # Call the delete_stream method. + # result = client.delete_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1089,6 +1315,22 @@ def delete_stream request, options = nil # @return [::Google::Cloud::Datastream::V1::StreamObject] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::GetStreamObjectRequest.new + # + # # Call the get_stream_object method. + # result = client.get_stream_object request + # + # # The returned object is of type Google::Cloud::Datastream::V1::StreamObject. + # p result + # def get_stream_object request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1153,6 +1395,22 @@ def get_stream_object request, options = nil # @return [::Google::Cloud::Datastream::V1::StreamObject] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::LookupStreamObjectRequest.new + # + # # Call the lookup_stream_object method. + # result = client.lookup_stream_object request + # + # # The returned object is of type Google::Cloud::Datastream::V1::StreamObject. + # p result + # def lookup_stream_object request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1225,6 +1483,26 @@ def lookup_stream_object request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::ListStreamObjectsRequest.new + # + # # Call the list_stream_objects method. + # result = client.list_stream_objects request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1::StreamObject. + # p item + # end + # def list_stream_objects request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1289,6 +1567,22 @@ def list_stream_objects request, options = nil # @return [::Google::Cloud::Datastream::V1::StartBackfillJobResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::StartBackfillJobRequest.new + # + # # Call the start_backfill_job method. + # result = client.start_backfill_job request + # + # # The returned object is of type Google::Cloud::Datastream::V1::StartBackfillJobResponse. + # p result + # def start_backfill_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1352,6 +1646,22 @@ def start_backfill_job request, options = nil # @return [::Google::Cloud::Datastream::V1::StopBackfillJobResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::StopBackfillJobRequest.new + # + # # Call the stop_backfill_job method. + # result = client.stop_backfill_job request + # + # # The returned object is of type Google::Cloud::Datastream::V1::StopBackfillJobResponse. + # p result + # def stop_backfill_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1421,6 +1731,22 @@ def stop_backfill_job request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::String>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::FetchStaticIpsRequest.new + # + # # Call the fetch_static_ips method. + # result = client.fetch_static_ips request + # + # # The returned object is of type Google::Cloud::Datastream::V1::FetchStaticIpsResponse. + # p result + # def fetch_static_ips request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1504,6 +1830,29 @@ def fetch_static_ips request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest.new + # + # # Call the create_private_connection method. + # result = client.create_private_connection request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1567,6 +1916,22 @@ def create_private_connection request, options = nil # @return [::Google::Cloud::Datastream::V1::PrivateConnection] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::GetPrivateConnectionRequest.new + # + # # Call the get_private_connection method. + # result = client.get_private_connection request + # + # # The returned object is of type Google::Cloud::Datastream::V1::PrivateConnection. + # p result + # def get_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1647,6 +2012,26 @@ def get_private_connection request, options = nil # @return [::Google::Cloud::Datastream::V1::ListPrivateConnectionsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest.new + # + # # Call the list_private_connections method. + # result = client.list_private_connections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1::PrivateConnection. + # p item + # end + # def list_private_connections request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1726,6 +2111,29 @@ def list_private_connections request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest.new + # + # # Call the delete_private_connection method. + # result = client.delete_private_connection request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1808,6 +2216,29 @@ def delete_private_connection request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::CreateRouteRequest.new + # + # # Call the create_route method. + # result = client.create_route request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1871,6 +2302,22 @@ def create_route request, options = nil # @return [::Google::Cloud::Datastream::V1::Route] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::GetRouteRequest.new + # + # # Call the get_route method. + # result = client.get_route request + # + # # The returned object is of type Google::Cloud::Datastream::V1::Route. + # p result + # def get_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1950,6 +2397,26 @@ def get_route request, options = nil # @return [::Google::Cloud::Datastream::V1::ListRoutesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::ListRoutesRequest.new + # + # # Call the list_routes method. + # result = client.list_routes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1::Route. + # p item + # end + # def list_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2026,6 +2493,29 @@ def list_routes request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1::DeleteRouteRequest.new + # + # # Call the delete_route method. + # result = client.delete_route request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/operations.rb b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/operations.rb index c081f5edac6e..1d9cfd8199f5 100644 --- a/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/operations.rb +++ b/google-cloud-datastream-v1/lib/google/cloud/datastream/v1/datastream/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastream-v1alpha1/google-cloud-datastream-v1alpha1.gemspec b/google-cloud-datastream-v1alpha1/google-cloud-datastream-v1alpha1.gemspec index 5964020ef060..c1bdc00bab3b 100644 --- a/google-cloud-datastream-v1alpha1/google-cloud-datastream-v1alpha1.gemspec +++ b/google-cloud-datastream-v1alpha1/google-cloud-datastream-v1alpha1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/client.rb b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/client.rb index 865820712d7f..1e89ade3eaf0 100644 --- a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/client.rb +++ b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/client.rb @@ -169,7 +169,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -2464,6 +2465,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Datastream API. # diff --git a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/operations.rb b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/operations.rb index b6ae62924c0d..07e3210deab2 100644 --- a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/operations.rb +++ b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/client.rb b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/client.rb index 5e04b2f9f5e4..ef6b43b20c9b 100644 --- a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/client.rb +++ b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/client.rb @@ -215,6 +215,26 @@ def initialize # @return [::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest.new + # + # # Call the list_connection_profiles method. + # result = client.list_connection_profiles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1alpha1::ConnectionProfile. + # p item + # end + # def list_connection_profiles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -277,6 +297,22 @@ def list_connection_profiles request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest.new + # + # # Call the get_connection_profile method. + # result = client.get_connection_profile request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::ConnectionProfile. + # p result + # def get_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -357,6 +393,29 @@ def get_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest.new + # + # # Call the create_connection_profile method. + # result = client.create_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -440,6 +499,29 @@ def create_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest.new + # + # # Call the update_connection_profile method. + # result = client.update_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -517,6 +599,29 @@ def update_connection_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest.new + # + # # Call the delete_connection_profile method. + # result = client.delete_connection_profile request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -597,6 +702,22 @@ def delete_connection_profile request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest.new + # + # # Call the discover_connection_profile method. + # result = client.discover_connection_profile request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse. + # p result + # def discover_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -673,6 +794,26 @@ def discover_connection_profile request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::ListStreamsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::ListStreamsRequest.new + # + # # Call the list_streams method. + # result = client.list_streams request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Stream. + # p item + # end + # def list_streams request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -735,6 +876,22 @@ def list_streams request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::Stream] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::GetStreamRequest.new + # + # # Call the get_stream method. + # result = client.get_stream request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::Stream. + # p result + # def get_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -820,6 +977,29 @@ def get_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::CreateStreamRequest.new + # + # # Call the create_stream method. + # result = client.create_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -908,6 +1088,29 @@ def create_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest.new + # + # # Call the update_stream method. + # result = client.update_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -985,6 +1188,29 @@ def update_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest.new + # + # # Call the delete_stream method. + # result = client.delete_stream request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1048,6 +1274,29 @@ def delete_stream request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest.new + # + # # Call the fetch_errors method. + # result = client.fetch_errors request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def fetch_errors request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1119,6 +1368,22 @@ def fetch_errors request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::String>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest.new + # + # # Call the fetch_static_ips method. + # result = client.fetch_static_ips request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse. + # p result + # def fetch_static_ips request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1200,6 +1465,29 @@ def fetch_static_ips request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest.new + # + # # Call the create_private_connection method. + # result = client.create_private_connection request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1263,6 +1551,22 @@ def create_private_connection request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::PrivateConnection] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest.new + # + # # Call the get_private_connection method. + # result = client.get_private_connection request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::PrivateConnection. + # p result + # def get_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1342,6 +1646,26 @@ def get_private_connection request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest.new + # + # # Call the list_private_connections method. + # result = client.list_private_connections request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1alpha1::PrivateConnection. + # p item + # end + # def list_private_connections request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1421,6 +1745,29 @@ def list_private_connections request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest.new + # + # # Call the delete_private_connection method. + # result = client.delete_private_connection request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1503,6 +1850,29 @@ def delete_private_connection request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::CreateRouteRequest.new + # + # # Call the create_route method. + # result = client.create_route request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1566,6 +1936,22 @@ def create_route request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::Route] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::GetRouteRequest.new + # + # # Call the get_route method. + # result = client.get_route request + # + # # The returned object is of type Google::Cloud::Datastream::V1alpha1::Route. + # p result + # def get_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1645,6 +2031,26 @@ def get_route request, options = nil # @return [::Google::Cloud::Datastream::V1alpha1::ListRoutesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::ListRoutesRequest.new + # + # # Call the list_routes method. + # result = client.list_routes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Route. + # p item + # end + # def list_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1721,6 +2127,29 @@ def list_routes request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/datastream/v1alpha1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Datastream::V1alpha1::Datastream::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest.new + # + # # Call the delete_route method. + # result = client.delete_route request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/operations.rb b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/operations.rb index 639c9b948419..53661634aa47 100644 --- a/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/operations.rb +++ b/google-cloud-datastream-v1alpha1/lib/google/cloud/datastream/v1alpha1/datastream/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-deploy-v1/google-cloud-deploy-v1.gemspec b/google-cloud-deploy-v1/google-cloud-deploy-v1.gemspec index dde16cc984d1..fe5ba8b9f707 100644 --- a/google-cloud-deploy-v1/google-cloud-deploy-v1.gemspec +++ b/google-cloud-deploy-v1/google-cloud-deploy-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" gem.add_dependency "google-iam-v1", ">= 0.4", "< 2.a" diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb index 315245bf078d..0690ee339381 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/client.rb @@ -244,7 +244,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -3007,6 +3008,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the CloudDeploy API. # diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/operations.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/operations.rb index c0da1724f403..a8b3c18c6f44 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/operations.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb index 920e74773f8c..cf3b7b35fb54 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/client.rb @@ -308,6 +308,26 @@ def initialize # @return [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest.new + # + # # Call the list_delivery_pipelines method. + # result = client.list_delivery_pipelines request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Deploy::V1::DeliveryPipeline. + # p item + # end + # def list_delivery_pipelines request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -371,6 +391,22 @@ def list_delivery_pipelines request, options = nil # @return [::Google::Cloud::Deploy::V1::DeliveryPipeline] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest.new + # + # # Call the get_delivery_pipeline method. + # result = client.get_delivery_pipeline request + # + # # The returned object is of type Google::Cloud::Deploy::V1::DeliveryPipeline. + # p result + # def get_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -455,6 +491,29 @@ def get_delivery_pipeline request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest.new + # + # # Call the create_delivery_pipeline method. + # result = client.create_delivery_pipeline request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -544,6 +603,29 @@ def create_delivery_pipeline request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest.new + # + # # Call the update_delivery_pipeline method. + # result = client.update_delivery_pipeline request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -636,6 +718,29 @@ def update_delivery_pipeline request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest.new + # + # # Call the delete_delivery_pipeline method. + # result = client.delete_delivery_pipeline request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -717,6 +822,26 @@ def delete_delivery_pipeline request, options = nil # @return [::Google::Cloud::Deploy::V1::ListTargetsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ListTargetsRequest.new + # + # # Call the list_targets method. + # result = client.list_targets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Deploy::V1::Target. + # p item + # end + # def list_targets request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -780,6 +905,22 @@ def list_targets request, options = nil # @return [::Google::Cloud::Deploy::V1::Target] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetTargetRequest.new + # + # # Call the get_target method. + # result = client.get_target request + # + # # The returned object is of type Google::Cloud::Deploy::V1::Target. + # p result + # def get_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -865,6 +1006,29 @@ def get_target request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::CreateTargetRequest.new + # + # # Call the create_target method. + # result = client.create_target request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -954,6 +1118,29 @@ def create_target request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::UpdateTargetRequest.new + # + # # Call the update_target method. + # result = client.update_target request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1042,6 +1229,29 @@ def update_target request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::DeleteTargetRequest.new + # + # # Call the delete_target method. + # result = client.delete_target request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1123,6 +1333,26 @@ def delete_target request, options = nil # @return [::Google::Cloud::Deploy::V1::ListReleasesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ListReleasesRequest.new + # + # # Call the list_releases method. + # result = client.list_releases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Deploy::V1::Release. + # p item + # end + # def list_releases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1186,6 +1416,22 @@ def list_releases request, options = nil # @return [::Google::Cloud::Deploy::V1::Release] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetReleaseRequest.new + # + # # Call the get_release method. + # result = client.get_release request + # + # # The returned object is of type Google::Cloud::Deploy::V1::Release. + # p result + # def get_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1271,6 +1517,29 @@ def get_release request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::CreateReleaseRequest.new + # + # # Call the create_release method. + # result = client.create_release request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1336,6 +1605,22 @@ def create_release request, options = nil # @return [::Google::Cloud::Deploy::V1::AbandonReleaseResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::AbandonReleaseRequest.new + # + # # Call the abandon_release method. + # result = client.abandon_release request + # + # # The returned object is of type Google::Cloud::Deploy::V1::AbandonReleaseResponse. + # p result + # def abandon_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1402,6 +1687,22 @@ def abandon_release request, options = nil # @return [::Google::Cloud::Deploy::V1::ApproveRolloutResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ApproveRolloutRequest.new + # + # # Call the approve_rollout method. + # result = client.approve_rollout request + # + # # The returned object is of type Google::Cloud::Deploy::V1::ApproveRolloutResponse. + # p result + # def approve_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1468,6 +1769,22 @@ def approve_rollout request, options = nil # @return [::Google::Cloud::Deploy::V1::AdvanceRolloutResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::AdvanceRolloutRequest.new + # + # # Call the advance_rollout method. + # result = client.advance_rollout request + # + # # The returned object is of type Google::Cloud::Deploy::V1::AdvanceRolloutResponse. + # p result + # def advance_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1532,6 +1849,22 @@ def advance_rollout request, options = nil # @return [::Google::Cloud::Deploy::V1::CancelRolloutResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::CancelRolloutRequest.new + # + # # Call the cancel_rollout method. + # result = client.cancel_rollout request + # + # # The returned object is of type Google::Cloud::Deploy::V1::CancelRolloutResponse. + # p result + # def cancel_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1611,6 +1944,26 @@ def cancel_rollout request, options = nil # @return [::Google::Cloud::Deploy::V1::ListRolloutsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ListRolloutsRequest.new + # + # # Call the list_rollouts method. + # result = client.list_rollouts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Deploy::V1::Rollout. + # p item + # end + # def list_rollouts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1674,6 +2027,22 @@ def list_rollouts request, options = nil # @return [::Google::Cloud::Deploy::V1::Rollout] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetRolloutRequest.new + # + # # Call the get_rollout method. + # result = client.get_rollout request + # + # # The returned object is of type Google::Cloud::Deploy::V1::Rollout. + # p result + # def get_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1762,6 +2131,29 @@ def get_rollout request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::CreateRolloutRequest.new + # + # # Call the create_rollout method. + # result = client.create_rollout request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1831,6 +2223,22 @@ def create_rollout request, options = nil # @return [::Google::Cloud::Deploy::V1::IgnoreJobResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::IgnoreJobRequest.new + # + # # Call the ignore_job method. + # result = client.ignore_job request + # + # # The returned object is of type Google::Cloud::Deploy::V1::IgnoreJobResponse. + # p result + # def ignore_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1899,6 +2307,22 @@ def ignore_job request, options = nil # @return [::Google::Cloud::Deploy::V1::RetryJobResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::RetryJobRequest.new + # + # # Call the retry_job method. + # result = client.retry_job request + # + # # The returned object is of type Google::Cloud::Deploy::V1::RetryJobResponse. + # p result + # def retry_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1978,6 +2402,26 @@ def retry_job request, options = nil # @return [::Google::Cloud::Deploy::V1::ListJobRunsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::ListJobRunsRequest.new + # + # # Call the list_job_runs method. + # result = client.list_job_runs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Deploy::V1::JobRun. + # p item + # end + # def list_job_runs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2041,6 +2485,22 @@ def list_job_runs request, options = nil # @return [::Google::Cloud::Deploy::V1::JobRun] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetJobRunRequest.new + # + # # Call the get_job_run method. + # result = client.get_job_run request + # + # # The returned object is of type Google::Cloud::Deploy::V1::JobRun. + # p result + # def get_job_run request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2105,6 +2565,22 @@ def get_job_run request, options = nil # @return [::Google::Cloud::Deploy::V1::TerminateJobRunResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::TerminateJobRunRequest.new + # + # # Call the terminate_job_run method. + # result = client.terminate_job_run request + # + # # The returned object is of type Google::Cloud::Deploy::V1::TerminateJobRunResponse. + # p result + # def terminate_job_run request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2167,6 +2643,22 @@ def terminate_job_run request, options = nil # @return [::Google::Cloud::Deploy::V1::Config] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/deploy/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Deploy::V1::CloudDeploy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Deploy::V1::GetConfigRequest.new + # + # # Call the get_config method. + # result = client.get_config request + # + # # The returned object is of type Google::Cloud::Deploy::V1::Config. + # p result + # def get_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/operations.rb b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/operations.rb index 1193261f4b2e..4e9b1c52546c 100644 --- a/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/operations.rb +++ b/google-cloud-deploy-v1/lib/google/cloud/deploy/v1/cloud_deploy/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec b/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec index 2b2ccca65af6..2646b0b1c25e 100644 --- a/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec +++ b/google-cloud-dialogflow-cx-v3/google-cloud-dialogflow-cx-v3.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb index dab0deff493b..4b4aaf9c6f39 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/client.rb @@ -162,7 +162,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1360,6 +1361,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Agents API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb index 49b01d11a085..3969c03335ae 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb index b2dde886de25..8d7dbc7ac1fc 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb @@ -207,6 +207,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Agent>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new + # + # # Call the list_agents method. + # result = client.list_agents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Agent. + # p item + # end + # def list_agents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -271,6 +291,22 @@ def list_agents request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # def get_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -340,6 +376,22 @@ def get_agent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new + # + # # Call the create_agent method. + # result = client.create_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # def create_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -409,6 +461,22 @@ def create_agent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Agent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new + # + # # Call the update_agent method. + # result = client.update_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + # p result + # def update_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -472,6 +540,22 @@ def update_agent request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new + # + # # Call the delete_agent method. + # result = client.delete_agent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -566,6 +650,29 @@ def delete_agent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new + # + # # Call the export_agent method. + # result = client.export_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -662,6 +769,29 @@ def export_agent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new + # + # # Call the restore_agent method. + # result = client.restore_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def restore_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -730,6 +860,22 @@ def restore_agent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new + # + # # Call the validate_agent method. + # result = client.validate_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # def validate_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -797,6 +943,22 @@ def validate_agent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::AgentValidationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new + # + # # Call the get_agent_validation_result method. + # result = client.get_agent_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + # p result + # def get_agent_validation_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -862,6 +1024,22 @@ def get_agent_validation_result request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetGenerativeSettingsRequest.new + # + # # Call the get_generative_settings method. + # result = client.get_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # def get_generative_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -927,6 +1105,22 @@ def get_generative_settings request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::GenerativeSettings] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateGenerativeSettingsRequest.new + # + # # Call the update_generative_settings method. + # result = client.update_generative_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::GenerativeSettings. + # p result + # def update_generative_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb index 001240c1beb9..4bc3323eb1a0 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb index ac7910f0f9f5..f86395d4411c 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -487,6 +488,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Changelogs API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb index 9402cd236bf6..93fce5a60898 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb @@ -210,6 +210,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Changelog>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new + # + # # Call the list_changelogs method. + # result = client.list_changelogs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Changelog. + # p item + # end + # def list_changelogs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -275,6 +295,22 @@ def list_changelogs request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Changelog] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new + # + # # Call the get_changelog method. + # result = client.get_changelog request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. + # p result + # def get_changelog request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb index e8b239de0038..ac9dcaaefef5 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -471,6 +472,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Deployments API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb index ee7db1a051b6..99a08a3eeed4 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb @@ -192,6 +192,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Deployment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new + # + # # Call the list_deployments method. + # result = client.list_deployments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Deployment. + # p item + # end + # def list_deployments request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -259,6 +279,22 @@ def list_deployments request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Deployment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Deployments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new + # + # # Call the get_deployment method. + # result = client.get_deployment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. + # p result + # def get_deployment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb index 9f3350d928ce..565361ae67a1 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -803,6 +804,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the EntityTypes API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb index 5898bdc1b5e4..1cdcfd1e9ade 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb @@ -202,6 +202,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType. + # p item + # end + # def list_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -280,6 +300,22 @@ def list_entity_types request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + # p result + # def get_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -361,6 +397,22 @@ def get_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + # p result + # def create_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -441,6 +493,22 @@ def create_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + # p result + # def update_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -522,6 +590,22 @@ def update_entity_type request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb index f47bf3afff5f..c8e1d8e20c74 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/client.rb @@ -158,7 +158,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1191,6 +1192,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Environments API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb index 92cdc249c9c3..2b315c55e89e 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb index 9de9a4e20cc7..536cadbb8265 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb @@ -205,6 +205,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest.new + # + # # Call the list_environments method. + # result = client.list_environments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. + # p item + # end + # def list_environments request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -272,6 +292,22 @@ def list_environments request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Environment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Environment. + # p result + # def get_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -347,6 +383,29 @@ def get_environment request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -421,6 +480,29 @@ def create_environment request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -488,6 +570,22 @@ def update_environment request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new + # + # # Call the delete_environment method. + # result = client.delete_environment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -558,6 +656,26 @@ def delete_environment request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Environment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new + # + # # Call the lookup_environment_history method. + # result = client.lookup_environment_history request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. + # p item + # end + # def lookup_environment_history request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -632,6 +750,29 @@ def lookup_environment_history request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new + # + # # Call the run_continuous_test method. + # result = client.run_continuous_test request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def run_continuous_test request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -702,6 +843,26 @@ def run_continuous_test request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new + # + # # Call the list_continuous_test_results method. + # result = client.list_continuous_test_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult. + # p item + # end + # def list_continuous_test_results request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -781,6 +942,29 @@ def list_continuous_test_results request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new + # + # # Call the deploy_flow method. + # result = client.deploy_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def deploy_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb index 8a10c8ca0125..c46bbae324d3 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb index 2cc7f43ad132..01f9d6fcf9c6 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -916,6 +917,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Experiments API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb index a828c58f0bea..64ddec5c2dd5 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb @@ -192,6 +192,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new + # + # # Call the list_experiments method. + # result = client.list_experiments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Experiment. + # p item + # end + # def list_experiments request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -259,6 +279,22 @@ def list_experiments request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new + # + # # Call the get_experiment method. + # result = client.get_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # def get_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -327,6 +363,22 @@ def get_experiment request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new + # + # # Call the create_experiment method. + # result = client.create_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # def create_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -392,6 +444,22 @@ def create_experiment request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new + # + # # Call the update_experiment method. + # result = client.update_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # def update_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -458,6 +526,22 @@ def update_experiment request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new + # + # # Call the delete_experiment method. + # result = client.delete_experiment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -524,6 +608,22 @@ def delete_experiment request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new + # + # # Call the start_experiment method. + # result = client.start_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # def start_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -589,6 +689,22 @@ def start_experiment request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new + # + # # Call the stop_experiment method. + # result = client.stop_experiment request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + # p result + # def stop_experiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb index 2dbae44cc0ea..14274819aa44 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/client.rb @@ -157,7 +157,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1349,6 +1350,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Flows API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb index 78ca43c89183..5550416c63f9 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb index 4b0dbb77af7f..1e66516676a1 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb @@ -216,6 +216,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new + # + # # Call the create_flow method. + # result = client.create_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # def create_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -291,6 +307,22 @@ def create_flow request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new + # + # # Call the delete_flow method. + # result = client.delete_flow request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -373,6 +405,26 @@ def delete_flow request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new + # + # # Call the list_flows method. + # result = client.list_flows request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Flow. + # p item + # end + # def list_flows request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -452,6 +504,22 @@ def list_flows request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new + # + # # Call the get_flow method. + # result = client.get_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # def get_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -534,6 +602,22 @@ def get_flow request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Flow] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new + # + # # Call the update_flow method. + # result = client.update_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + # p result + # def update_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -612,6 +696,29 @@ def update_flow request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new + # + # # Call the train_flow method. + # result = client.train_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def train_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -681,6 +788,22 @@ def train_flow request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new + # + # # Call the validate_flow method. + # result = client.validate_flow request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # def validate_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -748,6 +871,22 @@ def validate_flow request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new + # + # # Call the get_flow_validation_result method. + # result = client.get_flow_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + # p result + # def get_flow_validation_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -841,6 +980,29 @@ def get_flow_validation_result request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new + # + # # Call the import_flow method. + # result = client.import_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -931,6 +1093,29 @@ def import_flow request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Flows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new + # + # # Call the export_flow method. + # result = client.export_flow request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_flow request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb index 0ba72f9a7ad7..c7ba687fd97f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb index 5600629ff86e..d1874f84c5ca 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -785,6 +786,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Intents API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb index 45c6254573f5..28a293efd200 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb @@ -202,6 +202,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Intent>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest.new + # + # # Call the list_intents method. + # result = client.list_intents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Intent. + # p item + # end + # def list_intents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -278,6 +298,22 @@ def list_intents request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + # p result + # def get_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -357,6 +393,22 @@ def get_intent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + # p result + # def create_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -436,6 +488,22 @@ def create_intent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + # p result + # def update_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -504,6 +572,22 @@ def update_intent request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new + # + # # Call the delete_intent method. + # result = client.delete_intent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb index ccc399902c98..e869dc73617a 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -840,6 +841,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Pages API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb index 9e305483a99d..71a106701e31 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb @@ -212,6 +212,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new + # + # # Call the list_pages method. + # result = client.list_pages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Page. + # p item + # end + # def list_pages request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -299,6 +319,22 @@ def list_pages request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Page] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new + # + # # Call the get_page method. + # result = client.get_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # def get_page request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -390,6 +426,22 @@ def get_page request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Page] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new + # + # # Call the create_page method. + # result = client.create_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # def create_page request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -480,6 +532,22 @@ def create_page request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Page] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new + # + # # Call the update_page method. + # result = client.update_page request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + # p result + # def update_page request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -559,6 +627,22 @@ def update_page request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Pages::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new + # + # # Call the delete_page method. + # result = client.delete_page request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_page request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb index 585cd751cacd..e2600ed0dca1 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -736,6 +737,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SecuritySettingsService API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb index edddb1047f83..753ff88cff1c 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb @@ -187,6 +187,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new + # + # # Call the create_security_settings method. + # result = client.create_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # def create_security_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -253,6 +269,22 @@ def create_security_settings request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new + # + # # Call the get_security_settings method. + # result = client.get_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # def get_security_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -320,6 +352,22 @@ def get_security_settings request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::SecuritySettings] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new + # + # # Call the update_security_settings method. + # result = client.update_security_settings request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p result + # def update_security_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -388,6 +436,26 @@ def update_security_settings request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new + # + # # Call the list_security_settings method. + # result = client.list_security_settings request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + # p item + # end + # def list_security_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -455,6 +523,22 @@ def list_security_settings request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new + # + # # Call the delete_security_settings method. + # result = client.delete_security_settings request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_security_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb index 51600202aafa..1cd7bd8f4630 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb @@ -152,7 +152,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -751,6 +752,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SessionEntityTypes API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb index bec4052a1b4e..280789332472 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb @@ -194,6 +194,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest.new + # + # # Call the list_session_entity_types method. + # result = client.list_session_entity_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + # p item + # end + # def list_session_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -263,6 +283,22 @@ def list_session_entity_types request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new + # + # # Call the get_session_entity_type method. + # result = client.get_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + # p result + # def get_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -332,6 +368,22 @@ def get_session_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest.new + # + # # Call the create_session_entity_type method. + # result = client.create_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + # p result + # def create_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -402,6 +454,22 @@ def create_session_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest.new + # + # # Call the update_session_entity_type method. + # result = client.update_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + # p result + # def update_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -470,6 +538,22 @@ def update_session_entity_type request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new + # + # # Call the delete_session_entity_type method. + # result = client.delete_session_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb index debb389850f5..070819b44ae0 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb @@ -161,7 +161,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -689,6 +690,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Sessions API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb index a0af8986b7b6..01e90e728824 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb @@ -219,6 +219,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse. + # p result + # def detect_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -299,6 +315,22 @@ def detect_intent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new + # + # # Call the match_intent method. + # result = client.match_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. + # p result + # def match_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -372,6 +404,22 @@ def match_intent request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new + # + # # Call the fulfill_intent method. + # result = client.fulfill_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. + # p result + # def fulfill_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb index b5ed9161fb15..f81218d5a145 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb @@ -158,7 +158,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1512,6 +1513,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the TestCases API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb index 4950fdcfaf09..7721fcb6f7fa 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb index ad48e851851e..5ac1ac615e06 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb @@ -206,6 +206,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCase>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new + # + # # Call the list_test_cases method. + # result = client.list_test_cases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCase. + # p item + # end + # def list_test_cases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -273,6 +293,22 @@ def list_test_cases request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new + # + # # Call the batch_delete_test_cases method. + # result = client.batch_delete_test_cases request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def batch_delete_test_cases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -337,6 +373,22 @@ def batch_delete_test_cases request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new + # + # # Call the get_test_case method. + # result = client.get_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # def get_test_case request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -402,6 +454,22 @@ def get_test_case request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new + # + # # Call the create_test_case method. + # result = client.create_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # def create_test_case request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -469,6 +537,22 @@ def create_test_case request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TestCase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new + # + # # Call the update_test_case method. + # result = client.update_test_case request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + # p result + # def update_test_case request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -545,6 +629,29 @@ def update_test_case request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new + # + # # Call the run_test_case method. + # result = client.run_test_case request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def run_test_case request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -625,6 +732,29 @@ def run_test_case request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new + # + # # Call the batch_run_test_cases method. + # result = client.batch_run_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_run_test_cases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -691,6 +821,22 @@ def batch_run_test_cases request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new + # + # # Call the calculate_coverage method. + # result = client.calculate_coverage request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. + # p result + # def calculate_coverage request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -777,6 +923,29 @@ def calculate_coverage request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new + # + # # Call the import_test_cases method. + # result = client.import_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_test_cases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -876,6 +1045,29 @@ def import_test_cases request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new + # + # # Call the export_test_cases method. + # result = client.export_test_cases request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_test_cases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -973,6 +1165,26 @@ def export_test_cases request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TestCaseResult>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new + # + # # Call the list_test_case_results method. + # result = client.list_test_case_results request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + # p item + # end + # def list_test_case_results request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1038,6 +1250,22 @@ def list_test_case_results request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TestCaseResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TestCases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new + # + # # Call the get_test_case_result method. + # result = client.get_test_case_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + # p result + # def get_test_case_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb index 5e681a4dde88..8b3876d31470 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb index cb038e04aa92..2f447c7419e4 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb @@ -152,7 +152,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -817,6 +818,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the TransitionRouteGroups API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb index df6682c133a5..a0c52bad6023 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb @@ -206,6 +206,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new + # + # # Call the list_transition_route_groups method. + # result = client.list_transition_route_groups request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p item + # end + # def list_transition_route_groups request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -288,6 +308,22 @@ def list_transition_route_groups request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new + # + # # Call the get_transition_route_group method. + # result = client.get_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # def get_transition_route_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -375,6 +411,22 @@ def get_transition_route_group request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new + # + # # Call the create_transition_route_group method. + # result = client.create_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # def create_transition_route_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -456,6 +508,22 @@ def create_transition_route_group request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new + # + # # Call the update_transition_route_group method. + # result = client.update_transition_route_group request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + # p result + # def update_transition_route_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -536,6 +604,22 @@ def update_transition_route_group request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new + # + # # Call the delete_transition_route_group method. + # result = client.delete_transition_route_group request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_transition_route_group request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb index bc657d8f6577..d4fae7db684f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/client.rb @@ -157,7 +157,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -974,6 +975,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Versions API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb index 74112619ced3..493c183e1a46 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb @@ -94,7 +94,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -702,6 +703,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb index c0ef579e299d..e8ed3f503d4a 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb @@ -204,6 +204,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Version>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest.new + # + # # Call the list_versions method. + # result = client.list_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Version. + # p item + # end + # def list_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -269,6 +289,22 @@ def list_versions request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Version] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + # p result + # def get_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -345,6 +381,29 @@ def get_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -411,6 +470,22 @@ def create_version request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Version] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + # p result + # def update_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -475,6 +550,22 @@ def update_version request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new + # + # # Call the delete_version method. + # result = client.delete_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -553,6 +644,29 @@ def delete_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new + # + # # Call the load_version method. + # result = client.load_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def load_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -633,6 +747,22 @@ def load_version request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new + # + # # Call the compare_versions method. + # result = client.compare_versions request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. + # p result + # def compare_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb index d1ab28467a86..8cebdbad5b2f 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb @@ -137,6 +137,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -202,6 +222,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -268,6 +311,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +398,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb index c090af541362..a19353679fce 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -740,6 +741,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Webhooks API. # diff --git a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb index 0f4e30b377cc..414071ae29bc 100644 --- a/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +++ b/google-cloud-dialogflow-cx-v3/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb @@ -189,6 +189,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new + # + # # Call the list_webhooks method. + # result = client.list_webhooks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Webhook. + # p item + # end + # def list_webhooks request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -254,6 +274,22 @@ def list_webhooks request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new + # + # # Call the get_webhook method. + # result = client.get_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # def get_webhook request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -319,6 +355,22 @@ def get_webhook request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new + # + # # Call the create_webhook method. + # result = client.create_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # def create_webhook request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -384,6 +436,22 @@ def create_webhook request, options = nil # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new + # + # # Call the update_webhook method. + # result = client.update_webhook request + # + # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + # p result + # def update_webhook request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -459,6 +527,22 @@ def update_webhook request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/cx/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new + # + # # Call the delete_webhook method. + # result = client.delete_webhook request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_webhook request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec b/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec index 661137c87215..c8c215ebf324 100644 --- a/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec +++ b/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb index 4e56aca39cb1..d2708f8d2b33 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1234,6 +1235,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Agents API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb index f79aa20adf8a..f0c2259d7741 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb index 0d2daac66514..305b96d2ebe4 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb @@ -196,6 +196,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::V2::Agent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # def get_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -264,6 +280,22 @@ def get_agent request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Agent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new + # + # # Call the set_agent method. + # result = client.set_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # def set_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -327,6 +359,22 @@ def set_agent request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new + # + # # Call the delete_agent method. + # result = client.delete_agent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -401,6 +449,26 @@ def delete_agent request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new + # + # # Call the search_agents method. + # result = client.search_agents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Agent. + # p item + # end + # def search_agents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -478,6 +546,29 @@ def search_agents request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new + # + # # Call the train_agent method. + # result = client.train_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def train_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -562,6 +653,29 @@ def train_agent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new + # + # # Call the export_agent method. + # result = client.export_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -663,6 +777,29 @@ def export_agent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new + # + # # Call the import_agent method. + # result = client.import_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -762,6 +899,29 @@ def import_agent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new + # + # # Call the restore_agent method. + # result = client.restore_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def restore_agent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -833,6 +993,22 @@ def restore_agent request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new + # + # # Call the get_validation_result method. + # result = client.get_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. + # p result + # def get_validation_result request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb index 7d9a17f519a7..dcef33e8d85b 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb index b96d836a6262..978c89ad3a8d 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -479,6 +480,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the AnswerRecords API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb index 2894ea6c447b..8bf6b1c8f010 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb @@ -202,6 +202,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new + # + # # Call the list_answer_records method. + # result = client.list_answer_records request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::AnswerRecord. + # p item + # end + # def list_answer_records request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +287,22 @@ def list_answer_records request, options = nil # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new + # + # # Call the update_answer_record method. + # result = client.update_answer_record request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. + # p result + # def update_answer_record request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb index fd532194f287..3f5e33eadb14 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -833,6 +834,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Contexts API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb index 6e6c53588ab3..cf151d8337cd 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb @@ -192,6 +192,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new + # + # # Call the list_contexts method. + # result = client.list_contexts request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Context. + # p item + # end + # def list_contexts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -260,6 +280,22 @@ def list_contexts request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Context] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new + # + # # Call the get_context method. + # result = client.get_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # def get_context request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -331,6 +367,22 @@ def get_context request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Context] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new + # + # # Call the create_context method. + # result = client.create_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # def create_context request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -395,6 +447,22 @@ def create_context request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Context] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new + # + # # Call the update_context method. + # result = client.update_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # def update_context request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -462,6 +530,22 @@ def update_context request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new + # + # # Call the delete_context method. + # result = client.delete_context request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_context request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -529,6 +613,22 @@ def delete_context request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new + # + # # Call the delete_all_contexts method. + # result = client.delete_all_contexts request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_all_contexts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb index bad7f09fe957..562fb67172cf 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb @@ -159,7 +159,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -799,6 +800,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ConversationDatasets API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb index 60c553911b59..30a1080d3e88 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb index 332e67e2bc43..86948b57b55c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb @@ -210,6 +210,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new + # + # # Call the create_conversation_dataset method. + # result = client.create_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_conversation_dataset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -275,6 +298,22 @@ def create_conversation_dataset request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new + # + # # Call the get_conversation_dataset method. + # result = client.get_conversation_dataset request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. + # p result + # def get_conversation_dataset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -344,6 +383,26 @@ def get_conversation_dataset request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new + # + # # Call the list_conversation_datasets method. + # result = client.list_conversation_datasets request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationDataset. + # p item + # end + # def list_conversation_datasets request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -418,6 +477,29 @@ def list_conversation_datasets request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new + # + # # Call the delete_conversation_dataset method. + # result = client.delete_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_conversation_dataset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -496,6 +578,29 @@ def delete_conversation_dataset request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new + # + # # Call the import_conversation_data method. + # result = client.import_conversation_data request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_conversation_data request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb index 65c9d74d1d70..1017f8392f79 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb index ecb873c8726b..693d5d95b6b1 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1177,6 +1178,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ConversationModels API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb index 90d5bf7ea7c9..dc4fadc469a8 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb index c1760e40ea78..7ab2ffae1d58 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb @@ -207,6 +207,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new + # + # # Call the create_conversation_model method. + # result = client.create_conversation_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_conversation_model request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -271,6 +294,22 @@ def create_conversation_model request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new + # + # # Call the get_conversation_model method. + # result = client.get_conversation_model request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. + # p result + # def get_conversation_model request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -339,6 +378,26 @@ def get_conversation_model request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new + # + # # Call the list_conversation_models method. + # result = client.list_conversation_models request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModel. + # p item + # end + # def list_conversation_models request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -412,6 +471,29 @@ def list_conversation_models request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new + # + # # Call the delete_conversation_model method. + # result = client.delete_conversation_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_conversation_model request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -488,6 +570,29 @@ def delete_conversation_model request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new + # + # # Call the deploy_conversation_model method. + # result = client.deploy_conversation_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def deploy_conversation_model request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -564,6 +669,29 @@ def deploy_conversation_model request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new + # + # # Call the undeploy_conversation_model method. + # result = client.undeploy_conversation_model request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def undeploy_conversation_model request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -629,6 +757,22 @@ def undeploy_conversation_model request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new + # + # # Call the get_conversation_model_evaluation method. + # result = client.get_conversation_model_evaluation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + # p result + # def get_conversation_model_evaluation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -697,6 +841,26 @@ def get_conversation_model_evaluation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new + # + # # Call the list_conversation_model_evaluations method. + # result = client.list_conversation_model_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + # p item + # end + # def list_conversation_model_evaluations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -764,6 +928,29 @@ def list_conversation_model_evaluations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new + # + # # Call the create_conversation_model_evaluation method. + # result = client.create_conversation_model_evaluation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_conversation_model_evaluation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb index fb022afb3ccf..dde4f13bcc28 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb index 919205ee2ebf..15ce43779744 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb @@ -157,7 +157,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -978,6 +979,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ConversationProfiles API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb index b312a3550c30..45d8d056cd58 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb index d6903ae94084..f2e96b1f6068 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb @@ -202,6 +202,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new + # + # # Call the list_conversation_profiles method. + # result = client.list_conversation_profiles request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationProfile. + # p item + # end + # def list_conversation_profiles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +287,22 @@ def list_conversation_profiles request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new + # + # # Call the get_conversation_profile method. + # result = client.get_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # def get_conversation_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -337,6 +373,22 @@ def get_conversation_profile request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new + # + # # Call the create_conversation_profile method. + # result = client.create_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # def create_conversation_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -406,6 +458,22 @@ def create_conversation_profile request, options = nil # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new + # + # # Call the update_conversation_profile method. + # result = client.update_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # def update_conversation_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -470,6 +538,22 @@ def update_conversation_profile request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new + # + # # Call the delete_conversation_profile method. + # result = client.delete_conversation_profile request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_conversation_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -556,6 +640,29 @@ def delete_conversation_profile request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new + # + # # Call the set_suggestion_feature_config method. + # result = client.set_suggestion_feature_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def set_suggestion_feature_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -636,6 +743,29 @@ def set_suggestion_feature_config request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new + # + # # Call the clear_suggestion_feature_config method. + # result = client.clear_suggestion_feature_config request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def clear_suggestion_feature_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb index df2858b37355..d554a3f5bb70 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb index 7018755ac092..6306fb9f1f3d 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1113,6 +1114,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Conversations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb index 8c347561cc73..623a48e59090 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb @@ -217,6 +217,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::V2::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + # p result + # def create_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -303,6 +319,26 @@ def create_conversation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationsRequest.new + # + # # Call the list_conversations method. + # result = client.list_conversations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Conversation. + # p item + # end + # def list_conversations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -368,6 +404,22 @@ def list_conversations request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + # p result + # def get_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -433,6 +485,22 @@ def get_conversation request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new + # + # # Call the complete_conversation method. + # result = client.complete_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + # p result + # def complete_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -515,6 +583,26 @@ def complete_conversation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new + # + # # Call the list_messages method. + # result = client.list_messages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Message. + # p item + # end + # def list_messages request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -595,6 +683,22 @@ def list_messages request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new + # + # # Call the suggest_conversation_summary method. + # result = client.suggest_conversation_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. + # p result + # def suggest_conversation_summary request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -672,6 +776,22 @@ def suggest_conversation_summary request, options = nil # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new + # + # # Call the generate_stateless_summary method. + # result = client.generate_stateless_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. + # p result + # def generate_stateless_summary request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -759,6 +879,22 @@ def generate_stateless_summary request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new + # + # # Call the search_knowledge method. + # result = client.search_knowledge request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. + # p result + # def search_knowledge request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb index 7122b36ac600..eeb5148464cb 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb @@ -157,7 +157,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1167,6 +1168,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Documents API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb index 0b0bc2256b78..81c968e7792d 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb index 56bf5895f6ee..d1d31bf6389a 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb @@ -225,6 +225,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Document. + # p item + # end + # def list_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -290,6 +310,22 @@ def list_documents request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Document. + # p result + # def get_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -364,6 +400,29 @@ def get_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -452,6 +511,29 @@ def create_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -526,6 +608,29 @@ def import_documents request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -601,6 +706,29 @@ def delete_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -692,6 +820,29 @@ def update_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new + # + # # Call the reload_document method. + # result = client.reload_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def reload_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -774,6 +925,29 @@ def reload_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new + # + # # Call the export_document method. + # result = client.export_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb index 39c5d6288652..fb025feef0b3 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb index 2250fb002ddd..d4bb9650a27e 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1357,6 +1358,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the EntityTypes API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb index c394a7d568da..6856ccfc889c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb index 2ee89214d0b4..fdb5480d5a11 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb @@ -207,6 +207,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::EntityType. + # p item + # end + # def list_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -277,6 +297,22 @@ def list_entity_types request, options = nil # @return [::Google::Cloud::Dialogflow::V2::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # def get_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -352,6 +388,22 @@ def get_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::V2::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # def create_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -426,6 +478,22 @@ def create_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::V2::EntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # def update_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -493,6 +561,22 @@ def update_entity_type request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -584,6 +668,29 @@ def delete_entity_type request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new + # + # # Call the batch_update_entity_types method. + # result = client.batch_update_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_update_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -664,6 +771,29 @@ def batch_update_entity_types request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new + # + # # Call the batch_delete_entity_types method. + # result = client.batch_delete_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_delete_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -749,6 +879,29 @@ def batch_delete_entity_types request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new + # + # # Call the batch_create_entities method. + # result = client.batch_create_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_create_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -838,6 +991,29 @@ def batch_create_entities request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new + # + # # Call the batch_update_entities method. + # result = client.batch_update_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_update_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -925,6 +1101,29 @@ def batch_update_entities request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new + # + # # Call the batch_delete_entities method. + # result = client.batch_delete_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_delete_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb index bd797e898c65..5450bacff661 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb index d42a7d893463..4e8e713ca048 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -863,6 +864,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Environments API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb index 08b1c59604a8..0bd52a51a7a9 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb @@ -191,6 +191,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new + # + # # Call the list_environments method. + # result = client.list_environments request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Environment. + # p item + # end + # def list_environments request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -261,6 +281,22 @@ def list_environments request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Environment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # def get_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -331,6 +367,22 @@ def get_environment request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Environment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # def create_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -411,6 +463,22 @@ def create_environment request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Environment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # def update_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -480,6 +548,22 @@ def update_environment request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new + # + # # Call the delete_environment method. + # result = client.delete_environment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_environment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -554,6 +638,26 @@ def delete_environment request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new + # + # # Call the get_environment_history method. + # result = client.get_environment_history request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry. + # p item + # end + # def get_environment_history request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb index 58ae04dfa2d4..aa632affe1dc 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -456,6 +457,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Fulfillments API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb index 74843184217a..798be5dcdfb8 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb @@ -183,6 +183,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new + # + # # Call the get_fulfillment method. + # result = client.get_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # def get_fulfillment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -248,6 +264,22 @@ def get_fulfillment request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new + # + # # Call the update_fulfillment method. + # result = client.update_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # def update_fulfillment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb index af3410b7eb4c..a54a2f56c785 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1024,6 +1025,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Intents API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb index 6d850f85e1d7..b92247bec53c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb index ed7e0abe3e24..52a0379e2a63 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb @@ -217,6 +217,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new + # + # # Call the list_intents method. + # result = client.list_intents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Intent. + # p item + # end + # def list_intents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -289,6 +309,22 @@ def list_intents request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # def get_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -366,6 +402,22 @@ def get_intent request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # def create_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -442,6 +494,22 @@ def create_intent request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Intent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # def update_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -510,6 +578,22 @@ def update_intent request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new + # + # # Call the delete_intent method. + # result = client.delete_intent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -602,6 +686,29 @@ def delete_intent request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new + # + # # Call the batch_update_intents method. + # result = client.batch_update_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_update_intents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -682,6 +789,29 @@ def batch_update_intents request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new + # + # # Call the batch_delete_intents method. + # result = client.batch_delete_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_delete_intents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb index 43441adf57b9..47c34ff014b4 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb index 0812c452b81a..b2e93ab5c302 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -760,6 +761,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the KnowledgeBases API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb index 389145c2200b..0a176d5d920c 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb @@ -216,6 +216,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new + # + # # Call the list_knowledge_bases method. + # result = client.list_knowledge_bases request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p item + # end + # def list_knowledge_bases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -281,6 +301,22 @@ def list_knowledge_bases request, options = nil # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new + # + # # Call the get_knowledge_base method. + # result = client.get_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # def get_knowledge_base request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -346,6 +382,22 @@ def get_knowledge_base request, options = nil # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new + # + # # Call the create_knowledge_base method. + # result = client.create_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # def create_knowledge_base request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -413,6 +465,22 @@ def create_knowledge_base request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new + # + # # Call the delete_knowledge_base method. + # result = client.delete_knowledge_base request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_knowledge_base request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -479,6 +547,22 @@ def delete_knowledge_base request, options = nil # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new + # + # # Call the update_knowledge_base method. + # result = client.update_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # def update_knowledge_base request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb index 0ed32c2804a9..7b6e175ce9b2 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb @@ -157,7 +157,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1163,6 +1164,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Participants API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb index 43b056808fba..3681d461a383 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb @@ -191,6 +191,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::V2::Participant] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new + # + # # Call the create_participant method. + # result = client.create_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # def create_participant request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -255,6 +271,22 @@ def create_participant request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Participant] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new + # + # # Call the get_participant method. + # result = client.get_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # def get_participant request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -324,6 +356,26 @@ def get_participant request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new + # + # # Call the list_participants method. + # result = client.list_participants request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Participant. + # p item + # end + # def list_participants request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -389,6 +441,22 @@ def list_participants request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Participant] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new + # + # # Call the update_participant method. + # result = client.update_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # def update_participant request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -485,6 +553,22 @@ def update_participant request, options = nil # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new + # + # # Call the analyze_content method. + # result = client.analyze_content request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. + # p result + # def analyze_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -563,6 +647,22 @@ def analyze_content request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new + # + # # Call the suggest_articles method. + # result = client.suggest_articles request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. + # p result + # def suggest_articles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -640,6 +740,22 @@ def suggest_articles request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new + # + # # Call the suggest_faq_answers method. + # result = client.suggest_faq_answers request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. + # p result + # def suggest_faq_answers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -719,6 +835,22 @@ def suggest_faq_answers request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new + # + # # Call the suggest_smart_replies method. + # result = client.suggest_smart_replies request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. + # p result + # def suggest_smart_replies request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb index b34a9c5a756a..2a868d548c67 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -767,6 +768,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SessionEntityTypes API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb index eaed9d729eba..b1ee4ee931f9 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb @@ -197,6 +197,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new + # + # # Call the list_session_entity_types method. + # result = client.list_session_entity_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::SessionEntityType. + # p item + # end + # def list_session_entity_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -270,6 +290,22 @@ def list_session_entity_types request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new + # + # # Call the get_session_entity_type method. + # result = client.get_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # def get_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -346,6 +382,22 @@ def get_session_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new + # + # # Call the create_session_entity_type method. + # result = client.create_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # def create_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -414,6 +466,22 @@ def create_session_entity_type request, options = nil # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new + # + # # Call the update_session_entity_type method. + # result = client.update_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # def update_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -486,6 +554,22 @@ def update_session_entity_type request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new + # + # # Call the delete_session_entity_type method. + # result = client.delete_session_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_session_entity_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb index a62f9c5327e7..b812df95c816 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb @@ -160,7 +160,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -526,6 +527,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Sessions API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb index b571f4505b2d..0ce658a27357 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb @@ -248,6 +248,22 @@ def initialize # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. + # p result + # def detect_intent request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb index adf2127cdf38..680c6aaaae49 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -750,6 +751,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Versions API. # diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb index 04a1e34cd3d8..ea32e73d9b6e 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb @@ -191,6 +191,26 @@ def initialize # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new + # + # # Call the list_versions method. + # result = client.list_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dialogflow::V2::Version. + # p item + # end + # def list_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -259,6 +279,22 @@ def list_versions request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Version] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # def get_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -329,6 +365,22 @@ def get_version request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Version] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # def create_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -402,6 +454,22 @@ def create_version request, options = nil # @return [::Google::Cloud::Dialogflow::V2::Version] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # def update_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -469,6 +537,22 @@ def update_version request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new + # + # # Call the delete_version method. + # result = client.delete_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec b/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec index dbd954db64f3..318630b5166e 100644 --- a/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec +++ b/google-cloud-discovery_engine-v1/google-cloud-discovery_engine-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb index 0a94211e8362..9bcb30b2eddd 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -410,6 +411,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the CompletionService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb index a69100102b9e..dbb30c208713 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb @@ -224,6 +224,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::CompleteQueryResponse. + # p result + # def complete_query request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb index 276ca424e3bb..1453c2ef8247 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -883,6 +884,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ConversationalSearchService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb index 9c85049b91a5..5e34dea3f9c7 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb @@ -218,6 +218,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ConverseConversationRequest.new + # + # # Call the converse_conversation method. + # result = client.converse_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::ConverseConversationResponse. + # p result + # def converse_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -286,6 +302,22 @@ def converse_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # def create_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -352,6 +384,22 @@ def create_conversation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteConversationRequest.new + # + # # Call the delete_conversation method. + # result = client.delete_conversation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -427,6 +475,22 @@ def delete_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateConversationRequest.new + # + # # Call the update_conversation method. + # result = client.update_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # def update_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -490,6 +554,22 @@ def update_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Conversation. + # p result + # def get_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -577,6 +657,26 @@ def get_conversation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Conversation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListConversationsRequest.new + # + # # Call the list_conversations method. + # result = client.list_conversations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Conversation. + # p item + # end + # def list_conversations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb index 5bfb5e42bc09..b0d850735be0 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/client.rb @@ -162,7 +162,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1087,6 +1088,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DocumentService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb index 1452f45c686b..9a278944dd60 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb index 3a9d3d854fdd..f906ba912366 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb @@ -209,6 +209,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # def get_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -296,6 +312,26 @@ def get_document request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document. + # p item + # end + # def list_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -381,6 +417,22 @@ def list_documents request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # def create_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -456,6 +508,22 @@ def create_document request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document. + # p result + # def update_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -527,6 +595,22 @@ def update_document request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -658,6 +742,29 @@ def delete_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -744,6 +851,29 @@ def import_documents request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new + # + # # Call the purge_documents method. + # result = client.purge_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def purge_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb index dc35eae98f3e..80ebcee6415a 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb index d32a85609941..1778de65f0e0 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -784,6 +785,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SchemaService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb index 45428e5d6f15..78e3cb33c68f 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb index 46e773b00a4f..d001b6cfb0ea 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb @@ -195,6 +195,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::Schema] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::GetSchemaRequest.new + # + # # Call the get_schema method. + # result = client.get_schema request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Schema. + # p result + # def get_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -274,6 +290,26 @@ def get_schema request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Schema>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ListSchemasRequest.new + # + # # Call the list_schemas method. + # result = client.list_schemas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Schema. + # p item + # end + # def list_schemas request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -349,6 +385,29 @@ def list_schemas request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CreateSchemaRequest.new + # + # # Call the create_schema method. + # result = client.create_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -416,6 +475,29 @@ def create_schema request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::UpdateSchemaRequest.new + # + # # Call the update_schema method. + # result = client.update_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -480,6 +562,29 @@ def update_schema request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::DeleteSchemaRequest.new + # + # # Call the delete_schema method. + # result = client.delete_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb index 586215458815..e2510fcf2ba7 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb index 4cb1e8306e6f..123e172d8dd5 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -488,6 +489,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SearchService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb index 16e5c0df6205..159d6a5bb895 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb @@ -297,6 +297,26 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::SearchResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::SearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::SearchResponse::SearchResult. + # p item + # end + # def search request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb index a59dfaa7baa9..d5679af832fb 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb @@ -161,7 +161,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -599,6 +600,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the UserEventService API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb index 20a188062bac..910134169e8b 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb index bf9c4117aab0..313860d151fc 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb @@ -202,6 +202,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1::UserEvent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1::UserEvent. + # p result + # def write_user_event request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -281,6 +297,22 @@ def write_user_event request, options = nil # @return [::Google::Api::HttpBody] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # def collect_user_event request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -359,6 +391,29 @@ def collect_user_event request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_user_events request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb index d9c477da6f06..edfe594d7b94 100644 --- a/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/google-cloud-discovery_engine-v1beta.gemspec b/google-cloud-discovery_engine-v1beta/google-cloud-discovery_engine-v1beta.gemspec index ec752cfff83c..8e02bb49eab4 100644 --- a/google-cloud-discovery_engine-v1beta/google-cloud-discovery_engine-v1beta.gemspec +++ b/google-cloud-discovery_engine-v1beta/google-cloud-discovery_engine-v1beta.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb index c798c97b5590..eef22a316e45 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -410,6 +411,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the CompletionService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb index 90c81bfcf6d2..038bc1604347 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb @@ -224,6 +224,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::CompleteQueryResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::CompletionService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::CompleteQueryResponse. + # p result + # def complete_query request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb index 23df441aed3f..a36923845a17 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -883,6 +884,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the ConversationalSearchService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb index bdbbd65b2b6a..0313f870d1e5 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb @@ -218,6 +218,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationRequest.new + # + # # Call the converse_conversation method. + # result = client.converse_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ConverseConversationResponse. + # p result + # def converse_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -286,6 +302,22 @@ def converse_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1beta::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation. + # p result + # def create_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -352,6 +384,22 @@ def create_conversation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteConversationRequest.new + # + # # Call the delete_conversation method. + # result = client.delete_conversation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -427,6 +475,22 @@ def delete_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1beta::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateConversationRequest.new + # + # # Call the update_conversation method. + # result = client.update_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation. + # p result + # def update_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -490,6 +554,22 @@ def update_conversation request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1beta::Conversation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Conversation. + # p result + # def get_conversation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -577,6 +657,26 @@ def get_conversation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Conversation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::ConversationalSearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ListConversationsRequest.new + # + # # Call the list_conversations method. + # result = client.list_conversations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Conversation. + # p item + # end + # def list_conversations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb index ceb1cce36aca..8a21df597ddd 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb @@ -163,7 +163,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1093,6 +1094,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DocumentService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb index 2c0570af1620..9d145e46f500 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb index 2ad44db4a2df..96b3bd130d06 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb @@ -210,6 +210,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Document. + # p result + # def get_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -297,6 +313,26 @@ def get_document request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Document>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ListDocumentsRequest.new + # + # # Call the list_documents method. + # result = client.list_documents request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Document. + # p item + # end + # def list_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -382,6 +418,22 @@ def list_documents request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Document. + # p result + # def create_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -458,6 +510,22 @@ def create_document request, options = nil # @return [::Google::Cloud::DiscoveryEngine::V1beta::Document] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Document. + # p result + # def update_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -529,6 +597,22 @@ def update_document request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -663,6 +747,29 @@ def delete_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -750,6 +857,29 @@ def import_documents request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::PurgeDocumentsRequest.new + # + # # Call the purge_documents method. + # result = client.purge_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def purge_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb index 617e0c8468b1..599166e6d649 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb index 19c9e9202604..a8b15167721d 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -461,6 +462,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the RecommendationService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb index 176233b077d2..312a318af784 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb @@ -275,6 +275,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::RecommendationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::RecommendRequest.new + # + # # Call the recommend method. + # result = client.recommend request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse. + # p result + # def recommend request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb index 22ecb0d5034a..0f14ff0fbc39 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb @@ -156,7 +156,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -787,6 +788,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SchemaService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb index c1c610be2de9..7d9ffea84b48 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb index 53b0347c9df6..671c5ad4c309 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb @@ -195,6 +195,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::Schema] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::GetSchemaRequest.new + # + # # Call the get_schema method. + # result = client.get_schema request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Schema. + # p result + # def get_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -274,6 +290,26 @@ def get_schema request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Schema>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ListSchemasRequest.new + # + # # Call the list_schemas method. + # result = client.list_schemas request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Schema. + # p item + # end + # def list_schemas request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -350,6 +386,29 @@ def list_schemas request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::CreateSchemaRequest.new + # + # # Call the create_schema method. + # result = client.create_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def create_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -419,6 +478,29 @@ def create_schema request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateSchemaRequest.new + # + # # Call the update_schema method. + # result = client.update_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -483,6 +565,29 @@ def update_schema request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteSchemaRequest.new + # + # # Call the delete_schema method. + # result = client.delete_schema request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb index dd5a8ccdee3e..265da90e4ea5 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb index 2877b9633632..b2339d326d81 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb @@ -150,7 +150,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -517,6 +518,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the SearchService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb index 7429a14dbdb6..28b95b437ebe 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb @@ -326,6 +326,26 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::SearchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::SearchRequest.new + # + # # Call the search method. + # result = client.search request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::SearchResponse::SearchResult. + # p item + # end + # def search request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb index 0ee58d41c9cd..cb5da97cc9bb 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb @@ -161,7 +161,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -599,6 +600,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the UserEventService API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb index 5e9fb5ccae82..ef0b463a4979 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb index 508c5eb0d8fb..fb4c79137984 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb @@ -202,6 +202,22 @@ def initialize # @return [::Google::Cloud::DiscoveryEngine::V1beta::UserEvent] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::WriteUserEventRequest.new + # + # # Call the write_user_event method. + # result = client.write_user_event request + # + # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::UserEvent. + # p result + # def write_user_event request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -281,6 +297,22 @@ def write_user_event request, options = nil # @return [::Google::Api::HttpBody] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::CollectUserEventRequest.new + # + # # Call the collect_user_event method. + # result = client.collect_user_event request + # + # # The returned object is of type Google::Api::HttpBody. + # p result + # def collect_user_event request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -359,6 +391,29 @@ def collect_user_event request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/discovery_engine/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DiscoveryEngine::V1beta::UserEventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DiscoveryEngine::V1beta::ImportUserEventsRequest.new + # + # # Call the import_user_events method. + # result = client.import_user_events request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_user_events request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb index 46c2f15e4c44..b86babdf22af 100644 --- a/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +++ b/google-cloud-discovery_engine-v1beta/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-dlp-v2/google-cloud-dlp-v2.gemspec b/google-cloud-dlp-v2/google-cloud-dlp-v2.gemspec index ce8bc6ba4799..94f7e19a567b 100644 --- a/google-cloud-dlp-v2/google-cloud-dlp-v2.gemspec +++ b/google-cloud-dlp-v2/google-cloud-dlp-v2.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb index 692a0492d2c7..60e500f38ca8 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb @@ -281,7 +281,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -3997,6 +3998,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DlpService API. # diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb index 4188e2f5db1b..fc96c4da2687 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/rest/client.rb @@ -348,6 +348,22 @@ def initialize # @return [::Google::Cloud::Dlp::V2::InspectContentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::InspectContentRequest.new + # + # # Call the inspect_content method. + # result = client.inspect_content request + # + # # The returned object is of type Google::Cloud::Dlp::V2::InspectContentResponse. + # p result + # def inspect_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -443,6 +459,22 @@ def inspect_content request, options = nil # @return [::Google::Cloud::Dlp::V2::RedactImageResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::RedactImageRequest.new + # + # # Call the redact_image method. + # result = client.redact_image request + # + # # The returned object is of type Google::Cloud::Dlp::V2::RedactImageResponse. + # p result + # def redact_image request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -558,6 +590,22 @@ def redact_image request, options = nil # @return [::Google::Cloud::Dlp::V2::DeidentifyContentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeidentifyContentRequest.new + # + # # Call the deidentify_content method. + # result = client.deidentify_content request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyContentResponse. + # p result + # def deidentify_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -669,6 +717,22 @@ def deidentify_content request, options = nil # @return [::Google::Cloud::Dlp::V2::ReidentifyContentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ReidentifyContentRequest.new + # + # # Call the reidentify_content method. + # result = client.reidentify_content request + # + # # The returned object is of type Google::Cloud::Dlp::V2::ReidentifyContentResponse. + # p result + # def reidentify_content request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -746,6 +810,22 @@ def reidentify_content request, options = nil # @return [::Google::Cloud::Dlp::V2::ListInfoTypesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListInfoTypesRequest.new + # + # # Call the list_info_types method. + # result = client.list_info_types request + # + # # The returned object is of type Google::Cloud::Dlp::V2::ListInfoTypesResponse. + # p result + # def list_info_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -838,6 +918,22 @@ def list_info_types request, options = nil # @return [::Google::Cloud::Dlp::V2::InspectTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CreateInspectTemplateRequest.new + # + # # Call the create_inspect_template method. + # result = client.create_inspect_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + # p result + # def create_inspect_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -907,6 +1003,22 @@ def create_inspect_template request, options = nil # @return [::Google::Cloud::Dlp::V2::InspectTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest.new + # + # # Call the update_inspect_template method. + # result = client.update_inspect_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + # p result + # def update_inspect_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -972,6 +1084,22 @@ def update_inspect_template request, options = nil # @return [::Google::Cloud::Dlp::V2::InspectTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::GetInspectTemplateRequest.new + # + # # Call the get_inspect_template method. + # result = client.get_inspect_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + # p result + # def get_inspect_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1076,6 +1204,26 @@ def get_inspect_template request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::InspectTemplate>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListInspectTemplatesRequest.new + # + # # Call the list_inspect_templates method. + # result = client.list_inspect_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dlp::V2::InspectTemplate. + # p item + # end + # def list_inspect_templates request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1142,6 +1290,22 @@ def list_inspect_templates request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest.new + # + # # Call the delete_inspect_template method. + # result = client.delete_inspect_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_inspect_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1235,6 +1399,22 @@ def delete_inspect_template request, options = nil # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest.new + # + # # Call the create_deidentify_template method. + # result = client.create_deidentify_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + # p result + # def create_deidentify_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1305,6 +1485,22 @@ def create_deidentify_template request, options = nil # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest.new + # + # # Call the update_deidentify_template method. + # result = client.update_deidentify_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + # p result + # def update_deidentify_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1371,6 +1567,22 @@ def update_deidentify_template request, options = nil # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest.new + # + # # Call the get_deidentify_template method. + # result = client.get_deidentify_template request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + # p result + # def get_deidentify_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1476,6 +1688,26 @@ def get_deidentify_template request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DeidentifyTemplate>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest.new + # + # # Call the list_deidentify_templates method. + # result = client.list_deidentify_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dlp::V2::DeidentifyTemplate. + # p item + # end + # def list_deidentify_templates request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1543,6 +1775,22 @@ def list_deidentify_templates request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest.new + # + # # Call the delete_deidentify_template method. + # result = client.delete_deidentify_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_deidentify_template request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1631,6 +1879,22 @@ def delete_deidentify_template request, options = nil # @return [::Google::Cloud::Dlp::V2::JobTrigger] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CreateJobTriggerRequest.new + # + # # Call the create_job_trigger method. + # result = client.create_job_trigger request + # + # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + # p result + # def create_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1699,6 +1963,22 @@ def create_job_trigger request, options = nil # @return [::Google::Cloud::Dlp::V2::JobTrigger] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::UpdateJobTriggerRequest.new + # + # # Call the update_job_trigger method. + # result = client.update_job_trigger request + # + # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + # p result + # def update_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1766,6 +2046,22 @@ def update_job_trigger request, options = nil # @return [::Google::Cloud::Dlp::V2::HybridInspectResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest.new + # + # # Call the hybrid_inspect_job_trigger method. + # result = client.hybrid_inspect_job_trigger request + # + # # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. + # p result + # def hybrid_inspect_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1830,6 +2126,22 @@ def hybrid_inspect_job_trigger request, options = nil # @return [::Google::Cloud::Dlp::V2::JobTrigger] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::GetJobTriggerRequest.new + # + # # Call the get_job_trigger method. + # result = client.get_job_trigger request + # + # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + # p result + # def get_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1959,6 +2271,26 @@ def get_job_trigger request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::JobTrigger>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListJobTriggersRequest.new + # + # # Call the list_job_triggers method. + # result = client.list_job_triggers request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dlp::V2::JobTrigger. + # p item + # end + # def list_job_triggers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2024,6 +2356,22 @@ def list_job_triggers request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeleteJobTriggerRequest.new + # + # # Call the delete_job_trigger method. + # result = client.delete_job_trigger request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2088,6 +2436,22 @@ def delete_job_trigger request, options = nil # @return [::Google::Cloud::Dlp::V2::DlpJob] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ActivateJobTriggerRequest.new + # + # # Call the activate_job_trigger method. + # result = client.activate_job_trigger request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + # p result + # def activate_job_trigger request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2183,6 +2547,22 @@ def activate_job_trigger request, options = nil # @return [::Google::Cloud::Dlp::V2::DlpJob] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CreateDlpJobRequest.new + # + # # Call the create_dlp_job method. + # result = client.create_dlp_job request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + # p result + # def create_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2313,6 +2693,26 @@ def create_dlp_job request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DlpJob>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListDlpJobsRequest.new + # + # # Call the list_dlp_jobs method. + # result = client.list_dlp_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dlp::V2::DlpJob. + # p item + # end + # def list_dlp_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2378,6 +2778,22 @@ def list_dlp_jobs request, options = nil # @return [::Google::Cloud::Dlp::V2::DlpJob] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::GetDlpJobRequest.new + # + # # Call the get_dlp_job method. + # result = client.get_dlp_job request + # + # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + # p result + # def get_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2444,6 +2860,22 @@ def get_dlp_job request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeleteDlpJobRequest.new + # + # # Call the delete_dlp_job method. + # result = client.delete_dlp_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2510,6 +2942,22 @@ def delete_dlp_job request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CancelDlpJobRequest.new + # + # # Call the cancel_dlp_job method. + # result = client.cancel_dlp_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2602,6 +3050,22 @@ def cancel_dlp_job request, options = nil # @return [::Google::Cloud::Dlp::V2::StoredInfoType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest.new + # + # # Call the create_stored_info_type method. + # result = client.create_stored_info_type request + # + # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + # p result + # def create_stored_info_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2675,6 +3139,22 @@ def create_stored_info_type request, options = nil # @return [::Google::Cloud::Dlp::V2::StoredInfoType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest.new + # + # # Call the update_stored_info_type method. + # result = client.update_stored_info_type request + # + # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + # p result + # def update_stored_info_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2741,6 +3221,22 @@ def update_stored_info_type request, options = nil # @return [::Google::Cloud::Dlp::V2::StoredInfoType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest.new + # + # # Call the get_stored_info_type method. + # result = client.get_stored_info_type request + # + # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + # p result + # def get_stored_info_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2843,6 +3339,26 @@ def get_stored_info_type request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::StoredInfoType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest.new + # + # # Call the list_stored_info_types method. + # result = client.list_stored_info_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dlp::V2::StoredInfoType. + # p item + # end + # def list_stored_info_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2910,6 +3426,22 @@ def list_stored_info_types request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest.new + # + # # Call the delete_stored_info_type method. + # result = client.delete_stored_info_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_stored_info_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -2977,6 +3509,22 @@ def delete_stored_info_type request, options = nil # @return [::Google::Cloud::Dlp::V2::HybridInspectResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest.new + # + # # Call the hybrid_inspect_dlp_job method. + # result = client.hybrid_inspect_dlp_job request + # + # # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. + # p result + # def hybrid_inspect_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -3040,6 +3588,22 @@ def hybrid_inspect_dlp_job request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dlp/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dlp::V2::FinishDlpJobRequest.new + # + # # Call the finish_dlp_job method. + # result = client.finish_dlp_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def finish_dlp_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec b/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec index 801895449908..bcafebf4abad 100644 --- a/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec +++ b/google-cloud-document_ai-v1/google-cloud-document_ai-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb index 4a1b05e9da04..30321f0d595e 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb @@ -169,7 +169,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -2426,6 +2427,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DocumentProcessorService API. # diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb index 7368c260bb07..7c18bf854633 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb index 26cae0ebf717..0274b9b2d484 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb @@ -233,6 +233,22 @@ def initialize # @return [::Google::Cloud::DocumentAI::V1::ProcessResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse. + # p result + # def process_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -314,6 +330,29 @@ def process_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::BatchProcessRequest.new + # + # # Call the batch_process_documents method. + # result = client.batch_process_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_process_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -380,6 +419,22 @@ def batch_process_documents request, options = nil # @return [::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse. + # p result + # def fetch_processor_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -449,6 +504,26 @@ def fetch_processor_types request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest.new + # + # # Call the list_processor_types method. + # result = client.list_processor_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorType. + # p item + # end + # def list_processor_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -512,6 +587,22 @@ def list_processor_types request, options = nil # @return [::Google::Cloud::DocumentAI::V1::ProcessorType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorType. + # p result + # def get_processor_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -582,6 +673,26 @@ def get_processor_type request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Processor>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1::Processor. + # p item + # end + # def list_processors request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -645,6 +756,22 @@ def list_processors request, options = nil # @return [::Google::Cloud::DocumentAI::V1::Processor] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + # p result + # def get_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -724,6 +851,29 @@ def get_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def train_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -787,6 +937,22 @@ def train_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion. + # p result + # def get_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -858,6 +1024,26 @@ def get_processor_version request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::ProcessorVersion>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest.new + # + # # Call the list_processor_versions method. + # result = client.list_processor_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorVersion. + # p item + # end + # def list_processor_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -922,6 +1108,29 @@ def list_processor_versions request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest.new + # + # # Call the delete_processor_version method. + # result = client.delete_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -985,6 +1194,29 @@ def delete_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest.new + # + # # Call the deploy_processor_version method. + # result = client.deploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def deploy_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1048,6 +1280,29 @@ def deploy_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest.new + # + # # Call the undeploy_processor_version method. + # result = client.undeploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def undeploy_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1120,6 +1375,22 @@ def undeploy_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1::Processor] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + # p result + # def create_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1183,6 +1454,29 @@ def create_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1246,6 +1540,29 @@ def delete_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::EnableProcessorRequest.new + # + # # Call the enable_processor method. + # result = client.enable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def enable_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1309,6 +1626,29 @@ def enable_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::DisableProcessorRequest.new + # + # # Call the disable_processor method. + # result = client.disable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def disable_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1383,6 +1723,29 @@ def disable_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest.new + # + # # Call the set_default_processor_version method. + # result = client.set_default_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def set_default_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1457,6 +1820,29 @@ def set_default_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ReviewDocumentRequest.new + # + # # Call the review_document method. + # result = client.review_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def review_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1527,6 +1913,29 @@ def review_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def evaluate_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1592,6 +2001,22 @@ def evaluate_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1::Evaluation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1::Evaluation. + # p result + # def get_evaluation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1664,6 +2089,26 @@ def get_evaluation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1::Evaluation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1::Evaluation. + # p item + # end + # def list_evaluations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb index 598f98af3aad..16b6a1bf96b6 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec b/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec index 5e75e37a9b46..364e7462d316 100644 --- a/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec +++ b/google-cloud-document_ai-v1beta3/google-cloud-document_ai-v1beta3.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_dependency "google-cloud-location", ">= 0.4", "< 2.a" diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb index 130ef3667d52..bea00e0bab00 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb @@ -169,7 +169,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -2538,6 +2539,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DocumentProcessorService API. # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb index fc7a32e4077f..6c9c153dc13b 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb index eb16cec4d2fe..d7db1cf29d3e 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/client.rb @@ -238,6 +238,22 @@ def initialize # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + # + # # Call the process_document method. + # result = client.process_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + # p result + # def process_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -323,6 +339,29 @@ def process_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + # + # # Call the batch_process_documents method. + # result = client.batch_process_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_process_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -389,6 +428,22 @@ def batch_process_documents request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + # + # # Call the fetch_processor_types method. + # result = client.fetch_processor_types request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + # p result + # def fetch_processor_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -458,6 +513,26 @@ def fetch_processor_types request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + # + # # Call the list_processor_types method. + # result = client.list_processor_types request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p item + # end + # def list_processor_types request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -521,6 +596,22 @@ def list_processor_types request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorType] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorTypeRequest.new + # + # # Call the get_processor_type method. + # result = client.get_processor_type request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorType. + # p result + # def get_processor_type request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -591,6 +682,26 @@ def get_processor_type request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Processor>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + # p item + # end + # def list_processors request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -654,6 +765,22 @@ def list_processors request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # def get_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -733,6 +860,29 @@ def get_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def train_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -796,6 +946,22 @@ def train_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + # + # # Call the get_processor_version method. + # result = client.get_processor_version request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p result + # def get_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -867,6 +1033,26 @@ def get_processor_version request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + # + # # Call the list_processor_versions method. + # result = client.list_processor_versions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + # p item + # end + # def list_processor_versions request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -931,6 +1117,29 @@ def list_processor_versions request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + # + # # Call the delete_processor_version method. + # result = client.delete_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -994,6 +1203,29 @@ def delete_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + # + # # Call the deploy_processor_version method. + # result = client.deploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def deploy_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1057,6 +1289,29 @@ def deploy_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + # + # # Call the undeploy_processor_version method. + # result = client.undeploy_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def undeploy_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1129,6 +1384,22 @@ def undeploy_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::Processor] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + # p result + # def create_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1192,6 +1463,29 @@ def create_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1255,6 +1549,29 @@ def delete_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + # + # # Call the enable_processor method. + # result = client.enable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def enable_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1318,6 +1635,29 @@ def enable_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + # + # # Call the disable_processor method. + # result = client.disable_processor request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def disable_processor request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1392,6 +1732,29 @@ def disable_processor request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + # + # # Call the set_default_processor_version method. + # result = client.set_default_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def set_default_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1468,6 +1831,29 @@ def set_default_processor_version request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + # + # # Call the review_document method. + # result = client.review_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def review_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1538,6 +1924,29 @@ def review_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def evaluate_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1603,6 +2012,22 @@ def evaluate_processor_version request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p result + # def get_evaluation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1675,6 +2100,26 @@ def get_evaluation request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p item + # end + # def list_evaluations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1746,6 +2191,29 @@ def list_evaluations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportProcessorVersionRequest.new + # + # # Call the import_processor_version method. + # result = client.import_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_processor_version request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb index 0845f88bba69..03738013040f 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb index 3e8ea51395d8..a0a9f6d1221c 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/client.rb @@ -151,7 +151,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -856,6 +857,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the DocumentService API. # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb index 2e860e5e67a6..1ba5041bfcef 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb index fc604da1a667..efc1bf3c1911 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/client.rb @@ -193,6 +193,29 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetRequest.new + # + # # Call the update_dataset method. + # result = client.update_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_dataset request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -261,6 +284,29 @@ def update_dataset request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ImportDocumentsRequest.new + # + # # Call the import_documents method. + # result = client.import_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def import_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -334,6 +380,22 @@ def import_documents request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::GetDocumentResponse. + # p result + # def get_document request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -403,6 +465,29 @@ def get_document request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::BatchDeleteDocumentsRequest.new + # + # # Call the batch_delete_documents method. + # result = client.batch_delete_documents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def batch_delete_documents request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -470,6 +555,22 @@ def batch_delete_documents request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetDatasetSchemaRequest.new + # + # # Call the get_dataset_schema method. + # result = client.get_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # def get_dataset_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -535,6 +636,22 @@ def get_dataset_schema request, options = nil # @return [::Google::Cloud::DocumentAI::V1beta3::DatasetSchema] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::UpdateDatasetSchemaRequest.new + # + # # Call the update_dataset_schema method. + # result = client.update_dataset_schema request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::DatasetSchema. + # p result + # def update_dataset_schema request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb index 7e46bf032294..0c7e1e4b6223 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_service/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-domains-v1/google-cloud-domains-v1.gemspec b/google-cloud-domains-v1/google-cloud-domains-v1.gemspec index 981b256adacc..20a7d8273497 100644 --- a/google-cloud-domains-v1/google-cloud-domains-v1.gemspec +++ b/google-cloud-domains-v1/google-cloud-domains-v1.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" - gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a" + gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" gem.add_development_dependency "google-style", "~> 1.26.3" diff --git a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/client.rb b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/client.rb index 3965d5a776ba..44083e51a706 100644 --- a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/client.rb +++ b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/client.rb @@ -144,7 +144,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) end @@ -1813,6 +1814,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Domains API. # diff --git a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/operations.rb b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/operations.rb index 167120f3869e..225afeb69cbc 100644 --- a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/operations.rb +++ b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/operations.rb @@ -93,7 +93,8 @@ def initialize credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, - interceptors: @config.interceptors + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool ) # Used by an LRO wrapper for some methods of this service @@ -701,6 +702,14 @@ def rpcs end end + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + ## # Configuration RPC class for the Operations API. # diff --git a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/client.rb b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/client.rb index 6f621d9ee711..2e1bc43fadaa 100644 --- a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/client.rb +++ b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/client.rb @@ -181,6 +181,22 @@ def initialize # @return [::Google::Cloud::Domains::V1::SearchDomainsResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::SearchDomainsRequest.new + # + # # Call the search_domains method. + # result = client.search_domains request + # + # # The returned object is of type Google::Cloud::Domains::V1::SearchDomainsResponse. + # p result + # def search_domains request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -246,6 +262,22 @@ def search_domains request, options = nil # @return [::Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest.new + # + # # Call the retrieve_register_parameters method. + # result = client.retrieve_register_parameters request + # + # # The returned object is of type Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse. + # p result + # def retrieve_register_parameters request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +370,29 @@ def retrieve_register_parameters request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::RegisterDomainRequest.new + # + # # Call the register_domain method. + # result = client.register_domain request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def register_domain request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -408,6 +463,22 @@ def register_domain request, options = nil # @return [::Google::Cloud::Domains::V1::RetrieveTransferParametersResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::RetrieveTransferParametersRequest.new + # + # # Call the retrieve_transfer_parameters method. + # result = client.retrieve_transfer_parameters request + # + # # The returned object is of type Google::Cloud::Domains::V1::RetrieveTransferParametersResponse. + # p result + # def retrieve_transfer_parameters request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -512,6 +583,29 @@ def retrieve_transfer_parameters request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::TransferDomainRequest.new + # + # # Call the transfer_domain method. + # result = client.transfer_domain request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def transfer_domain request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -598,6 +692,26 @@ def transfer_domain request, options = nil # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Domains::V1::Registration>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ListRegistrationsRequest.new + # + # # Call the list_registrations method. + # result = client.list_registrations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Domains::V1::Registration. + # p item + # end + # def list_registrations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -662,6 +776,22 @@ def list_registrations request, options = nil # @return [::Google::Cloud::Domains::V1::Registration] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::GetRegistrationRequest.new + # + # # Call the get_registration method. + # result = client.get_registration request + # + # # The returned object is of type Google::Cloud::Domains::V1::Registration. + # p result + # def get_registration request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -733,6 +863,29 @@ def get_registration request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::UpdateRegistrationRequest.new + # + # # Call the update_registration method. + # result = client.update_registration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def update_registration request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -803,6 +956,29 @@ def update_registration request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest.new + # + # # Call the configure_management_settings method. + # result = client.configure_management_settings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def configure_management_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -881,6 +1057,29 @@ def configure_management_settings request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest.new + # + # # Call the configure_dns_settings method. + # result = client.configure_dns_settings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def configure_dns_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -957,6 +1156,29 @@ def configure_dns_settings request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ConfigureContactSettingsRequest.new + # + # # Call the configure_contact_settings method. + # result = client.configure_contact_settings request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def configure_contact_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1029,6 +1251,29 @@ def configure_contact_settings request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ExportRegistrationRequest.new + # + # # Call the export_registration method. + # result = client.export_registration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def export_registration request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1111,6 +1356,29 @@ def export_registration request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::DeleteRegistrationRequest.new + # + # # Call the delete_registration method. + # result = client.delete_registration request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def delete_registration request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1179,6 +1447,22 @@ def delete_registration request, options = nil # @return [::Google::Cloud::Domains::V1::AuthorizationCode] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest.new + # + # # Call the retrieve_authorization_code method. + # result = client.retrieve_authorization_code request + # + # # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. + # p result + # def retrieve_authorization_code request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -1245,6 +1529,22 @@ def retrieve_authorization_code request, options = nil # @return [::Google::Cloud::Domains::V1::AuthorizationCode] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/domains/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Domains::V1::Domains::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest.new + # + # # Call the reset_authorization_code method. + # result = client.reset_authorization_code request + # + # # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. + # p result + # def reset_authorization_code request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? diff --git a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/operations.rb b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/operations.rb index e062b9f6c85a..277db5ab28bb 100644 --- a/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/operations.rb +++ b/google-cloud-domains-v1/lib/google/cloud/domains/v1/domains/rest/operations.rb @@ -136,6 +136,26 @@ def initialize # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # def list_operations request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -201,6 +221,29 @@ def list_operations request, options = nil # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # def get_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -267,6 +310,22 @@ def get_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def delete_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? @@ -338,6 +397,22 @@ def delete_operation request, options = nil # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # def cancel_operation request, options = nil raise ::ArgumentError, "request must be provided" if request.nil?