diff --git a/packages/google-cloud-language/google/cloud/language_v1/gapic/enums.py b/packages/google-cloud-language/google/cloud/language_v1/gapic/enums.py index 2432cf84a711..dcd23c41470c 100644 --- a/packages/google-cloud-language/google/cloud/language_v1/gapic/enums.py +++ b/packages/google-cloud-language/google/cloud/language_v1/gapic/enums.py @@ -21,23 +21,23 @@ class EncodingType(enum.IntEnum): """ Represents the text encoding that the caller uses to process the output. - Providing an ``EncodingType`` is recommended because the API provides the - beginning offsets for various outputs, such as tokens and mentions, and - languages that natively use different text encodings may access offsets - differently. + Providing an ``EncodingType`` is recommended because the API provides + the beginning offsets for various outputs, such as tokens and mentions, + and languages that natively use different text encodings may access + offsets differently. Attributes: - NONE (int): If ``EncodingType`` is not specified, encoding-dependent information (such as - ``begin_offset``) will be set at ``-1``. - UTF8 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-8 encoding of the input. C++ and Go are examples of languages - that use this encoding natively. - UTF16 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-16 encoding of the input. Java and Javascript are examples of + NONE (int): If ``EncodingType`` is not specified, encoding-dependent information + (such as ``begin_offset``) will be set at ``-1``. + UTF8 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively. - UTF32 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-32 encoding of the input. Python is an example of a language - that uses this encoding natively. + UTF16 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-16 encoding of the input. Java and Javascript are + examples of languages that use this encoding natively. + UTF32 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-32 encoding of the input. Python is an example of a + language that uses this encoding natively. """ NONE = 0 UTF8 = 1 diff --git a/packages/google-cloud-language/google/cloud/language_v1/gapic/language_service_client.py b/packages/google-cloud-language/google/cloud/language_v1/gapic/language_service_client.py index 15e5367032b8..b4cdae03c39c 100644 --- a/packages/google-cloud-language/google/cloud/language_v1/gapic/language_service_client.py +++ b/packages/google-cloud-language/google/cloud/language_v1/gapic/language_service_client.py @@ -138,9 +138,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC @@ -171,13 +172,14 @@ def analyze_sentiment(self, >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_sentiment(document) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` encoding_type (~google.cloud.language_v1.types.EncodingType): The encoding type used by the API to calculate sentence offsets. @@ -235,13 +237,14 @@ def analyze_entities(self, >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_entities(document) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` encoding_type (~google.cloud.language_v1.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -299,13 +302,14 @@ def analyze_entity_sentiment( >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_entity_sentiment(document) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` encoding_type (~google.cloud.language_v1.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -363,13 +367,14 @@ def analyze_syntax(self, >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_syntax(document) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` encoding_type (~google.cloud.language_v1.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -423,13 +428,14 @@ def classify_text(self, >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.classify_text(document) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -482,19 +488,21 @@ def annotate_text(self, >>> >>> client = language_v1.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> - >>> # TODO: Initialize ``features``: + >>> # TODO: Initialize `features`: >>> features = {} >>> >>> response = client.annotate_text(document, features) Args: document (Union[dict, ~google.cloud.language_v1.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Document` features (Union[dict, ~google.cloud.language_v1.types.Features]): The enabled features. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1.types.Features` encoding_type (~google.cloud.language_v1.types.EncodingType): The encoding type used by the API to calculate offsets. diff --git a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/enums.py b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/enums.py index 2432cf84a711..dcd23c41470c 100644 --- a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/enums.py +++ b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/enums.py @@ -21,23 +21,23 @@ class EncodingType(enum.IntEnum): """ Represents the text encoding that the caller uses to process the output. - Providing an ``EncodingType`` is recommended because the API provides the - beginning offsets for various outputs, such as tokens and mentions, and - languages that natively use different text encodings may access offsets - differently. + Providing an ``EncodingType`` is recommended because the API provides + the beginning offsets for various outputs, such as tokens and mentions, + and languages that natively use different text encodings may access + offsets differently. Attributes: - NONE (int): If ``EncodingType`` is not specified, encoding-dependent information (such as - ``begin_offset``) will be set at ``-1``. - UTF8 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-8 encoding of the input. C++ and Go are examples of languages - that use this encoding natively. - UTF16 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-16 encoding of the input. Java and Javascript are examples of + NONE (int): If ``EncodingType`` is not specified, encoding-dependent information + (such as ``begin_offset``) will be set at ``-1``. + UTF8 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively. - UTF32 (int): Encoding-dependent information (such as ``begin_offset``) is calculated based - on the UTF-32 encoding of the input. Python is an example of a language - that uses this encoding natively. + UTF16 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-16 encoding of the input. Java and Javascript are + examples of languages that use this encoding natively. + UTF32 (int): Encoding-dependent information (such as ``begin_offset``) is calculated + based on the UTF-32 encoding of the input. Python is an example of a + language that uses this encoding natively. """ NONE = 0 UTF8 = 1 diff --git a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/language_service_client.py b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/language_service_client.py index a7b3c560c172..4bc82b53f3a9 100644 --- a/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/language_service_client.py +++ b/packages/google-cloud-language/google/cloud/language_v1beta2/gapic/language_service_client.py @@ -138,9 +138,10 @@ def __init__(self, ) if client_info is None: - client_info = ( - google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) - client_info.gapic_version = _GAPIC_LIBRARY_VERSION + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION, ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION self._client_info = client_info # Parse out the default settings for retry and timeout for each RPC @@ -171,13 +172,14 @@ def analyze_sentiment(self, >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_sentiment(document) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` encoding_type (~google.cloud.language_v1beta2.types.EncodingType): The encoding type used by the API to calculate sentence offsets for the @@ -236,13 +238,14 @@ def analyze_entities(self, >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_entities(document) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` encoding_type (~google.cloud.language_v1beta2.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -300,13 +303,14 @@ def analyze_entity_sentiment( >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_entity_sentiment(document) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` encoding_type (~google.cloud.language_v1beta2.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -364,13 +368,14 @@ def analyze_syntax(self, >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.analyze_syntax(document) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` encoding_type (~google.cloud.language_v1beta2.types.EncodingType): The encoding type used by the API to calculate offsets. @@ -424,13 +429,14 @@ def classify_text(self, >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> >>> response = client.classify_text(document) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -483,19 +489,21 @@ def annotate_text(self, >>> >>> client = language_v1beta2.LanguageServiceClient() >>> - >>> # TODO: Initialize ``document``: + >>> # TODO: Initialize `document`: >>> document = {} >>> - >>> # TODO: Initialize ``features``: + >>> # TODO: Initialize `features`: >>> features = {} >>> >>> response = client.annotate_text(document, features) Args: document (Union[dict, ~google.cloud.language_v1beta2.types.Document]): Input document. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Document` features (Union[dict, ~google.cloud.language_v1beta2.types.Features]): The enabled features. + If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.language_v1beta2.types.Features` encoding_type (~google.cloud.language_v1beta2.types.EncodingType): The encoding type used by the API to calculate offsets.