Skip to content

Commit

Permalink
feat(translate): generate v3 (#9020)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 committed Oct 4, 2019
1 parent 7924508 commit 12a7f30
Show file tree
Hide file tree
Showing 21 changed files with 6,954 additions and 20 deletions.
6 changes: 6 additions & 0 deletions translate/docs/gapic/v3/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Client for Cloud Translation API
================================

.. automodule:: google.cloud.translate_v3
:members:
:inherited-members:
5 changes: 5 additions & 0 deletions translate/docs/gapic/v3/types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Types for Cloud Translation API Client
======================================

.. automodule:: google.cloud.translate_v3.types
:members:
26 changes: 13 additions & 13 deletions translate/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
.. include:: README.rst

Detailed Usage Guide
v2 Usage Guide
--------------------
.. toctree::
:maxdepth: 2

usage


API Reference
-------------

A new beta release, spelled ``v3beta1``, is provided to provide for preview
of upcoming features. In order to use this, you will want to import from
``google.cloud.translate_v3beta1`` in lieu of ``google.cloud.translate``.

.. toctree::
:maxdepth: 2
An API and type reference is provided for ``v3``, ``v3beta1``, and ``v2``.

gapic/v3beta1/api
gapic/v3beta1/types
By default, you will get ``v3``. A beta release, spelled ``v3beta1`` is
provided for preview of upcoming features. In order to use this, you will
want to import from ``google.cloud.translate_v3beta1`` in lieu of
``google.cloud.translate``. The previous release ``v2`` is also available.
Import from ``google.cloud.translate_v2`` to use this release.

An API and type reference is provided for v2:

.. toctree::
:maxdepth: 2

client
:maxdepth: 2

v3
v3beta1
v2


Changelog
Expand Down
7 changes: 7 additions & 0 deletions translate/docs/v2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
v2
===

.. toctree::
:maxdepth: 2

client
8 changes: 8 additions & 0 deletions translate/docs/v3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
v3
===

.. toctree::
:maxdepth: 2

gapic/v3/api
gapic/v3/types
8 changes: 8 additions & 0 deletions translate/docs/v3beta1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
v3beta1
=======

.. toctree::
:maxdepth: 2

gapic/v3beta1/api
gapic/v3beta1/types
30 changes: 30 additions & 0 deletions translate/google/cloud/translate_v3/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


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")
Empty file.
91 changes: 91 additions & 0 deletions translate/google/cloud/translate_v3/gapic/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Wrappers for protocol buffer enum types."""

import enum


class BatchTranslateMetadata(object):
class State(enum.IntEnum):
"""
State of the job.
Attributes:
STATE_UNSPECIFIED (int): Invalid.
RUNNING (int): Request is being processed.
SUCCEEDED (int): The batch is processed, and at least one item was successfully
processed.
FAILED (int): The batch is done and no item was successfully processed.
CANCELLING (int): Request is in the process of being canceled after caller invoked
longrunning.Operations.CancelOperation on the request id.
CANCELLED (int): The batch is done after the user has called the
longrunning.Operations.CancelOperation. Any records processed before the
cancel command are output as specified in the request.
"""

STATE_UNSPECIFIED = 0
RUNNING = 1
SUCCEEDED = 2
FAILED = 3
CANCELLING = 4
CANCELLED = 5


class CreateGlossaryMetadata(object):
class State(enum.IntEnum):
"""
Enumerates the possible states that the creation request can be in.
Attributes:
STATE_UNSPECIFIED (int): Invalid.
RUNNING (int): Request is being processed.
SUCCEEDED (int): The glossary was successfully created.
FAILED (int): Failed to create the glossary.
CANCELLING (int): Request is in the process of being canceled after caller invoked
longrunning.Operations.CancelOperation on the request id.
CANCELLED (int): The glossary creation request was successfully canceled.
"""

STATE_UNSPECIFIED = 0
RUNNING = 1
SUCCEEDED = 2
FAILED = 3
CANCELLING = 4
CANCELLED = 5


class DeleteGlossaryMetadata(object):
class State(enum.IntEnum):
"""
Enumerates the possible states that the creation request can be in.
Attributes:
STATE_UNSPECIFIED (int): Invalid.
RUNNING (int): Request is being processed.
SUCCEEDED (int): The glossary was successfully deleted.
FAILED (int): Failed to delete the glossary.
CANCELLING (int): Request is in the process of being canceled after caller invoked
longrunning.Operations.CancelOperation on the request id.
CANCELLED (int): The glossary deletion request was successfully canceled.
"""

STATE_UNSPECIFIED = 0
RUNNING = 1
SUCCEEDED = 2
FAILED = 3
CANCELLING = 4
CANCELLED = 5

0 comments on commit 12a7f30

Please sign in to comment.