Documentation

Google_Service_Translate_Resource_Projects extends Google_Service_Resource
in package

The "projects" collection of methods.

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

Table of Contents

$client  : Google_Client
$methods  : array<string|int, mixed>
$resourceName  : string
$rootUrl  : string
$serviceName  : string
$servicePath  : string
$stackParameters  : mixed
__construct()  : mixed
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. (projects.detectLanguage)
getSupportedLanguages()  : Google_Service_Translate_SupportedLanguages
Returns a list of supported languages for translation.
translateText()  : Google_Service_Translate_TranslateTextResponse
Translates input text and returns translated text. (projects.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

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. (projects.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

(projects.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 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.

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.

Return values
Google_Service_Translate_SupportedLanguages

translateText()

Translates input text and returns translated text. (projects.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