lib/google/cloud/language/v2/language_service/rest/client.rb in google-cloud-language-v2-0.1.0 vs lib/google/cloud/language/v2/language_service/rest/client.rb in google-cloud-language-v2-0.2.0

- old
+ new

@@ -186,10 +186,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Language::V2::AnalyzeSentimentResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/language/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Language::V2::LanguageService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Language::V2::AnalyzeSentimentRequest.new + # + # # Call the analyze_sentiment method. + # result = client.analyze_sentiment request + # + # # The returned object is of type Google::Cloud::Language::V2::AnalyzeSentimentResponse. + # p result + # def analyze_sentiment request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V2::AnalyzeSentimentRequest @@ -252,10 +268,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Language::V2::AnalyzeEntitiesResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/language/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Language::V2::LanguageService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Language::V2::AnalyzeEntitiesRequest.new + # + # # Call the analyze_entities method. + # result = client.analyze_entities request + # + # # The returned object is of type Google::Cloud::Language::V2::AnalyzeEntitiesResponse. + # p result + # def analyze_entities request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V2::AnalyzeEntitiesRequest @@ -314,10 +346,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Language::V2::ClassifyTextResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/language/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Language::V2::LanguageService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Language::V2::ClassifyTextRequest.new + # + # # Call the classify_text method. + # result = client.classify_text request + # + # # The returned object is of type Google::Cloud::Language::V2::ClassifyTextResponse. + # p result + # def classify_text request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V2::ClassifyTextRequest @@ -376,10 +424,26 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Language::V2::ModerateTextResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/language/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Language::V2::LanguageService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Language::V2::ModerateTextRequest.new + # + # # Call the moderate_text method. + # result = client.moderate_text request + # + # # The returned object is of type Google::Cloud::Language::V2::ModerateTextResponse. + # p result + # def moderate_text request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V2::ModerateTextRequest @@ -442,9 +506,25 @@ # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Language::V2::AnnotateTextResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/language/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Language::V2::LanguageService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Language::V2::AnnotateTextRequest.new + # + # # Call the annotate_text method. + # result = client.annotate_text request + # + # # The returned object is of type Google::Cloud::Language::V2::AnnotateTextResponse. + # p result + # def annotate_text request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V2::AnnotateTextRequest