Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
chore: upgrade gapic-generator-python to 0.39.1 (#16)
Browse files Browse the repository at this point in the history
feat: add 'from_service_account_info' factory to clients
fix: fix sphinx identifiers
PiperOrigin-RevId: 350246057

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Jan 5 16:44:11 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 520682435235d9c503983a360a2090025aa47cd1
Source-Link: googleapis/googleapis@5206824

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
yoshi-automation and busunkim96 committed Jan 21, 2021
1 parent ccddf06 commit 887df00
Show file tree
Hide file tree
Showing 18 changed files with 284 additions and 157 deletions.
18 changes: 18 additions & 0 deletions .coveragerc
@@ -0,0 +1,18 @@
[run]
branch = True

[report]
fail_under = 100
show_missing = True
omit =
google/cloud/workflows/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
11 changes: 11 additions & 0 deletions docs/executions_v1beta/executions.rst
@@ -0,0 +1,11 @@
Executions
----------------------------

.. automodule:: google.cloud.workflows.executions_v1beta.services.executions
:members:
:inherited-members:


.. automodule:: google.cloud.workflows.executions_v1beta.services.executions.pagers
:members:
:inherited-members:
6 changes: 3 additions & 3 deletions docs/executions_v1beta/services.rst
@@ -1,6 +1,6 @@
Services for Google Cloud Workflows Executions v1beta API
=========================================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.workflows.executions_v1beta.services.executions
:members:
:inherited-members:
executions
1 change: 1 addition & 0 deletions docs/executions_v1beta/types.rst
Expand Up @@ -3,4 +3,5 @@ Types for Google Cloud Workflows Executions v1beta API

.. automodule:: google.cloud.workflows.executions_v1beta.types
:members:
:undoc-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions docs/workflows_v1beta/services.rst
@@ -1,6 +1,6 @@
Services for Google Cloud Workflows v1beta API
==============================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.workflows_v1beta.services.workflows
:members:
:inherited-members:
workflows
1 change: 1 addition & 0 deletions docs/workflows_v1beta/types.rst
Expand Up @@ -3,4 +3,5 @@ Types for Google Cloud Workflows v1beta API

.. automodule:: google.cloud.workflows_v1beta.types
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/workflows_v1beta/workflows.rst
@@ -0,0 +1,11 @@
Workflows
---------------------------

.. automodule:: google.cloud.workflows_v1beta.services.workflows
:members:
:inherited-members:


.. automodule:: google.cloud.workflows_v1beta.services.workflows.pagers
:members:
:inherited-members:
Expand Up @@ -76,6 +76,7 @@ class ExecutionsAsyncClient:
ExecutionsClient.parse_common_location_path
)

from_service_account_info = ExecutionsClient.from_service_account_info
from_service_account_file = ExecutionsClient.from_service_account_file
from_service_account_json = from_service_account_file

Expand Down Expand Up @@ -156,7 +157,7 @@ async def list_executions(
first).
Args:
request (:class:`~.executions.ListExecutionsRequest`):
request (:class:`google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest`):
The request object. Request for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Expand All @@ -165,6 +166,7 @@ async def list_executions(
which the executions should be listed.
Format:
projects/{project}/locations/{location}/workflows/{workflow}
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -176,10 +178,10 @@ async def list_executions(
sent along with the request as metadata.
Returns:
~.pagers.ListExecutionsAsyncPager:
google.cloud.workflows.executions_v1beta.services.executions.pagers.ListExecutionsAsyncPager:
Response for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -243,7 +245,7 @@ async def create_execution(
the given workflow.
Args:
request (:class:`~.executions.CreateExecutionRequest`):
request (:class:`google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest`):
The request object. Request for the
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
method.
Expand All @@ -254,10 +256,11 @@ async def create_execution(
projects/{project}/locations/{location}/workflows/{workflow}
The latest revision of the workflow will
be used.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
execution (:class:`~.executions.Execution`):
execution (:class:`google.cloud.workflows.executions_v1beta.types.Execution`):
Required. Execution to be created.
This corresponds to the ``execution`` field
on the ``request`` instance; if ``request`` is provided, this
Expand All @@ -270,7 +273,7 @@ async def create_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down Expand Up @@ -327,14 +330,15 @@ async def get_execution(
r"""Returns an execution of the given name.
Args:
request (:class:`~.executions.GetExecutionRequest`):
request (:class:`google.cloud.workflows.executions_v1beta.types.GetExecutionRequest`):
The request object. Request for the
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
method.
name (:class:`str`):
Required. Name of the execution to be
retrieved. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -346,7 +350,7 @@ async def get_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down Expand Up @@ -401,14 +405,15 @@ async def cancel_execution(
r"""Cancels an execution of the given name.
Args:
request (:class:`~.executions.CancelExecutionRequest`):
request (:class:`google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest`):
The request object. Request for the
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
method.
name (:class:`str`):
Required. Name of the execution to be
cancelled. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -420,7 +425,7 @@ async def cancel_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down
Expand Up @@ -112,6 +112,22 @@ def _get_default_mtls_endpoint(api_endpoint):
DEFAULT_ENDPOINT
)

@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.
Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.
Returns:
ExecutionsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_info(info)
kwargs["credentials"] = credentials
return cls(*args, **kwargs)

@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
Expand All @@ -124,7 +140,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
kwargs: Additional arguments to pass to the constructor.
Returns:
{@api.name}: The constructed client.
ExecutionsClient: The constructed client.
"""
credentials = service_account.Credentials.from_service_account_file(filename)
kwargs["credentials"] = credentials
Expand Down Expand Up @@ -250,10 +266,10 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
transport (Union[str, ~.ExecutionsTransport]): The
transport (Union[str, ExecutionsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (client_options_lib.ClientOptions): Custom options for the
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -367,15 +383,16 @@ def list_executions(
first).
Args:
request (:class:`~.executions.ListExecutionsRequest`):
request (google.cloud.workflows.executions_v1beta.types.ListExecutionsRequest):
The request object. Request for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
parent (:class:`str`):
parent (str):
Required. Name of the workflow for
which the executions should be listed.
Format:
projects/{project}/locations/{location}/workflows/{workflow}
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -387,10 +404,10 @@ def list_executions(
sent along with the request as metadata.
Returns:
~.pagers.ListExecutionsPager:
google.cloud.workflows.executions_v1beta.services.executions.pagers.ListExecutionsPager:
Response for the
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
[ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
method.
Iterating over this object will yield results and
resolve additional pages automatically.
Expand Down Expand Up @@ -455,21 +472,22 @@ def create_execution(
the given workflow.
Args:
request (:class:`~.executions.CreateExecutionRequest`):
request (google.cloud.workflows.executions_v1beta.types.CreateExecutionRequest):
The request object. Request for the
[CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
method.
parent (:class:`str`):
parent (str):
Required. Name of the workflow for
which an execution should be created.
Format:
projects/{project}/locations/{location}/workflows/{workflow}
The latest revision of the workflow will
be used.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
execution (:class:`~.executions.Execution`):
execution (google.cloud.workflows.executions_v1beta.types.Execution):
Required. Execution to be created.
This corresponds to the ``execution`` field
on the ``request`` instance; if ``request`` is provided, this
Expand All @@ -482,7 +500,7 @@ def create_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down Expand Up @@ -540,14 +558,15 @@ def get_execution(
r"""Returns an execution of the given name.
Args:
request (:class:`~.executions.GetExecutionRequest`):
request (google.cloud.workflows.executions_v1beta.types.GetExecutionRequest):
The request object. Request for the
[GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
method.
name (:class:`str`):
name (str):
Required. Name of the execution to be
retrieved. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -559,7 +578,7 @@ def get_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down Expand Up @@ -615,14 +634,15 @@ def cancel_execution(
r"""Cancels an execution of the given name.
Args:
request (:class:`~.executions.CancelExecutionRequest`):
request (google.cloud.workflows.executions_v1beta.types.CancelExecutionRequest):
The request object. Request for the
[CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
method.
name (:class:`str`):
name (str):
Required. Name of the execution to be
cancelled. Format:
projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -634,7 +654,7 @@ def cancel_execution(
sent along with the request as metadata.
Returns:
~.executions.Execution:
google.cloud.workflows.executions_v1beta.types.Execution:
A running instance of a
[Workflow][google.cloud.workflows.v1beta.Workflow].
Expand Down

0 comments on commit 887df00

Please sign in to comment.