Documentation

Google_Service_Translate_Resource_ProjectsLocations extends Google_Service_Resource
in package

The "locations" collection of methods.

Typical usage is: $translateService = new Google_Service_Translate(...); $locations = $translateService->locations;

Table of Contents

$client  : Google_Client
$methods  : array<string|int, mixed>
$resourceName  : string
$rootUrl  : string
$serviceName  : string
$servicePath  : string
$stackParameters  : mixed
__construct()  : mixed
batchTranslateText()  : Google_Service_Translate_Operation
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. (locations.batchTranslateText)
call()  : Google_Http_Request|expectedClass
TODO: This function needs simplifying.
createRequestUri()  : string
Parse/expand request parameters and create a fully qualified request uri.
detectLanguage()  : Google_Service_Translate_DetectLanguageResponse
Detects the language of text within a request. (locations.detectLanguage)
get()  : Google_Service_Translate_Location
Gets information about a location. (locations.get)
getSupportedLanguages()  : Google_Service_Translate_SupportedLanguages
Returns a list of supported languages for translation.
listProjectsLocations()  : Google_Service_Translate_ListLocationsResponse
Lists information about the supported locations for this service.
translateText()  : Google_Service_Translate_TranslateTextResponse
Translates input text and returns translated text. (locations.translateText)
convertToArrayAndStripNulls()  : mixed

Properties

$methods

private array<string|int, mixed> $methods

$resourceName

private string $resourceName

$serviceName

private string $serviceName

$servicePath

private string $servicePath

$stackParameters

private mixed $stackParameters = array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))

Methods

__construct()

public __construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
$service : mixed
$serviceName : mixed
$resourceName : mixed
$resource : mixed
Return values
mixed

batchTranslateText()

Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. (locations.batchTranslateText)

public batchTranslateText(string $parent, Google_Service_Translate_BatchTranslateTextRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Translate_Operation
Parameters
$parent : string

Required. Location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations /{location-id}. The global location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

$postBody : Google_Service_Translate_BatchTranslateTextRequest
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_Translate_Operation

call()

TODO: This function needs simplifying.

public call( $name,  $arguments[,  $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
$name :
$arguments :
$expectedClass : = null
  • optional, the expected class name
Tags
throws
Google_Exception
Return values
Google_Http_Request|expectedClass

createRequestUri()

Parse/expand request parameters and create a fully qualified request uri.

public createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
$restPath : string
$params : array<string|int, mixed>
Tags
static
Return values
string

$requestUrl

detectLanguage()

Detects the language of text within a request. (locations.detectLanguage)

public detectLanguage(string $parent, Google_Service_Translate_DetectLanguageRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Translate_DetectLanguageResponse
Parameters
$parent : string

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or- id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects /{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

$postBody : Google_Service_Translate_DetectLanguageRequest
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_Translate_DetectLanguageResponse

getSupportedLanguages()

Returns a list of supported languages for translation.

public getSupportedLanguages(string $parent[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Translate_SupportedLanguages

(locations.getSupportedLanguages)

Parameters
$parent : string

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project- number-or-id}. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

$optParams : array<string|int, mixed> = array()

Optional parameters.

Tags
opt_param

string model Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models: projects /{project-number-or-id}/locations/{location-id}/models/{model-id} - General (built-in) models: projects/{project-number-or-id}/locations/{location- id}/models/general/nmt, projects/{project-number-or-id}/locations /{location-id}/models/general/base Returns languages supported by the specified model. If missing, we get supported languages of Google general base (PBMT) model.

opt_param

string displayLanguageCode Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

Return values
Google_Service_Translate_SupportedLanguages

listProjectsLocations()

Lists information about the supported locations for this service.

public listProjectsLocations(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Translate_ListLocationsResponse

(locations.listProjectsLocations)

Parameters
$name : string

The resource that owns the locations collection, if applicable.

$optParams : array<string|int, mixed> = array()

Optional parameters.

Tags
opt_param

int pageSize The standard list page size.

opt_param

string pageToken The standard list page token.

opt_param

string filter The standard list filter.

Return values
Google_Service_Translate_ListLocationsResponse

translateText()

Translates input text and returns translated text. (locations.translateText)

public translateText(string $parent, Google_Service_Translate_TranslateTextRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Translate_TranslateTextResponse
Parameters
$parent : string

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project- number-or-id}. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

$postBody : Google_Service_Translate_TranslateTextRequest
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_Translate_TranslateTextResponse

convertToArrayAndStripNulls()

protected convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
$o : mixed
Return values
mixed

Search results