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

docs: fix type annotations #4

Merged
merged 2 commits into from Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -19,10 +19,10 @@
from distutils import util
import os
import re
from typing import Callable, Dict, Sequence, Tuple, Type, Union
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
Expand Down Expand Up @@ -153,9 +153,9 @@ def parse_execution_path(path: str) -> Dict[str, str]:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
transport: Union[str, ExecutionsTransport] = None,
client_options: ClientOptions = None,
credentials: Optional[credentials.Credentials] = None,
transport: Union[str, ExecutionsTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the executions client.
Expand All @@ -169,8 +169,8 @@ def __init__(
transport (Union[str, ~.ExecutionsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
client_options (client_options_lib.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
environment variable can also be used to override the endpoint:
Expand All @@ -196,9 +196,9 @@ def __init__(
creation failed for any reason.
"""
if isinstance(client_options, dict):
client_options = ClientOptions.from_dict(client_options)
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = ClientOptions.ClientOptions()
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
Expand Down
Expand Up @@ -28,8 +28,8 @@
from google.auth import credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation
from google.api_core import operation_async
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.workflows_v1beta.services.workflows import pagers
from google.cloud.workflows_v1beta.types import workflows
from google.protobuf import empty_pb2 as empty # type: ignore
Expand Down
22 changes: 11 additions & 11 deletions google/cloud/workflows_v1beta/services/workflows/client.py
Expand Up @@ -19,10 +19,10 @@
from distutils import util
import os
import re
from typing import Callable, Dict, Sequence, Tuple, Type, Union
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
Expand All @@ -32,8 +32,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation
from google.api_core import operation_async
from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.workflows_v1beta.services.workflows import pagers
from google.cloud.workflows_v1beta.types import workflows
from google.protobuf import empty_pb2 as empty # type: ignore
Expand Down Expand Up @@ -155,9 +155,9 @@ def parse_workflow_path(path: str) -> Dict[str, str]:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
transport: Union[str, WorkflowsTransport] = None,
client_options: ClientOptions = None,
credentials: Optional[credentials.Credentials] = None,
transport: Union[str, WorkflowsTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the workflows client.
Expand All @@ -171,8 +171,8 @@ def __init__(
transport (Union[str, ~.WorkflowsTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
client_options (client_options_lib.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
environment variable can also be used to override the endpoint:
Expand All @@ -198,9 +198,9 @@ def __init__(
creation failed for any reason.
"""
if isinstance(client_options, dict):
client_options = ClientOptions.from_dict(client_options)
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = ClientOptions.ClientOptions()
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
Expand Down
115 changes: 114 additions & 1 deletion synth.metadata
Expand Up @@ -3,7 +3,16 @@
{
"git": {
"name": ".",
"remote": "sso://devrel/cloud/libraries/python/python-workflows"
"remote": "https://github.com/googleapis/python-workflows.git",
"sha": "ff52f3b063bdd0e84984c8256706b2a7eef59037"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "2987612c6aacc1857ee35468e7aeb1c393460799",
"internalRef": "333583499"
}
},
{
Expand Down Expand Up @@ -40,5 +49,109 @@
"generator": "bazel"
}
}
],
"generatedFiles": [
".flake8",
".github/CONTRIBUTING.md",
".github/ISSUE_TEMPLATE/bug_report.md",
".github/ISSUE_TEMPLATE/feature_request.md",
".github/ISSUE_TEMPLATE/support_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/release-please.yml",
".github/snippet-bot.yml",
".gitignore",
".kokoro/build.sh",
".kokoro/continuous/common.cfg",
".kokoro/continuous/continuous.cfg",
".kokoro/docker/docs/Dockerfile",
".kokoro/docker/docs/fetch_gpg_keys.sh",
".kokoro/docs/common.cfg",
".kokoro/docs/docs-presubmit.cfg",
".kokoro/docs/docs.cfg",
".kokoro/populate-secrets.sh",
".kokoro/presubmit/common.cfg",
".kokoro/presubmit/presubmit.cfg",
".kokoro/publish-docs.sh",
".kokoro/release.sh",
".kokoro/release/common.cfg",
".kokoro/release/release.cfg",
".kokoro/samples/lint/common.cfg",
".kokoro/samples/lint/continuous.cfg",
".kokoro/samples/lint/periodic.cfg",
".kokoro/samples/lint/presubmit.cfg",
".kokoro/samples/python3.6/common.cfg",
".kokoro/samples/python3.6/continuous.cfg",
".kokoro/samples/python3.6/periodic.cfg",
".kokoro/samples/python3.6/presubmit.cfg",
".kokoro/samples/python3.7/common.cfg",
".kokoro/samples/python3.7/continuous.cfg",
".kokoro/samples/python3.7/periodic.cfg",
".kokoro/samples/python3.7/presubmit.cfg",
".kokoro/samples/python3.8/common.cfg",
".kokoro/samples/python3.8/continuous.cfg",
".kokoro/samples/python3.8/periodic.cfg",
".kokoro/samples/python3.8/presubmit.cfg",
".kokoro/test-samples.sh",
".kokoro/trampoline.sh",
".kokoro/trampoline_v2.sh",
".trampolinerc",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.rst",
"LICENSE",
"MANIFEST.in",
"docs/_static/custom.css",
"docs/_templates/layout.html",
"docs/conf.py",
"docs/executions_v1beta/services.rst",
"docs/executions_v1beta/types.rst",
"docs/multiprocessing.rst",
"docs/workflows_v1beta/services.rst",
"docs/workflows_v1beta/types.rst",
"google/cloud/workflows/__init__.py",
"google/cloud/workflows/executions/__init__.py",
"google/cloud/workflows/executions/py.typed",
"google/cloud/workflows/executions_v1beta/__init__.py",
"google/cloud/workflows/executions_v1beta/py.typed",
"google/cloud/workflows/executions_v1beta/services/__init__.py",
"google/cloud/workflows/executions_v1beta/services/executions/__init__.py",
"google/cloud/workflows/executions_v1beta/services/executions/async_client.py",
"google/cloud/workflows/executions_v1beta/services/executions/client.py",
"google/cloud/workflows/executions_v1beta/services/executions/pagers.py",
"google/cloud/workflows/executions_v1beta/services/executions/transports/__init__.py",
"google/cloud/workflows/executions_v1beta/services/executions/transports/base.py",
"google/cloud/workflows/executions_v1beta/services/executions/transports/grpc.py",
"google/cloud/workflows/executions_v1beta/services/executions/transports/grpc_asyncio.py",
"google/cloud/workflows/executions_v1beta/types/__init__.py",
"google/cloud/workflows/executions_v1beta/types/executions.py",
"google/cloud/workflows/py.typed",
"google/cloud/workflows_v1beta/__init__.py",
"google/cloud/workflows_v1beta/py.typed",
"google/cloud/workflows_v1beta/services/__init__.py",
"google/cloud/workflows_v1beta/services/workflows/__init__.py",
"google/cloud/workflows_v1beta/services/workflows/async_client.py",
"google/cloud/workflows_v1beta/services/workflows/client.py",
"google/cloud/workflows_v1beta/services/workflows/pagers.py",
"google/cloud/workflows_v1beta/services/workflows/transports/__init__.py",
"google/cloud/workflows_v1beta/services/workflows/transports/base.py",
"google/cloud/workflows_v1beta/services/workflows/transports/grpc.py",
"google/cloud/workflows_v1beta/services/workflows/transports/grpc_asyncio.py",
"google/cloud/workflows_v1beta/types/__init__.py",
"google/cloud/workflows_v1beta/types/workflows.py",
"mypy.ini",
"noxfile.py",
"renovate.json",
"scripts/decrypt-secrets.sh",
"scripts/readme-gen/readme_gen.py",
"scripts/readme-gen/templates/README.tmpl.rst",
"scripts/readme-gen/templates/auth.tmpl.rst",
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
"scripts/readme-gen/templates/install_deps.tmpl.rst",
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
"setup.cfg",
"testing/.gitignore",
"tests/unit/gapic/executions_v1beta/__init__.py",
"tests/unit/gapic/executions_v1beta/test_executions.py",
"tests/unit/gapic/workflows_v1beta/__init__.py",
"tests/unit/gapic/workflows_v1beta/test_workflows.py"
]
}
2 changes: 1 addition & 1 deletion tests/unit/gapic/workflows_v1beta/test_workflows.py
Expand Up @@ -31,7 +31,7 @@
from google.api_core import gapic_v1
from google.api_core import grpc_helpers
from google.api_core import grpc_helpers_async
from google.api_core import operation_async
from google.api_core import operation_async # type: ignore
from google.api_core import operations_v1
from google.auth import credentials
from google.auth.exceptions import MutualTLSChannelError
Expand Down