Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(translate): update docstrings, client confg (via synth) #9411

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions translate/google/cloud/translate_v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
from __future__ import absolute_import

from google.cloud.translate_v3 import types
from google.cloud.translate_v3.gapic import enums
from google.cloud.translate_v3.gapic import translation_service_client


class TranslationServiceClient(translation_service_client.TranslationServiceClient):
__doc__ = translation_service_client.TranslationServiceClient.__doc__
enums = enums


__all__ = ("enums", "types", "TranslationServiceClient")
__all__ = ("types", "TranslationServiceClient")
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import google.api_core.protobuf_helpers
import grpc

from google.cloud.translate_v3.gapic import enums
from google.cloud.translate_v3.gapic import translation_service_client_config
from google.cloud.translate_v3.gapic.transports import (
translation_service_grpc_transport,
Expand Down Expand Up @@ -251,11 +250,12 @@ def translate_text(
parent (str): Required. Project or location to make a call. Must refer to a caller's
project.

Format: ``projects/{project-id}`` or
``projects/{project-id}/locations/{location-id}``.
Format: ``projects/{project-number-or-id}`` or
``projects/{project-number-or-id}/locations/{location-id}``.

For global calls, use ``projects/{project-id}/locations/global`` or
``projects/{project-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.
Expand All @@ -274,15 +274,15 @@ def translate_text(
The format depends on model type:

- AutoML Translation models:
``projects/{project-id}/locations/{location-id}/models/{model-id}``
``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}``

- General (built-in) models:
``projects/{project-id}/locations/{location-id}/models/general/nmt``,
``projects/{project-id}/locations/{location-id}/models/general/base``
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``

For global (non-regionalized) requests, use ``location-id`` ``global``.
For example,
``projects/{project-id}/locations/global/models/general/nmt``.
``projects/{project-number-or-id}/locations/global/models/general/nmt``.

If missing, the system decides which google base model to use.
glossary_config (Union[dict, ~google.cloud.translate_v3.types.TranslateTextGlossaryConfig]): Optional. Glossary to be applied. The glossary must be within the same
Expand All @@ -298,7 +298,7 @@ def translate_text(
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.

See https://goo.gl/xmQnxf for more information on and examples of labels.
See https://cloud.google.com/translate/docs/labels for more information.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -383,21 +383,22 @@ def detect_language(
parent (str): Required. Project or location to make a call. Must refer to a caller's
project.

Format: ``projects/{project-id}/locations/{location-id}`` or
``projects/{project-id}``.
Format: ``projects/{project-number-or-id}/locations/{location-id}`` or
``projects/{project-number-or-id}``.

For global calls, use ``projects/{project-id}/locations/global`` or
``projects/{project-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.
model (str): Optional. The language detection model to be used.

Format:
``projects/{project-id}/locations/{location-id}/models/language-detection/{model-id}``
``projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}``

Only one language detection model is currently supported:
``projects/{project-id}/locations/{location-id}/models/language-detection/default``.
``projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default``.

If not specified, the default model is used.
content (str): The content of the input stored as a string.
Expand All @@ -410,7 +411,7 @@ def detect_language(
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.

See https://goo.gl/xmQnxf for more information on and examples of labels.
See https://cloud.google.com/translate/docs/labels for more information.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -494,11 +495,12 @@ def get_supported_languages(
parent (str): Required. Project or location to make a call. Must refer to a caller's
project.

Format: ``projects/{project-id}`` or
``projects/{project-id}/locations/{location-id}``.
Format: ``projects/{project-number-or-id}`` or
``projects/{project-number-or-id}/locations/{location-id}``.

For global calls, use ``projects/{project-id}/locations/global`` or
``projects/{project-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.

Expand All @@ -512,11 +514,11 @@ def get_supported_languages(
The format depends on model type:

- AutoML Translation models:
``projects/{project-id}/locations/{location-id}/models/{model-id}``
``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}``

- General (built-in) models:
``projects/{project-id}/locations/{location-id}/models/general/nmt``,
``projects/{project-id}/locations/{location-id}/models/general/base``
``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.
Expand Down Expand Up @@ -626,7 +628,7 @@ def batch_translate_text(
Args:
parent (str): Required. Location to make a call. Must refer to a caller's project.

Format: ``projects/{project-id}/locations/{location-id}``.
Format: ``projects/{project-number-or-id}/locations/{location-id}``.

The ``global`` location is not supported for batch translation.

Expand Down Expand Up @@ -655,11 +657,11 @@ def batch_translate_text(
The value format depends on model type:

- AutoML Translation models:
``projects/{project-id}/locations/{location-id}/models/{model-id}``
``projects/{project-number-or-id}/locations/{location-id}/models/{model-id}``

- General (built-in) models:
``projects/{project-id}/locations/{location-id}/models/general/nmt``,
``projects/{project-id}/locations/{location-id}/models/general/base``
``projects/{project-number-or-id}/locations/{location-id}/models/general/nmt``,
``projects/{project-number-or-id}/locations/{location-id}/models/general/base``

If the map is empty or a specific model is not requested for a language
pair, then default google model (nmt) is used.
Expand All @@ -675,7 +677,7 @@ def batch_translate_text(
characters, underscores and dashes. International characters are allowed.
Label values are optional. Label keys must start with a letter.

See https://goo.gl/xmQnxf for more information on and examples of labels.
See https://cloud.google.com/translate/docs/labels for more information.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"DeleteGlossary": {
"timeout_millis": 60000,
"retry_codes_name": "idempotent",
"retry_codes_name": "non_idempotent",
"retry_params_name": "default",
},
},
Expand Down