lib/google/cloud/dataqna/v1alpha/question_service/client.rb in google-cloud-dataqna-v1alpha-0.2.4 vs lib/google/cloud/dataqna/v1alpha/question_service/client.rb in google-cloud-dataqna-v1alpha-0.2.5

- old
+ new

@@ -199,10 +199,25 @@ # # @return [::Google::Cloud::DataQnA::V1alpha::Question] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/dataqna/v1alpha" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new + # + # # Call the get_question method. + # result = client.get_question request + # + # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + # p result + # def get_question request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataQnA::V1alpha::GetQuestionRequest @@ -216,13 +231,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_question.timeout, metadata: metadata, @@ -270,10 +287,25 @@ # # @return [::Google::Cloud::DataQnA::V1alpha::Question] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/dataqna/v1alpha" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new + # + # # Call the create_question method. + # result = client.create_question request + # + # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + # p result + # def create_question request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest @@ -287,13 +319,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "parent" => request.parent - } + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_question.timeout, metadata: metadata, @@ -341,10 +375,25 @@ # # @return [::Google::Cloud::DataQnA::V1alpha::Question] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/dataqna/v1alpha" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new + # + # # Call the execute_question method. + # result = client.execute_question request + # + # # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + # p result + # def execute_question request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest @@ -358,13 +407,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.execute_question.timeout, metadata: metadata, @@ -411,10 +462,25 @@ # # @return [::Google::Cloud::DataQnA::V1alpha::UserFeedback] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/dataqna/v1alpha" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new + # + # # Call the get_user_feedback method. + # result = client.get_user_feedback request + # + # # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. + # p result + # def get_user_feedback request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest @@ -428,13 +494,15 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "name" => request.name - } + header_params = {} + if request.name + header_params["name"] = request.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_user_feedback.timeout, metadata: metadata, @@ -485,10 +553,25 @@ # # @return [::Google::Cloud::DataQnA::V1alpha::UserFeedback] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # + # @example Basic example + # require "google/cloud/dataqna/v1alpha" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new + # + # # Call the update_user_feedback method. + # result = client.update_user_feedback request + # + # # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. + # p result + # def update_user_feedback request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest @@ -502,12 +585,14 @@ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::DataQnA::V1alpha::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - header_params = { - "user_feedback.name" => request.user_feedback.name - } + header_params = {} + if request.user_feedback&.name + header_params["user_feedback.name"] = request.user_feedback.name + end + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_user_feedback.timeout, metadata: metadata,