NAME
Google::Cloud::Language::V2 - Client library for Google Cloud Services
SYNOPSIS
use Google::Cloud::Language::V2;
use Google::Auth;
my $auth = Google::Auth->default();
# 1. High-performance gRPC Transport (Default)
my $grpc_client = Google::Cloud::Language::V2->new(
credentials => $auth,
transport => 'grpc', # Optional: 'grpc' is default
);
# 2. HTTP/REST Transport
my $rest_client = Google::Cloud::Language::V2->new(
credentials => $auth,
transport => 'rest',
);
# Execute service methods
my $res = $grpc_client->some_method( %params );
DESCRIPTION
Google::Cloud::Language::V2 is an auto-generated client library for Google Cloud Services.
It provides a unified client interface supporting both high-performance HTTP/2 gRPC and HTTP/REST transports, with automatic Google Cloud Application Default Credentials (ADC) resolution and typed Protocol Buffers message handling.
SOURCE
Generated from the following Protocol Buffers schemas:
googleapis/google/cloud/language/v2/language_service.proto
CONSTRUCTOR
new
my $client = Google::Cloud::Language::V2->new(
credentials => $auth, # Optional: Google::Auth object (defaults to ADC)
transport => 'grpc', # Optional: 'grpc' (default) or 'rest'
);
ATTRIBUTES
credentials
Returns or accepts the Google::Auth credentials object.
transport
Returns or accepts the active transport object (Google::gRPC::Client or Google::Cloud::REST::Client).
METHODS
METHODS
The following RPC methods are available in this client:
analyze_sentiment
my $response = $client->analyze_sentiment( document => $document, encoding_type => $encoding_type, );Calls the RPC method
AnalyzeSentimentongoogle.cloud.language.v2.LanguageService.Request: Google::Cloud::Language::V2::LanguageService::AnalyzeSentimentRequest
Returns: Google::Cloud::Language::V2::LanguageService::AnalyzeSentimentResponse
Parameters:
document- Google::Cloud::Language::V2::LanguageService::Documentencoding_type- Google::Cloud::Language::V2::LanguageService::EncodingType
analyze_entities
my $response = $client->analyze_entities( document => $document, encoding_type => $encoding_type, );Calls the RPC method
AnalyzeEntitiesongoogle.cloud.language.v2.LanguageService.Request: Google::Cloud::Language::V2::LanguageService::AnalyzeEntitiesRequest
Returns: Google::Cloud::Language::V2::LanguageService::AnalyzeEntitiesResponse
Parameters:
document- Google::Cloud::Language::V2::LanguageService::Documentencoding_type- Google::Cloud::Language::V2::LanguageService::EncodingType
classify_text
my $response = $client->classify_text( document => $document, );Calls the RPC method
ClassifyTextongoogle.cloud.language.v2.LanguageService.Request: Google::Cloud::Language::V2::LanguageService::ClassifyTextRequest
Returns: Google::Cloud::Language::V2::LanguageService::ClassifyTextResponse
Parameters:
moderate_text
my $response = $client->moderate_text( document => $document, model_version => $model_version, );Calls the RPC method
ModerateTextongoogle.cloud.language.v2.LanguageService.Request: Google::Cloud::Language::V2::LanguageService::ModerateTextRequest
Returns: Google::Cloud::Language::V2::LanguageService::ModerateTextResponse
Parameters:
document- Google::Cloud::Language::V2::LanguageService::Documentmodel_version- Google::Cloud::Language::V2::LanguageService::ModelVersion
annotate_text
my $response = $client->annotate_text( document => $document, features => $features, encoding_type => $encoding_type, );Calls the RPC method
AnnotateTextongoogle.cloud.language.v2.LanguageService.Request: Google::Cloud::Language::V2::LanguageService::AnnotateTextRequest
Returns: Google::Cloud::Language::V2::LanguageService::AnnotateTextResponse
Parameters:
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.