diff --git a/.flake8 b/.flake8
index 29227d4..2e43874 100644
--- a/.flake8
+++ b/.flake8
@@ -16,7 +16,7 @@
# Generated by synthtool. DO NOT EDIT!
[flake8]
-ignore = E203, E266, E501, W503
+ignore = E203, E231, E266, E501, W503
exclude =
# Exclude generated code.
**/proto/**
diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index 44c78f7..bc893c9 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,4 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
- digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3
+ digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
+# created: 2022-04-06T10:30:21.687684602Z
diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml
new file mode 100644
index 0000000..41bff0b
--- /dev/null
+++ b/.github/auto-label.yaml
@@ -0,0 +1,15 @@
+# Copyright 2022 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
+#
+# http://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.
+requestsize:
+ enabled: true
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 62eb5a7..46d2371 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -22,7 +22,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
- rev: 19.10b0
+ rev: 22.3.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0db5d77..08cb000 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog
+### [1.3.3](https://github.com/googleapis/python-appengine-admin/compare/v1.3.2...v1.3.3) (2022-04-14)
+
+
+### Documentation
+
+* fix type in docstring for map fields ([b0ce988](https://github.com/googleapis/python-appengine-admin/commit/b0ce988cf7ec3620d6d586abab8b13de50e8b586))
+
### [1.3.2](https://github.com/googleapis/python-appengine-admin/compare/v1.3.1...v1.3.2) (2022-03-05)
diff --git a/docs/conf.py b/docs/conf.py
index 4b413e4..0d9d28a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -361,7 +361,10 @@
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
- "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
+ "google.api_core": (
+ "https://googleapis.dev/python/google-api-core/latest/",
+ None,
+ ),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
diff --git a/google/cloud/appengine_admin_v1/services/applications/async_client.py b/google/cloud/appengine_admin_v1/services/applications/async_client.py
index 26e842b..56b440f 100644
--- a/google/cloud/appengine_admin_v1/services/applications/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/applications/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -263,7 +263,12 @@ def sample_get_application():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -288,7 +293,6 @@ async def create_application(
`Managing Projects, Applications, and
Billing `__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -341,7 +345,12 @@ def sample_create_application():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -370,7 +379,6 @@ async def update_application(
- ``default_cookie_expiration`` - Cookie expiration policy for
the application.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -429,7 +437,12 @@ def sample_update_application():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -462,7 +475,6 @@ async def repair_application(
. If the deletion was recent, the numeric ID can be found in the
Cloud Console Activity Log.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -521,7 +533,12 @@ def sample_repair_application():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/applications/client.py b/google/cloud/appengine_admin_v1/services/applications/client.py
index f5cd4cc..a7639dd 100644
--- a/google/cloud/appengine_admin_v1/services/applications/client.py
+++ b/google/cloud/appengine_admin_v1/services/applications/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -57,7 +57,10 @@ class ApplicationsClientMeta(type):
_transport_registry["grpc"] = ApplicationsGrpcTransport
_transport_registry["grpc_asyncio"] = ApplicationsGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[ApplicationsTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[ApplicationsTransport]:
"""Returns an appropriate transport class.
Args:
@@ -162,7 +165,9 @@ def transport(self) -> ApplicationsTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -175,9 +180,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -186,9 +195,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -197,9 +210,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -208,10 +225,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -449,7 +470,12 @@ def sample_get_application():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -474,7 +500,6 @@ def create_application(
`Managing Projects, Applications, and
Billing `__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -528,7 +553,12 @@ def sample_create_application():
rpc = self._transport._wrapped_methods[self._transport.create_application]
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -557,7 +587,6 @@ def update_application(
- ``default_cookie_expiration`` - Cookie expiration policy for
the application.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -617,7 +646,12 @@ def sample_update_application():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -650,7 +684,6 @@ def repair_application(
. If the deletion was recent, the numeric ID can be found in the
Cloud Console Activity Log.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -710,7 +743,12 @@ def sample_repair_application():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/applications/transports/base.py b/google/cloud/appengine_admin_v1/services/applications/transports/base.py
index 943e943..646f4b5 100644
--- a/google/cloud/appengine_admin_v1/services/applications/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/applications/transports/base.py
@@ -87,6 +87,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -128,25 +129,33 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.get_application: gapic_v1.method.wrap_method(
- self.get_application, default_timeout=None, client_info=client_info,
+ self.get_application,
+ default_timeout=None,
+ client_info=client_info,
),
self.create_application: gapic_v1.method.wrap_method(
- self.create_application, default_timeout=None, client_info=client_info,
+ self.create_application,
+ default_timeout=None,
+ client_info=client_info,
),
self.update_application: gapic_v1.method.wrap_method(
- self.update_application, default_timeout=None, client_info=client_info,
+ self.update_application,
+ default_timeout=None,
+ client_info=client_info,
),
self.repair_application: gapic_v1.method.wrap_method(
- self.repair_application, default_timeout=None, client_info=client_info,
+ self.repair_application,
+ default_timeout=None,
+ client_info=client_info,
),
}
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -191,5 +200,9 @@ def repair_application(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("ApplicationsTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py b/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py
index 0ceb1a5..cc65019 100644
--- a/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -379,5 +378,9 @@ def repair_application(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("ApplicationsGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py b/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py
index b56f780..ab172ac 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -219,7 +219,6 @@ async def list_authorized_certificates(
r"""Lists all SSL certificates the user is authorized to
administer.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -276,12 +275,20 @@ def sample_list_authorized_certificates():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListAuthorizedCertificatesAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -352,7 +359,12 @@ def sample_get_authorized_certificate():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -422,7 +434,12 @@ def sample_create_authorized_certificate():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -442,7 +459,6 @@ async def update_authorized_certificate(
certificate. The certificate ``display_name`` may also be
updated.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -498,7 +514,12 @@ def sample_update_authorized_certificate():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -557,7 +578,10 @@ def sample_delete_authorized_certificate():
# Send the request.
await rpc(
- request, retry=retry, timeout=timeout, metadata=metadata,
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
)
async def __aenter__(self):
diff --git a/google/cloud/appengine_admin_v1/services/authorized_certificates/client.py b/google/cloud/appengine_admin_v1/services/authorized_certificates/client.py
index 329bae4..4ad2d1e 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_certificates/client.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_certificates/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -58,7 +58,8 @@ class AuthorizedCertificatesClientMeta(type):
_transport_registry["grpc_asyncio"] = AuthorizedCertificatesGrpcAsyncIOTransport
def get_transport_class(
- cls, label: str = None,
+ cls,
+ label: str = None,
) -> Type[AuthorizedCertificatesTransport]:
"""Returns an appropriate transport class.
@@ -167,7 +168,9 @@ def transport(self) -> AuthorizedCertificatesTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -180,9 +183,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -191,9 +198,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -202,9 +213,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -213,10 +228,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -401,7 +420,6 @@ def list_authorized_certificates(
r"""Lists all SSL certificates the user is authorized to
administer.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -461,12 +479,20 @@ def sample_list_authorized_certificates():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListAuthorizedCertificatesPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -540,7 +566,12 @@ def sample_get_authorized_certificate():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -613,7 +644,12 @@ def sample_create_authorized_certificate():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -633,7 +669,6 @@ def update_authorized_certificate(
certificate. The certificate ``display_name`` may also be
updated.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -692,7 +727,12 @@ def sample_update_authorized_certificate():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -754,7 +794,10 @@ def sample_delete_authorized_certificate():
# Send the request.
rpc(
- request, retry=retry, timeout=timeout, metadata=metadata,
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
)
def __enter__(self):
diff --git a/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/base.py b/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/base.py
index 425e0e5..5a69af8 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/base.py
@@ -86,6 +86,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -156,9 +157,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -219,5 +220,9 @@ def delete_authorized_certificate(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("AuthorizedCertificatesTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc.py b/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc.py
index a03c4b2..7601960 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -388,5 +387,9 @@ def delete_authorized_certificate(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("AuthorizedCertificatesGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py b/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py
index 810256e..ed3bd05 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -215,7 +215,6 @@ async def list_authorized_domains(
r"""Lists all domains the user is authorized to
administer.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -272,12 +271,20 @@ def sample_list_authorized_domains():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListAuthorizedDomainsAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
diff --git a/google/cloud/appengine_admin_v1/services/authorized_domains/client.py b/google/cloud/appengine_admin_v1/services/authorized_domains/client.py
index 052b6ac..23e7bbe 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_domains/client.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_domains/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -57,7 +57,8 @@ class AuthorizedDomainsClientMeta(type):
_transport_registry["grpc_asyncio"] = AuthorizedDomainsGrpcAsyncIOTransport
def get_transport_class(
- cls, label: str = None,
+ cls,
+ label: str = None,
) -> Type[AuthorizedDomainsTransport]:
"""Returns an appropriate transport class.
@@ -166,7 +167,9 @@ def transport(self) -> AuthorizedDomainsTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -179,9 +182,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -190,9 +197,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -201,9 +212,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -212,10 +227,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -400,7 +419,6 @@ def list_authorized_domains(
r"""Lists all domains the user is authorized to
administer.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -458,12 +476,20 @@ def sample_list_authorized_domains():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListAuthorizedDomainsPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
diff --git a/google/cloud/appengine_admin_v1/services/authorized_domains/transports/base.py b/google/cloud/appengine_admin_v1/services/authorized_domains/transports/base.py
index c6b4408..a1ba556 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_domains/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_domains/transports/base.py
@@ -84,6 +84,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -134,9 +135,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -152,5 +153,9 @@ def list_authorized_domains(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("AuthorizedDomainsTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc.py b/google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc.py
index b3aa2d5..d240b77 100644
--- a/google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc.py
@@ -226,8 +226,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -263,5 +262,9 @@ def list_authorized_domains(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("AuthorizedDomainsGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py b/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py
index 0d7bd05..f7f3838 100644
--- a/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -270,12 +270,20 @@ def sample_list_domain_mappings():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListDomainMappingsAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -343,7 +351,12 @@ def sample_get_domain_mapping():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -361,7 +374,6 @@ async def create_domain_mapping(
list of available authorized domains, see
```AuthorizedDomains.ListAuthorizedDomains`` <>`__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -421,7 +433,12 @@ def sample_create_domain_mapping():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -448,7 +465,6 @@ async def update_domain_mapping(
administer the associated domain in order to update a
``DomainMapping`` resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -508,7 +524,12 @@ def sample_update_domain_mapping():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -533,7 +554,6 @@ async def delete_domain_mapping(
to administer the associated domain in order to delete a
``DomainMapping`` resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -603,7 +623,12 @@ def sample_delete_domain_mapping():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/domain_mappings/client.py b/google/cloud/appengine_admin_v1/services/domain_mappings/client.py
index 66624e5..74d81ae 100644
--- a/google/cloud/appengine_admin_v1/services/domain_mappings/client.py
+++ b/google/cloud/appengine_admin_v1/services/domain_mappings/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -60,7 +60,10 @@ class DomainMappingsClientMeta(type):
_transport_registry["grpc"] = DomainMappingsGrpcTransport
_transport_registry["grpc_asyncio"] = DomainMappingsGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[DomainMappingsTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[DomainMappingsTransport]:
"""Returns an appropriate transport class.
Args:
@@ -165,7 +168,9 @@ def transport(self) -> DomainMappingsTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -178,9 +183,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -189,9 +198,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -200,9 +213,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -211,10 +228,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -454,12 +475,20 @@ def sample_list_domain_mappings():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListDomainMappingsPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -528,7 +557,12 @@ def sample_get_domain_mapping():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -546,7 +580,6 @@ def create_domain_mapping(
list of available authorized domains, see
```AuthorizedDomains.ListAuthorizedDomains`` <>`__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -607,7 +640,12 @@ def sample_create_domain_mapping():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -634,7 +672,6 @@ def update_domain_mapping(
administer the associated domain in order to update a
``DomainMapping`` resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -695,7 +732,12 @@ def sample_update_domain_mapping():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -720,7 +762,6 @@ def delete_domain_mapping(
to administer the associated domain in order to delete a
``DomainMapping`` resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -791,7 +832,12 @@ def sample_delete_domain_mapping():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/domain_mappings/transports/base.py b/google/cloud/appengine_admin_v1/services/domain_mappings/transports/base.py
index 1c3cf92..8732532 100644
--- a/google/cloud/appengine_admin_v1/services/domain_mappings/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/domain_mappings/transports/base.py
@@ -87,6 +87,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -133,7 +134,9 @@ def _prep_wrapped_messages(self, client_info):
client_info=client_info,
),
self.get_domain_mapping: gapic_v1.method.wrap_method(
- self.get_domain_mapping, default_timeout=None, client_info=client_info,
+ self.get_domain_mapping,
+ default_timeout=None,
+ client_info=client_info,
),
self.create_domain_mapping: gapic_v1.method.wrap_method(
self.create_domain_mapping,
@@ -155,9 +158,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -214,5 +217,9 @@ def delete_domain_mapping(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("DomainMappingsTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc.py b/google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc.py
index bac6281..368a4ed 100644
--- a/google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -390,5 +389,9 @@ def delete_domain_mapping(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("DomainMappingsGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/firewall/async_client.py b/google/cloud/appengine_admin_v1/services/firewall/async_client.py
index 5f617a6..45508d8 100644
--- a/google/cloud/appengine_admin_v1/services/firewall/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/firewall/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -269,12 +269,20 @@ def sample_list_ingress_rules():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListIngressRulesAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -296,7 +304,6 @@ async def batch_update_ingress_rules(
IP range, then an "allow all" rule is explicitly added to the
end of the list.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -347,7 +354,12 @@ def sample_batch_update_ingress_rules():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -416,7 +428,12 @@ def sample_create_ingress_rule():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -485,7 +502,12 @@ def sample_get_ingress_rule():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -554,7 +576,12 @@ def sample_update_ingress_rule():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -613,7 +640,10 @@ def sample_delete_ingress_rule():
# Send the request.
await rpc(
- request, retry=retry, timeout=timeout, metadata=metadata,
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
)
async def __aenter__(self):
diff --git a/google/cloud/appengine_admin_v1/services/firewall/client.py b/google/cloud/appengine_admin_v1/services/firewall/client.py
index 391c84f..f9a4604 100644
--- a/google/cloud/appengine_admin_v1/services/firewall/client.py
+++ b/google/cloud/appengine_admin_v1/services/firewall/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -54,7 +54,10 @@ class FirewallClientMeta(type):
_transport_registry["grpc"] = FirewallGrpcTransport
_transport_registry["grpc_asyncio"] = FirewallGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[FirewallTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[FirewallTransport]:
"""Returns an appropriate transport class.
Args:
@@ -170,7 +173,9 @@ def transport(self) -> FirewallTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -183,9 +188,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -194,9 +203,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -205,9 +218,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -216,10 +233,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -459,12 +480,20 @@ def sample_list_ingress_rules():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListIngressRulesPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -486,7 +515,6 @@ def batch_update_ingress_rules(
IP range, then an "allow all" rule is explicitly added to the
end of the list.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -540,7 +568,12 @@ def sample_batch_update_ingress_rules():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -610,7 +643,12 @@ def sample_create_ingress_rule():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -680,7 +718,12 @@ def sample_get_ingress_rule():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -750,7 +793,12 @@ def sample_update_ingress_rule():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -810,7 +858,10 @@ def sample_delete_ingress_rule():
# Send the request.
rpc(
- request, retry=retry, timeout=timeout, metadata=metadata,
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
)
def __enter__(self):
diff --git a/google/cloud/appengine_admin_v1/services/firewall/transports/base.py b/google/cloud/appengine_admin_v1/services/firewall/transports/base.py
index 20c50f9..1a5df11 100644
--- a/google/cloud/appengine_admin_v1/services/firewall/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/firewall/transports/base.py
@@ -86,6 +86,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -127,7 +128,9 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.list_ingress_rules: gapic_v1.method.wrap_method(
- self.list_ingress_rules, default_timeout=None, client_info=client_info,
+ self.list_ingress_rules,
+ default_timeout=None,
+ client_info=client_info,
),
self.batch_update_ingress_rules: gapic_v1.method.wrap_method(
self.batch_update_ingress_rules,
@@ -135,25 +138,33 @@ def _prep_wrapped_messages(self, client_info):
client_info=client_info,
),
self.create_ingress_rule: gapic_v1.method.wrap_method(
- self.create_ingress_rule, default_timeout=None, client_info=client_info,
+ self.create_ingress_rule,
+ default_timeout=None,
+ client_info=client_info,
),
self.get_ingress_rule: gapic_v1.method.wrap_method(
- self.get_ingress_rule, default_timeout=None, client_info=client_info,
+ self.get_ingress_rule,
+ default_timeout=None,
+ client_info=client_info,
),
self.update_ingress_rule: gapic_v1.method.wrap_method(
- self.update_ingress_rule, default_timeout=None, client_info=client_info,
+ self.update_ingress_rule,
+ default_timeout=None,
+ client_info=client_info,
),
self.delete_ingress_rule: gapic_v1.method.wrap_method(
- self.delete_ingress_rule, default_timeout=None, client_info=client_info,
+ self.delete_ingress_rule,
+ default_timeout=None,
+ client_info=client_info,
),
}
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -217,5 +228,9 @@ def delete_ingress_rule(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("FirewallTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/firewall/transports/grpc.py b/google/cloud/appengine_admin_v1/services/firewall/transports/grpc.py
index ee5d9fd..259d8ab 100644
--- a/google/cloud/appengine_admin_v1/services/firewall/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/firewall/transports/grpc.py
@@ -236,8 +236,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -410,5 +409,9 @@ def delete_ingress_rule(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("FirewallGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/instances/async_client.py b/google/cloud/appengine_admin_v1/services/instances/async_client.py
index 0cf56c8..4108316 100644
--- a/google/cloud/appengine_admin_v1/services/instances/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/instances/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -216,7 +216,6 @@ async def list_instances(
`Stackdriver Monitoring
API `__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -272,12 +271,20 @@ def sample_list_instances():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListInstancesAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -346,7 +353,12 @@ def sample_get_instance():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -375,7 +387,6 @@ async def delete_instance(
```apps.services.versions.patch`` `__
method.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -445,7 +456,12 @@ def sample_delete_instance():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -477,7 +493,6 @@ async def debug_instance(
Only applicable for instances in App Engine flexible
environment.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -536,7 +551,12 @@ def sample_debug_instance():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/instances/client.py b/google/cloud/appengine_admin_v1/services/instances/client.py
index e79fa4c..0cfc8bb 100644
--- a/google/cloud/appengine_admin_v1/services/instances/client.py
+++ b/google/cloud/appengine_admin_v1/services/instances/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -59,7 +59,10 @@ class InstancesClientMeta(type):
_transport_registry["grpc"] = InstancesGrpcTransport
_transport_registry["grpc_asyncio"] = InstancesGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[InstancesTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[InstancesTransport]:
"""Returns an appropriate transport class.
Args:
@@ -164,10 +167,18 @@ def transport(self) -> InstancesTransport:
return self._transport
@staticmethod
- def instance_path(app: str, service: str, version: str, instance: str,) -> str:
+ def instance_path(
+ app: str,
+ service: str,
+ version: str,
+ instance: str,
+ ) -> str:
"""Returns a fully-qualified instance string."""
return "apps/{app}/services/{service}/versions/{version}/instances/{instance}".format(
- app=app, service=service, version=version, instance=instance,
+ app=app,
+ service=service,
+ version=version,
+ instance=instance,
)
@staticmethod
@@ -180,7 +191,9 @@ def parse_instance_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -193,9 +206,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -204,9 +221,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -215,9 +236,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -226,10 +251,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -417,7 +446,6 @@ def list_instances(
`Stackdriver Monitoring
API `__.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -474,12 +502,20 @@ def sample_list_instances():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListInstancesPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -549,7 +585,12 @@ def sample_get_instance():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -578,7 +619,6 @@ def delete_instance(
```apps.services.versions.patch`` `__
method.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -649,7 +689,12 @@ def sample_delete_instance():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -681,7 +726,6 @@ def debug_instance(
Only applicable for instances in App Engine flexible
environment.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -741,7 +785,12 @@ def sample_debug_instance():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/instances/transports/base.py b/google/cloud/appengine_admin_v1/services/instances/transports/base.py
index d323957..05142c4 100644
--- a/google/cloud/appengine_admin_v1/services/instances/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/instances/transports/base.py
@@ -87,6 +87,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -128,25 +129,33 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.list_instances: gapic_v1.method.wrap_method(
- self.list_instances, default_timeout=None, client_info=client_info,
+ self.list_instances,
+ default_timeout=None,
+ client_info=client_info,
),
self.get_instance: gapic_v1.method.wrap_method(
- self.get_instance, default_timeout=None, client_info=client_info,
+ self.get_instance,
+ default_timeout=None,
+ client_info=client_info,
),
self.delete_instance: gapic_v1.method.wrap_method(
- self.delete_instance, default_timeout=None, client_info=client_info,
+ self.delete_instance,
+ default_timeout=None,
+ client_info=client_info,
),
self.debug_instance: gapic_v1.method.wrap_method(
- self.debug_instance, default_timeout=None, client_info=client_info,
+ self.debug_instance,
+ default_timeout=None,
+ client_info=client_info,
),
}
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -193,5 +202,9 @@ def debug_instance(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("InstancesTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/instances/transports/grpc.py b/google/cloud/appengine_admin_v1/services/instances/transports/grpc.py
index 5813009..65243b6 100644
--- a/google/cloud/appengine_admin_v1/services/instances/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/instances/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -380,5 +379,9 @@ def debug_instance(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("InstancesGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/services/async_client.py b/google/cloud/appengine_admin_v1/services/services/async_client.py
index 43daaa3..c73da6d 100644
--- a/google/cloud/appengine_admin_v1/services/services/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/services/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -263,12 +263,20 @@ def sample_list_services():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListServicesAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -285,7 +293,6 @@ async def get_service(
r"""Gets the current configuration of the specified
service.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -348,7 +355,12 @@ def sample_get_service():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -428,7 +440,12 @@ def sample_update_service():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -452,7 +469,6 @@ async def delete_service(
r"""Deletes the specified service and all enclosed
versions.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -522,7 +538,12 @@ def sample_delete_service():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/services/client.py b/google/cloud/appengine_admin_v1/services/services/client.py
index ce1c133..fc289ad 100644
--- a/google/cloud/appengine_admin_v1/services/services/client.py
+++ b/google/cloud/appengine_admin_v1/services/services/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -59,7 +59,10 @@ class ServicesClientMeta(type):
_transport_registry["grpc"] = ServicesGrpcTransport
_transport_registry["grpc_asyncio"] = ServicesGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[ServicesTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[ServicesTransport]:
"""Returns an appropriate transport class.
Args:
@@ -164,7 +167,9 @@ def transport(self) -> ServicesTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -177,9 +182,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -188,9 +197,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -199,9 +212,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -210,10 +227,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -453,12 +474,20 @@ def sample_list_services():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListServicesPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -475,7 +504,6 @@ def get_service(
r"""Gets the current configuration of the specified
service.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -539,7 +567,12 @@ def sample_get_service():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -620,7 +653,12 @@ def sample_update_service():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -644,7 +682,6 @@ def delete_service(
r"""Deletes the specified service and all enclosed
versions.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -715,7 +752,12 @@ def sample_delete_service():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/services/transports/base.py b/google/cloud/appengine_admin_v1/services/services/transports/base.py
index db2a930..5d763b4 100644
--- a/google/cloud/appengine_admin_v1/services/services/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/services/transports/base.py
@@ -87,6 +87,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -128,25 +129,33 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.list_services: gapic_v1.method.wrap_method(
- self.list_services, default_timeout=None, client_info=client_info,
+ self.list_services,
+ default_timeout=None,
+ client_info=client_info,
),
self.get_service: gapic_v1.method.wrap_method(
- self.get_service, default_timeout=None, client_info=client_info,
+ self.get_service,
+ default_timeout=None,
+ client_info=client_info,
),
self.update_service: gapic_v1.method.wrap_method(
- self.update_service, default_timeout=None, client_info=client_info,
+ self.update_service,
+ default_timeout=None,
+ client_info=client_info,
),
self.delete_service: gapic_v1.method.wrap_method(
- self.delete_service, default_timeout=None, client_info=client_info,
+ self.delete_service,
+ default_timeout=None,
+ client_info=client_info,
),
}
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -193,5 +202,9 @@ def delete_service(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("ServicesTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/services/transports/grpc.py b/google/cloud/appengine_admin_v1/services/services/transports/grpc.py
index 6cbbd1e..31bd346 100644
--- a/google/cloud/appengine_admin_v1/services/services/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/services/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -353,5 +352,9 @@ def delete_service(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("ServicesGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/versions/async_client.py b/google/cloud/appengine_admin_v1/services/versions/async_client.py
index 55194ca..3265a5a 100644
--- a/google/cloud/appengine_admin_v1/services/versions/async_client.py
+++ b/google/cloud/appengine_admin_v1/services/versions/async_client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
@@ -266,12 +266,20 @@ def sample_list_versions():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListVersionsAsyncPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -289,7 +297,6 @@ async def get_version(
``BASIC_VIEW`` will be returned. Specify the ``FULL_VIEW``
parameter to get the full resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -343,7 +350,12 @@ def sample_get_version():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -416,7 +428,12 @@ def sample_create_version():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -474,7 +491,6 @@ async def update_version(
- ```manual_scaling.instances`` `__
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -533,7 +549,12 @@ def sample_update_version():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
@@ -625,7 +646,12 @@ def sample_delete_version():
)
# Send the request.
- response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = await rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = operation_async.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/versions/client.py b/google/cloud/appengine_admin_v1/services/versions/client.py
index 9b2fae9..297e033 100644
--- a/google/cloud/appengine_admin_v1/services/versions/client.py
+++ b/google/cloud/appengine_admin_v1/services/versions/client.py
@@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
-from typing import Dict, Optional, Sequence, Tuple, Type, Union
+from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
@@ -62,7 +62,10 @@ class VersionsClientMeta(type):
_transport_registry["grpc"] = VersionsGrpcTransport
_transport_registry["grpc_asyncio"] = VersionsGrpcAsyncIOTransport
- def get_transport_class(cls, label: str = None,) -> Type[VersionsTransport]:
+ def get_transport_class(
+ cls,
+ label: str = None,
+ ) -> Type[VersionsTransport]:
"""Returns an appropriate transport class.
Args:
@@ -167,7 +170,9 @@ def transport(self) -> VersionsTransport:
return self._transport
@staticmethod
- def common_billing_account_path(billing_account: str,) -> str:
+ def common_billing_account_path(
+ billing_account: str,
+ ) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
@@ -180,9 +185,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_folder_path(folder: str,) -> str:
+ def common_folder_path(
+ folder: str,
+ ) -> str:
"""Returns a fully-qualified folder string."""
- return "folders/{folder}".format(folder=folder,)
+ return "folders/{folder}".format(
+ folder=folder,
+ )
@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -191,9 +200,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_organization_path(organization: str,) -> str:
+ def common_organization_path(
+ organization: str,
+ ) -> str:
"""Returns a fully-qualified organization string."""
- return "organizations/{organization}".format(organization=organization,)
+ return "organizations/{organization}".format(
+ organization=organization,
+ )
@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -202,9 +215,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_project_path(project: str,) -> str:
+ def common_project_path(
+ project: str,
+ ) -> str:
"""Returns a fully-qualified project string."""
- return "projects/{project}".format(project=project,)
+ return "projects/{project}".format(
+ project=project,
+ )
@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -213,10 +230,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}
@staticmethod
- def common_location_path(project: str, location: str,) -> str:
+ def common_location_path(
+ project: str,
+ location: str,
+ ) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
@staticmethod
@@ -456,12 +477,20 @@ def sample_list_versions():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListVersionsPager(
- method=rpc, request=request, response=response, metadata=metadata,
+ method=rpc,
+ request=request,
+ response=response,
+ metadata=metadata,
)
# Done; return the response.
@@ -479,7 +508,6 @@ def get_version(
``BASIC_VIEW`` will be returned. Specify the ``FULL_VIEW``
parameter to get the full resource.
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -534,7 +562,12 @@ def sample_get_version():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Done; return the response.
return response
@@ -608,7 +641,12 @@ def sample_create_version():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -666,7 +704,6 @@ def update_version(
- ```manual_scaling.instances`` `__
-
.. code-block:: python
from google.cloud import appengine_admin_v1
@@ -726,7 +763,12 @@ def sample_update_version():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
@@ -819,7 +861,12 @@ def sample_delete_version():
)
# Send the request.
- response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
+ response = rpc(
+ request,
+ retry=retry,
+ timeout=timeout,
+ metadata=metadata,
+ )
# Wrap the response in an operation future.
response = gac_operation.from_gapic(
diff --git a/google/cloud/appengine_admin_v1/services/versions/transports/base.py b/google/cloud/appengine_admin_v1/services/versions/transports/base.py
index ad363b9..1ccc203 100644
--- a/google/cloud/appengine_admin_v1/services/versions/transports/base.py
+++ b/google/cloud/appengine_admin_v1/services/versions/transports/base.py
@@ -87,6 +87,7 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
"""
+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
@@ -128,28 +129,38 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.list_versions: gapic_v1.method.wrap_method(
- self.list_versions, default_timeout=None, client_info=client_info,
+ self.list_versions,
+ default_timeout=None,
+ client_info=client_info,
),
self.get_version: gapic_v1.method.wrap_method(
- self.get_version, default_timeout=None, client_info=client_info,
+ self.get_version,
+ default_timeout=None,
+ client_info=client_info,
),
self.create_version: gapic_v1.method.wrap_method(
- self.create_version, default_timeout=None, client_info=client_info,
+ self.create_version,
+ default_timeout=None,
+ client_info=client_info,
),
self.update_version: gapic_v1.method.wrap_method(
- self.update_version, default_timeout=None, client_info=client_info,
+ self.update_version,
+ default_timeout=None,
+ client_info=client_info,
),
self.delete_version: gapic_v1.method.wrap_method(
- self.delete_version, default_timeout=None, client_info=client_info,
+ self.delete_version,
+ default_timeout=None,
+ client_info=client_info,
),
}
def close(self):
"""Closes resources associated with the transport.
- .. warning::
- Only call this method if the transport is NOT shared
- with other clients - this may cause errors in other clients!
+ .. warning::
+ Only call this method if the transport is NOT shared
+ with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()
@@ -205,5 +216,9 @@ def delete_version(
]:
raise NotImplementedError()
+ @property
+ def kind(self) -> str:
+ raise NotImplementedError()
+
__all__ = ("VersionsTransport",)
diff --git a/google/cloud/appengine_admin_v1/services/versions/transports/grpc.py b/google/cloud/appengine_admin_v1/services/versions/transports/grpc.py
index 0ed6ce9..2b94752 100644
--- a/google/cloud/appengine_admin_v1/services/versions/transports/grpc.py
+++ b/google/cloud/appengine_admin_v1/services/versions/transports/grpc.py
@@ -228,8 +228,7 @@ def create_channel(
@property
def grpc_channel(self) -> grpc.Channel:
- """Return the channel designed to connect to this service.
- """
+ """Return the channel designed to connect to this service."""
return self._grpc_channel
@property
@@ -414,5 +413,9 @@ def delete_version(
def close(self):
self.grpc_channel.close()
+ @property
+ def kind(self) -> str:
+ return "grpc"
+
__all__ = ("VersionsGrpcTransport",)
diff --git a/google/cloud/appengine_admin_v1/types/__init__.py b/google/cloud/appengine_admin_v1/types/__init__.py
index 0af6953..92e52a7 100644
--- a/google/cloud/appengine_admin_v1/types/__init__.py
+++ b/google/cloud/appengine_admin_v1/types/__init__.py
@@ -97,16 +97,26 @@
FileInfo,
ZipInfo,
)
-from .domain import AuthorizedDomain
+from .domain import (
+ AuthorizedDomain,
+)
from .domain_mapping import (
DomainMapping,
ResourceRecord,
SslSettings,
)
-from .firewall import FirewallRule
-from .instance import Instance
-from .location import LocationMetadata
-from .network_settings import NetworkSettings
+from .firewall import (
+ FirewallRule,
+)
+from .instance import (
+ Instance,
+)
+from .location import (
+ LocationMetadata,
+)
+from .network_settings import (
+ NetworkSettings,
+)
from .operation import (
CreateVersionMetadataV1,
OperationMetadataV1,
diff --git a/google/cloud/appengine_admin_v1/types/app_yaml.py b/google/cloud/appengine_admin_v1/types/app_yaml.py
index 2d4fbc3..e2c84db 100644
--- a/google/cloud/appengine_admin_v1/types/app_yaml.py
+++ b/google/cloud/appengine_admin_v1/types/app_yaml.py
@@ -84,11 +84,29 @@ class ApiConfigHandler(proto.Message):
URL to serve the endpoint at.
"""
- auth_fail_action = proto.Field(proto.ENUM, number=1, enum="AuthFailAction",)
- login = proto.Field(proto.ENUM, number=2, enum="LoginRequirement",)
- script = proto.Field(proto.STRING, number=3,)
- security_level = proto.Field(proto.ENUM, number=4, enum="SecurityLevel",)
- url = proto.Field(proto.STRING, number=5,)
+ auth_fail_action = proto.Field(
+ proto.ENUM,
+ number=1,
+ enum="AuthFailAction",
+ )
+ login = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum="LoginRequirement",
+ )
+ script = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ security_level = proto.Field(
+ proto.ENUM,
+ number=4,
+ enum="SecurityLevel",
+ )
+ url = proto.Field(
+ proto.STRING,
+ number=5,
+ )
class ErrorHandler(proto.Message):
@@ -113,9 +131,19 @@ class ErrorCode(proto.Enum):
ERROR_CODE_DOS_API_DENIAL = 2
ERROR_CODE_TIMEOUT = 3
- error_code = proto.Field(proto.ENUM, number=1, enum=ErrorCode,)
- static_file = proto.Field(proto.STRING, number=2,)
- mime_type = proto.Field(proto.STRING, number=3,)
+ error_code = proto.Field(
+ proto.ENUM,
+ number=1,
+ enum=ErrorCode,
+ )
+ static_file = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ mime_type = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class UrlMap(proto.Message):
@@ -177,21 +205,47 @@ class RedirectHttpResponseCode(proto.Enum):
REDIRECT_HTTP_RESPONSE_CODE_303 = 3
REDIRECT_HTTP_RESPONSE_CODE_307 = 4
- url_regex = proto.Field(proto.STRING, number=1,)
+ url_regex = proto.Field(
+ proto.STRING,
+ number=1,
+ )
static_files = proto.Field(
- proto.MESSAGE, number=2, oneof="handler_type", message="StaticFilesHandler",
+ proto.MESSAGE,
+ number=2,
+ oneof="handler_type",
+ message="StaticFilesHandler",
)
script = proto.Field(
- proto.MESSAGE, number=3, oneof="handler_type", message="ScriptHandler",
+ proto.MESSAGE,
+ number=3,
+ oneof="handler_type",
+ message="ScriptHandler",
)
api_endpoint = proto.Field(
- proto.MESSAGE, number=4, oneof="handler_type", message="ApiEndpointHandler",
+ proto.MESSAGE,
+ number=4,
+ oneof="handler_type",
+ message="ApiEndpointHandler",
+ )
+ security_level = proto.Field(
+ proto.ENUM,
+ number=5,
+ enum="SecurityLevel",
+ )
+ login = proto.Field(
+ proto.ENUM,
+ number=6,
+ enum="LoginRequirement",
+ )
+ auth_fail_action = proto.Field(
+ proto.ENUM,
+ number=7,
+ enum="AuthFailAction",
)
- security_level = proto.Field(proto.ENUM, number=5, enum="SecurityLevel",)
- login = proto.Field(proto.ENUM, number=6, enum="LoginRequirement",)
- auth_fail_action = proto.Field(proto.ENUM, number=7, enum="AuthFailAction",)
redirect_http_response_code = proto.Field(
- proto.ENUM, number=8, enum=RedirectHttpResponseCode,
+ proto.ENUM,
+ number=8,
+ enum=RedirectHttpResponseCode,
)
@@ -211,7 +265,7 @@ class StaticFilesHandler(proto.Message):
Regular expression that matches the file
paths for all files that should be referenced by
this handler.
- http_headers (Sequence[google.cloud.appengine_admin_v1.types.StaticFilesHandler.HttpHeadersEntry]):
+ http_headers (Mapping[str, str]):
HTTP headers to use for all responses from
these URLs.
mime_type (str):
@@ -236,13 +290,36 @@ class StaticFilesHandler(proto.Message):
resource quotas.
"""
- path = proto.Field(proto.STRING, number=1,)
- upload_path_regex = proto.Field(proto.STRING, number=2,)
- http_headers = proto.MapField(proto.STRING, proto.STRING, number=3,)
- mime_type = proto.Field(proto.STRING, number=4,)
- expiration = proto.Field(proto.MESSAGE, number=5, message=duration_pb2.Duration,)
- require_matching_file = proto.Field(proto.BOOL, number=6,)
- application_readable = proto.Field(proto.BOOL, number=7,)
+ path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ upload_path_regex = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ http_headers = proto.MapField(
+ proto.STRING,
+ proto.STRING,
+ number=3,
+ )
+ mime_type = proto.Field(
+ proto.STRING,
+ number=4,
+ )
+ expiration = proto.Field(
+ proto.MESSAGE,
+ number=5,
+ message=duration_pb2.Duration,
+ )
+ require_matching_file = proto.Field(
+ proto.BOOL,
+ number=6,
+ )
+ application_readable = proto.Field(
+ proto.BOOL,
+ number=7,
+ )
class ScriptHandler(proto.Message):
@@ -255,7 +332,10 @@ class ScriptHandler(proto.Message):
directory.
"""
- script_path = proto.Field(proto.STRING, number=1,)
+ script_path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ApiEndpointHandler(proto.Message):
@@ -267,7 +347,10 @@ class ApiEndpointHandler(proto.Message):
directory.
"""
- script_path = proto.Field(proto.STRING, number=1,)
+ script_path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class HealthCheck(proto.Message):
@@ -298,15 +381,36 @@ class HealthCheck(proto.Message):
failed.
"""
- disable_health_check = proto.Field(proto.BOOL, number=1,)
- host = proto.Field(proto.STRING, number=2,)
- healthy_threshold = proto.Field(proto.UINT32, number=3,)
- unhealthy_threshold = proto.Field(proto.UINT32, number=4,)
- restart_threshold = proto.Field(proto.UINT32, number=5,)
+ disable_health_check = proto.Field(
+ proto.BOOL,
+ number=1,
+ )
+ host = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ healthy_threshold = proto.Field(
+ proto.UINT32,
+ number=3,
+ )
+ unhealthy_threshold = proto.Field(
+ proto.UINT32,
+ number=4,
+ )
+ restart_threshold = proto.Field(
+ proto.UINT32,
+ number=5,
+ )
check_interval = proto.Field(
- proto.MESSAGE, number=6, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=6,
+ message=duration_pb2.Duration,
+ )
+ timeout = proto.Field(
+ proto.MESSAGE,
+ number=7,
+ message=duration_pb2.Duration,
)
- timeout = proto.Field(proto.MESSAGE, number=7, message=duration_pb2.Duration,)
class ReadinessCheck(proto.Message):
@@ -336,16 +440,36 @@ class ReadinessCheck(proto.Message):
healthcheck until it is ready to serve traffic.
"""
- path = proto.Field(proto.STRING, number=1,)
- host = proto.Field(proto.STRING, number=2,)
- failure_threshold = proto.Field(proto.UINT32, number=3,)
- success_threshold = proto.Field(proto.UINT32, number=4,)
+ path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ host = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ failure_threshold = proto.Field(
+ proto.UINT32,
+ number=3,
+ )
+ success_threshold = proto.Field(
+ proto.UINT32,
+ number=4,
+ )
check_interval = proto.Field(
- proto.MESSAGE, number=5, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=5,
+ message=duration_pb2.Duration,
+ )
+ timeout = proto.Field(
+ proto.MESSAGE,
+ number=6,
+ message=duration_pb2.Duration,
)
- timeout = proto.Field(proto.MESSAGE, number=6, message=duration_pb2.Duration,)
app_start_timeout = proto.Field(
- proto.MESSAGE, number=7, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=7,
+ message=duration_pb2.Duration,
)
@@ -374,15 +498,37 @@ class LivenessCheck(proto.Message):
the checks.
"""
- path = proto.Field(proto.STRING, number=1,)
- host = proto.Field(proto.STRING, number=2,)
- failure_threshold = proto.Field(proto.UINT32, number=3,)
- success_threshold = proto.Field(proto.UINT32, number=4,)
+ path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ host = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ failure_threshold = proto.Field(
+ proto.UINT32,
+ number=3,
+ )
+ success_threshold = proto.Field(
+ proto.UINT32,
+ number=4,
+ )
check_interval = proto.Field(
- proto.MESSAGE, number=5, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=5,
+ message=duration_pb2.Duration,
+ )
+ timeout = proto.Field(
+ proto.MESSAGE,
+ number=6,
+ message=duration_pb2.Duration,
+ )
+ initial_delay = proto.Field(
+ proto.MESSAGE,
+ number=7,
+ message=duration_pb2.Duration,
)
- timeout = proto.Field(proto.MESSAGE, number=6, message=duration_pb2.Duration,)
- initial_delay = proto.Field(proto.MESSAGE, number=7, message=duration_pb2.Duration,)
class Library(proto.Message):
@@ -397,8 +543,14 @@ class Library(proto.Message):
"latest".
"""
- name = proto.Field(proto.STRING, number=1,)
- version = proto.Field(proto.STRING, number=2,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ version = proto.Field(
+ proto.STRING,
+ number=2,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/appengine.py b/google/cloud/appengine_admin_v1/types/appengine.py
index 1b67aaf..be12296 100644
--- a/google/cloud/appengine_admin_v1/types/appengine.py
+++ b/google/cloud/appengine_admin_v1/types/appengine.py
@@ -110,7 +110,10 @@ class GetApplicationRequest(proto.Message):
``apps/myapp``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class CreateApplicationRequest(proto.Message):
@@ -122,7 +125,9 @@ class CreateApplicationRequest(proto.Message):
"""
application = proto.Field(
- proto.MESSAGE, number=2, message=ga_application.Application,
+ proto.MESSAGE,
+ number=2,
+ message=ga_application.Application,
)
@@ -141,12 +146,19 @@ class UpdateApplicationRequest(proto.Message):
be updated.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
application = proto.Field(
- proto.MESSAGE, number=2, message=ga_application.Application,
+ proto.MESSAGE,
+ number=2,
+ message=ga_application.Application,
)
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
)
@@ -158,7 +170,10 @@ class RepairApplicationRequest(proto.Message):
Name of the application to repair. Example: ``apps/myapp``
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ListServicesRequest(proto.Message):
@@ -175,9 +190,18 @@ class ListServicesRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ListServicesResponse(proto.Message):
@@ -196,8 +220,15 @@ class ListServicesResponse(proto.Message):
def raw_page(self):
return self
- services = proto.RepeatedField(proto.MESSAGE, number=1, message=ga_service.Service,)
- next_page_token = proto.Field(proto.STRING, number=2,)
+ services = proto.RepeatedField(
+ proto.MESSAGE,
+ number=1,
+ message=ga_service.Service,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
+ )
class GetServiceRequest(proto.Message):
@@ -209,7 +240,10 @@ class GetServiceRequest(proto.Message):
``apps/myapp/services/default``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class UpdateServiceRequest(proto.Message):
@@ -243,12 +277,24 @@ class UpdateServiceRequest(proto.Message):
Traffic `__.
"""
- name = proto.Field(proto.STRING, number=1,)
- service = proto.Field(proto.MESSAGE, number=2, message=ga_service.Service,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ service = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=ga_service.Service,
+ )
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
+ )
+ migrate_traffic = proto.Field(
+ proto.BOOL,
+ number=4,
)
- migrate_traffic = proto.Field(proto.BOOL, number=4,)
class DeleteServiceRequest(proto.Message):
@@ -260,7 +306,10 @@ class DeleteServiceRequest(proto.Message):
``apps/myapp/services/default``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ListVersionsRequest(proto.Message):
@@ -280,10 +329,23 @@ class ListVersionsRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- view = proto.Field(proto.ENUM, number=2, enum="VersionView",)
- page_size = proto.Field(proto.INT32, number=3,)
- page_token = proto.Field(proto.STRING, number=4,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ view = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum="VersionView",
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=3,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=4,
+ )
class ListVersionsResponse(proto.Message):
@@ -302,8 +364,15 @@ class ListVersionsResponse(proto.Message):
def raw_page(self):
return self
- versions = proto.RepeatedField(proto.MESSAGE, number=1, message=ga_version.Version,)
- next_page_token = proto.Field(proto.STRING, number=2,)
+ versions = proto.RepeatedField(
+ proto.MESSAGE,
+ number=1,
+ message=ga_version.Version,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
+ )
class GetVersionRequest(proto.Message):
@@ -317,8 +386,15 @@ class GetVersionRequest(proto.Message):
Controls the set of fields returned in the ``Get`` response.
"""
- name = proto.Field(proto.STRING, number=1,)
- view = proto.Field(proto.ENUM, number=2, enum="VersionView",)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ view = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum="VersionView",
+ )
class CreateVersionRequest(proto.Message):
@@ -332,8 +408,15 @@ class CreateVersionRequest(proto.Message):
Application deployment configuration.
"""
- parent = proto.Field(proto.STRING, number=1,)
- version = proto.Field(proto.MESSAGE, number=2, message=ga_version.Version,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ version = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=ga_version.Version,
+ )
class UpdateVersionRequest(proto.Message):
@@ -352,10 +435,19 @@ class UpdateVersionRequest(proto.Message):
be updated.
"""
- name = proto.Field(proto.STRING, number=1,)
- version = proto.Field(proto.MESSAGE, number=2, message=ga_version.Version,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ version = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=ga_version.Version,
+ )
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
)
@@ -368,7 +460,10 @@ class DeleteVersionRequest(proto.Message):
``apps/myapp/services/default/versions/v1``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ListInstancesRequest(proto.Message):
@@ -385,9 +480,18 @@ class ListInstancesRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ListInstancesResponse(proto.Message):
@@ -406,8 +510,15 @@ class ListInstancesResponse(proto.Message):
def raw_page(self):
return self
- instances = proto.RepeatedField(proto.MESSAGE, number=1, message=instance.Instance,)
- next_page_token = proto.Field(proto.STRING, number=2,)
+ instances = proto.RepeatedField(
+ proto.MESSAGE,
+ number=1,
+ message=instance.Instance,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
+ )
class GetInstanceRequest(proto.Message):
@@ -419,7 +530,10 @@ class GetInstanceRequest(proto.Message):
``apps/myapp/services/default/versions/v1/instances/instance-1``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class DeleteInstanceRequest(proto.Message):
@@ -431,7 +545,10 @@ class DeleteInstanceRequest(proto.Message):
``apps/myapp/services/default/versions/v1/instances/instance-1``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class DebugInstanceRequest(proto.Message):
@@ -451,8 +568,14 @@ class DebugInstanceRequest(proto.Message):
Keys `__.
"""
- name = proto.Field(proto.STRING, number=1,)
- ssh_key = proto.Field(proto.STRING, number=2,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ ssh_key = proto.Field(
+ proto.STRING,
+ number=2,
+ )
class ListIngressRulesRequest(proto.Message):
@@ -474,10 +597,22 @@ class ListIngressRulesRequest(proto.Message):
on requests from this IP.
"""
- parent = proto.Field(proto.STRING, number=1,)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
- matching_address = proto.Field(proto.STRING, number=4,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ matching_address = proto.Field(
+ proto.STRING,
+ number=4,
+ )
class ListIngressRulesResponse(proto.Message):
@@ -497,9 +632,14 @@ def raw_page(self):
return self
ingress_rules = proto.RepeatedField(
- proto.MESSAGE, number=1, message=firewall.FirewallRule,
+ proto.MESSAGE,
+ number=1,
+ message=firewall.FirewallRule,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
)
- next_page_token = proto.Field(proto.STRING, number=2,)
class BatchUpdateIngressRulesRequest(proto.Message):
@@ -514,9 +654,14 @@ class BatchUpdateIngressRulesRequest(proto.Message):
existing set.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
ingress_rules = proto.RepeatedField(
- proto.MESSAGE, number=2, message=firewall.FirewallRule,
+ proto.MESSAGE,
+ number=2,
+ message=firewall.FirewallRule,
)
@@ -530,7 +675,9 @@ class BatchUpdateIngressRulesResponse(proto.Message):
"""
ingress_rules = proto.RepeatedField(
- proto.MESSAGE, number=1, message=firewall.FirewallRule,
+ proto.MESSAGE,
+ number=1,
+ message=firewall.FirewallRule,
)
@@ -556,8 +703,15 @@ class CreateIngressRuleRequest(proto.Message):
or deny-all rule.
"""
- parent = proto.Field(proto.STRING, number=1,)
- rule = proto.Field(proto.MESSAGE, number=2, message=firewall.FirewallRule,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ rule = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=firewall.FirewallRule,
+ )
class GetIngressRuleRequest(proto.Message):
@@ -569,7 +723,10 @@ class GetIngressRuleRequest(proto.Message):
``apps/myapp/firewall/ingressRules/100``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class UpdateIngressRuleRequest(proto.Message):
@@ -587,10 +744,19 @@ class UpdateIngressRuleRequest(proto.Message):
be updated.
"""
- name = proto.Field(proto.STRING, number=1,)
- rule = proto.Field(proto.MESSAGE, number=2, message=firewall.FirewallRule,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ rule = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=firewall.FirewallRule,
+ )
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
)
@@ -603,7 +769,10 @@ class DeleteIngressRuleRequest(proto.Message):
``apps/myapp/firewall/ingressRules/100``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ListAuthorizedDomainsRequest(proto.Message):
@@ -620,9 +789,18 @@ class ListAuthorizedDomainsRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ListAuthorizedDomainsResponse(proto.Message):
@@ -641,9 +819,14 @@ def raw_page(self):
return self
domains = proto.RepeatedField(
- proto.MESSAGE, number=1, message=domain.AuthorizedDomain,
+ proto.MESSAGE,
+ number=1,
+ message=domain.AuthorizedDomain,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
)
- next_page_token = proto.Field(proto.STRING, number=2,)
class ListAuthorizedCertificatesRequest(proto.Message):
@@ -664,10 +847,23 @@ class ListAuthorizedCertificatesRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- view = proto.Field(proto.ENUM, number=4, enum="AuthorizedCertificateView",)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ view = proto.Field(
+ proto.ENUM,
+ number=4,
+ enum="AuthorizedCertificateView",
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ListAuthorizedCertificatesResponse(proto.Message):
@@ -688,9 +884,14 @@ def raw_page(self):
return self
certificates = proto.RepeatedField(
- proto.MESSAGE, number=1, message=ga_certificate.AuthorizedCertificate,
+ proto.MESSAGE,
+ number=1,
+ message=ga_certificate.AuthorizedCertificate,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
)
- next_page_token = proto.Field(proto.STRING, number=2,)
class GetAuthorizedCertificateRequest(proto.Message):
@@ -705,8 +906,15 @@ class GetAuthorizedCertificateRequest(proto.Message):
Controls the set of fields returned in the ``GET`` response.
"""
- name = proto.Field(proto.STRING, number=1,)
- view = proto.Field(proto.ENUM, number=2, enum="AuthorizedCertificateView",)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ view = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum="AuthorizedCertificateView",
+ )
class CreateAuthorizedCertificateRequest(proto.Message):
@@ -721,9 +929,14 @@ class CreateAuthorizedCertificateRequest(proto.Message):
SSL certificate data.
"""
- parent = proto.Field(proto.STRING, number=1,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
certificate = proto.Field(
- proto.MESSAGE, number=2, message=ga_certificate.AuthorizedCertificate,
+ proto.MESSAGE,
+ number=2,
+ message=ga_certificate.AuthorizedCertificate,
)
@@ -744,12 +957,19 @@ class UpdateAuthorizedCertificateRequest(proto.Message):
and ``display_name`` fields.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
certificate = proto.Field(
- proto.MESSAGE, number=2, message=ga_certificate.AuthorizedCertificate,
+ proto.MESSAGE,
+ number=2,
+ message=ga_certificate.AuthorizedCertificate,
)
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
)
@@ -763,7 +983,10 @@ class DeleteAuthorizedCertificateRequest(proto.Message):
``apps/myapp/authorizedCertificates/12345``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class ListDomainMappingsRequest(proto.Message):
@@ -780,9 +1003,18 @@ class ListDomainMappingsRequest(proto.Message):
of results.
"""
- parent = proto.Field(proto.STRING, number=1,)
- page_size = proto.Field(proto.INT32, number=2,)
- page_token = proto.Field(proto.STRING, number=3,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ page_size = proto.Field(
+ proto.INT32,
+ number=2,
+ )
+ page_token = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ListDomainMappingsResponse(proto.Message):
@@ -801,9 +1033,14 @@ def raw_page(self):
return self
domain_mappings = proto.RepeatedField(
- proto.MESSAGE, number=1, message=ga_domain_mapping.DomainMapping,
+ proto.MESSAGE,
+ number=1,
+ message=ga_domain_mapping.DomainMapping,
+ )
+ next_page_token = proto.Field(
+ proto.STRING,
+ number=2,
)
- next_page_token = proto.Field(proto.STRING, number=2,)
class GetDomainMappingRequest(proto.Message):
@@ -815,7 +1052,10 @@ class GetDomainMappingRequest(proto.Message):
``apps/myapp/domainMappings/example.com``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class CreateDomainMappingRequest(proto.Message):
@@ -833,12 +1073,19 @@ class CreateDomainMappingRequest(proto.Message):
default, overrides are rejected.
"""
- parent = proto.Field(proto.STRING, number=1,)
+ parent = proto.Field(
+ proto.STRING,
+ number=1,
+ )
domain_mapping = proto.Field(
- proto.MESSAGE, number=2, message=ga_domain_mapping.DomainMapping,
+ proto.MESSAGE,
+ number=2,
+ message=ga_domain_mapping.DomainMapping,
)
override_strategy = proto.Field(
- proto.ENUM, number=4, enum="DomainOverrideStrategy",
+ proto.ENUM,
+ number=4,
+ enum="DomainOverrideStrategy",
)
@@ -858,12 +1105,19 @@ class UpdateDomainMappingRequest(proto.Message):
be updated.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
domain_mapping = proto.Field(
- proto.MESSAGE, number=2, message=ga_domain_mapping.DomainMapping,
+ proto.MESSAGE,
+ number=2,
+ message=ga_domain_mapping.DomainMapping,
)
update_mask = proto.Field(
- proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask,
+ proto.MESSAGE,
+ number=3,
+ message=field_mask_pb2.FieldMask,
)
@@ -876,7 +1130,10 @@ class DeleteDomainMappingRequest(proto.Message):
``apps/myapp/domainMappings/example.com``.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/application.py b/google/cloud/appengine_admin_v1/types/application.py
index c8a00f3..263562d 100644
--- a/google/cloud/appengine_admin_v1/types/application.py
+++ b/google/cloud/appengine_admin_v1/types/application.py
@@ -19,7 +19,11 @@
__protobuf__ = proto.module(
- package="google.appengine.v1", manifest={"Application", "UrlDispatchRule",},
+ package="google.appengine.v1",
+ manifest={
+ "Application",
+ "UrlDispatchRule",
+ },
)
@@ -135,10 +139,22 @@ class IdentityAwareProxy(proto.Message):
@OutputOnly
"""
- enabled = proto.Field(proto.BOOL, number=1,)
- oauth2_client_id = proto.Field(proto.STRING, number=2,)
- oauth2_client_secret = proto.Field(proto.STRING, number=3,)
- oauth2_client_secret_sha256 = proto.Field(proto.STRING, number=4,)
+ enabled = proto.Field(
+ proto.BOOL,
+ number=1,
+ )
+ oauth2_client_id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ oauth2_client_secret = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ oauth2_client_secret_sha256 = proto.Field(
+ proto.STRING,
+ number=4,
+ )
class FeatureSettings(proto.Message):
r"""The feature specific settings to be used in the application.
@@ -158,27 +174,77 @@ class FeatureSettings(proto.Message):
base image for VMs, rather than a base Debian image.
"""
- split_health_checks = proto.Field(proto.BOOL, number=1,)
- use_container_optimized_os = proto.Field(proto.BOOL, number=2,)
+ split_health_checks = proto.Field(
+ proto.BOOL,
+ number=1,
+ )
+ use_container_optimized_os = proto.Field(
+ proto.BOOL,
+ number=2,
+ )
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
dispatch_rules = proto.RepeatedField(
- proto.MESSAGE, number=3, message="UrlDispatchRule",
+ proto.MESSAGE,
+ number=3,
+ message="UrlDispatchRule",
+ )
+ auth_domain = proto.Field(
+ proto.STRING,
+ number=6,
+ )
+ location_id = proto.Field(
+ proto.STRING,
+ number=7,
+ )
+ code_bucket = proto.Field(
+ proto.STRING,
+ number=8,
)
- auth_domain = proto.Field(proto.STRING, number=6,)
- location_id = proto.Field(proto.STRING, number=7,)
- code_bucket = proto.Field(proto.STRING, number=8,)
default_cookie_expiration = proto.Field(
- proto.MESSAGE, number=9, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=9,
+ message=duration_pb2.Duration,
+ )
+ serving_status = proto.Field(
+ proto.ENUM,
+ number=10,
+ enum=ServingStatus,
+ )
+ default_hostname = proto.Field(
+ proto.STRING,
+ number=11,
+ )
+ default_bucket = proto.Field(
+ proto.STRING,
+ number=12,
+ )
+ iap = proto.Field(
+ proto.MESSAGE,
+ number=14,
+ message=IdentityAwareProxy,
+ )
+ gcr_domain = proto.Field(
+ proto.STRING,
+ number=16,
+ )
+ database_type = proto.Field(
+ proto.ENUM,
+ number=17,
+ enum=DatabaseType,
+ )
+ feature_settings = proto.Field(
+ proto.MESSAGE,
+ number=18,
+ message=FeatureSettings,
)
- serving_status = proto.Field(proto.ENUM, number=10, enum=ServingStatus,)
- default_hostname = proto.Field(proto.STRING, number=11,)
- default_bucket = proto.Field(proto.STRING, number=12,)
- iap = proto.Field(proto.MESSAGE, number=14, message=IdentityAwareProxy,)
- gcr_domain = proto.Field(proto.STRING, number=16,)
- database_type = proto.Field(proto.ENUM, number=17, enum=DatabaseType,)
- feature_settings = proto.Field(proto.MESSAGE, number=18, message=FeatureSettings,)
class UrlDispatchRule(proto.Message):
@@ -203,9 +269,18 @@ class UrlDispatchRule(proto.Message):
Example: ``default``.
"""
- domain = proto.Field(proto.STRING, number=1,)
- path = proto.Field(proto.STRING, number=2,)
- service = proto.Field(proto.STRING, number=3,)
+ domain = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ path = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ service = proto.Field(
+ proto.STRING,
+ number=3,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/audit_data.py b/google/cloud/appengine_admin_v1/types/audit_data.py
index c511e4f..69de0cf 100644
--- a/google/cloud/appengine_admin_v1/types/audit_data.py
+++ b/google/cloud/appengine_admin_v1/types/audit_data.py
@@ -20,7 +20,11 @@
__protobuf__ = proto.module(
package="google.appengine.v1",
- manifest={"AuditData", "UpdateServiceMethod", "CreateVersionMethod",},
+ manifest={
+ "AuditData",
+ "UpdateServiceMethod",
+ "CreateVersionMethod",
+ },
)
@@ -48,10 +52,16 @@ class AuditData(proto.Message):
"""
update_service = proto.Field(
- proto.MESSAGE, number=1, oneof="method", message="UpdateServiceMethod",
+ proto.MESSAGE,
+ number=1,
+ oneof="method",
+ message="UpdateServiceMethod",
)
create_version = proto.Field(
- proto.MESSAGE, number=2, oneof="method", message="CreateVersionMethod",
+ proto.MESSAGE,
+ number=2,
+ oneof="method",
+ message="CreateVersionMethod",
)
@@ -64,7 +74,9 @@ class UpdateServiceMethod(proto.Message):
"""
request = proto.Field(
- proto.MESSAGE, number=1, message=appengine.UpdateServiceRequest,
+ proto.MESSAGE,
+ number=1,
+ message=appengine.UpdateServiceRequest,
)
@@ -77,7 +89,9 @@ class CreateVersionMethod(proto.Message):
"""
request = proto.Field(
- proto.MESSAGE, number=1, message=appengine.CreateVersionRequest,
+ proto.MESSAGE,
+ number=1,
+ message=appengine.CreateVersionRequest,
)
diff --git a/google/cloud/appengine_admin_v1/types/certificate.py b/google/cloud/appengine_admin_v1/types/certificate.py
index cce73e9..5288637 100644
--- a/google/cloud/appengine_admin_v1/types/certificate.py
+++ b/google/cloud/appengine_admin_v1/types/certificate.py
@@ -114,19 +114,45 @@ class AuthorizedCertificate(proto.Message):
@OutputOnly
"""
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
- display_name = proto.Field(proto.STRING, number=3,)
- domain_names = proto.RepeatedField(proto.STRING, number=4,)
- expire_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ display_name = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ domain_names = proto.RepeatedField(
+ proto.STRING,
+ number=4,
+ )
+ expire_time = proto.Field(
+ proto.MESSAGE,
+ number=5,
+ message=timestamp_pb2.Timestamp,
+ )
certificate_raw_data = proto.Field(
- proto.MESSAGE, number=6, message="CertificateRawData",
+ proto.MESSAGE,
+ number=6,
+ message="CertificateRawData",
)
managed_certificate = proto.Field(
- proto.MESSAGE, number=7, message="ManagedCertificate",
+ proto.MESSAGE,
+ number=7,
+ message="ManagedCertificate",
+ )
+ visible_domain_mappings = proto.RepeatedField(
+ proto.STRING,
+ number=8,
+ )
+ domain_mappings_count = proto.Field(
+ proto.INT32,
+ number=9,
)
- visible_domain_mappings = proto.RepeatedField(proto.STRING, number=8,)
- domain_mappings_count = proto.Field(proto.INT32, number=9,)
class CertificateRawData(proto.Message):
@@ -162,8 +188,14 @@ class CertificateRawData(proto.Message):
@InputOnly
"""
- public_certificate = proto.Field(proto.STRING, number=1,)
- private_key = proto.Field(proto.STRING, number=2,)
+ public_certificate = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ private_key = proto.Field(
+ proto.STRING,
+ number=2,
+ )
class ManagedCertificate(proto.Message):
@@ -185,9 +217,15 @@ class ManagedCertificate(proto.Message):
"""
last_renewal_time = proto.Field(
- proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,
+ proto.MESSAGE,
+ number=1,
+ message=timestamp_pb2.Timestamp,
+ )
+ status = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum="ManagementStatus",
)
- status = proto.Field(proto.ENUM, number=2, enum="ManagementStatus",)
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/deploy.py b/google/cloud/appengine_admin_v1/types/deploy.py
index 5faf790..857564e 100644
--- a/google/cloud/appengine_admin_v1/types/deploy.py
+++ b/google/cloud/appengine_admin_v1/types/deploy.py
@@ -35,7 +35,7 @@ class Deployment(proto.Message):
App Engine.
Attributes:
- files (Sequence[google.cloud.appengine_admin_v1.types.Deployment.FilesEntry]):
+ files (Mapping[str, google.cloud.appengine_admin_v1.types.FileInfo]):
Manifest of the files stored in Google Cloud
Storage that are included as part of this
version. All files must be readable using the
@@ -56,11 +56,26 @@ class Deployment(proto.Message):
Engine flexible environment using files or zip.
"""
- files = proto.MapField(proto.STRING, proto.MESSAGE, number=1, message="FileInfo",)
- container = proto.Field(proto.MESSAGE, number=2, message="ContainerInfo",)
- zip_ = proto.Field(proto.MESSAGE, number=3, message="ZipInfo",)
+ files = proto.MapField(
+ proto.STRING,
+ proto.MESSAGE,
+ number=1,
+ message="FileInfo",
+ )
+ container = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message="ContainerInfo",
+ )
+ zip_ = proto.Field(
+ proto.MESSAGE,
+ number=3,
+ message="ZipInfo",
+ )
cloud_build_options = proto.Field(
- proto.MESSAGE, number=6, message="CloudBuildOptions",
+ proto.MESSAGE,
+ number=6,
+ message="CloudBuildOptions",
)
@@ -82,9 +97,18 @@ class FileInfo(proto.Message):
Defaults to the value from Google Cloud Storage.
"""
- source_url = proto.Field(proto.STRING, number=1,)
- sha1_sum = proto.Field(proto.STRING, number=2,)
- mime_type = proto.Field(proto.STRING, number=3,)
+ source_url = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ sha1_sum = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ mime_type = proto.Field(
+ proto.STRING,
+ number=3,
+ )
class ContainerInfo(proto.Message):
@@ -101,7 +125,10 @@ class ContainerInfo(proto.Message):
"gcr.io/my-project/image@digest".
"""
- image = proto.Field(proto.STRING, number=1,)
+ image = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class CloudBuildOptions(proto.Message):
@@ -124,9 +151,14 @@ class CloudBuildOptions(proto.Message):
Defaults to 10 minutes.
"""
- app_yaml_path = proto.Field(proto.STRING, number=1,)
+ app_yaml_path = proto.Field(
+ proto.STRING,
+ number=1,
+ )
cloud_build_timeout = proto.Field(
- proto.MESSAGE, number=2, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=2,
+ message=duration_pb2.Duration,
)
@@ -147,8 +179,14 @@ class ZipInfo(proto.Message):
provided, deployment may be slow.
"""
- source_url = proto.Field(proto.STRING, number=3,)
- files_count = proto.Field(proto.INT32, number=4,)
+ source_url = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ files_count = proto.Field(
+ proto.INT32,
+ number=4,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/deployed_files.py b/google/cloud/appengine_admin_v1/types/deployed_files.py
index 06128b6..e127548 100644
--- a/google/cloud/appengine_admin_v1/types/deployed_files.py
+++ b/google/cloud/appengine_admin_v1/types/deployed_files.py
@@ -15,7 +15,10 @@
#
-__protobuf__ = proto.module(package="google.appengine.v1", manifest={},)
+__protobuf__ = proto.module(
+ package="google.appengine.v1",
+ manifest={},
+)
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/domain.py b/google/cloud/appengine_admin_v1/types/domain.py
index e8a38de..92c3b53 100644
--- a/google/cloud/appengine_admin_v1/types/domain.py
+++ b/google/cloud/appengine_admin_v1/types/domain.py
@@ -17,7 +17,10 @@
__protobuf__ = proto.module(
- package="google.appengine.v1", manifest={"AuthorizedDomain",},
+ package="google.appengine.v1",
+ manifest={
+ "AuthorizedDomain",
+ },
)
@@ -37,8 +40,14 @@ class AuthorizedDomain(proto.Message):
use. Example: ``example.com``.
"""
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/domain_mapping.py b/google/cloud/appengine_admin_v1/types/domain_mapping.py
index c94e986..ba055ab 100644
--- a/google/cloud/appengine_admin_v1/types/domain_mapping.py
+++ b/google/cloud/appengine_admin_v1/types/domain_mapping.py
@@ -18,7 +18,11 @@
__protobuf__ = proto.module(
package="google.appengine.v1",
- manifest={"DomainMapping", "SslSettings", "ResourceRecord",},
+ manifest={
+ "DomainMapping",
+ "SslSettings",
+ "ResourceRecord",
+ },
)
@@ -46,11 +50,23 @@ class DomainMapping(proto.Message):
@OutputOnly
"""
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
- ssl_settings = proto.Field(proto.MESSAGE, number=3, message="SslSettings",)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ ssl_settings = proto.Field(
+ proto.MESSAGE,
+ number=3,
+ message="SslSettings",
+ )
resource_records = proto.RepeatedField(
- proto.MESSAGE, number=4, message="ResourceRecord",
+ proto.MESSAGE,
+ number=4,
+ message="ResourceRecord",
)
@@ -95,9 +111,19 @@ class SslManagementType(proto.Enum):
AUTOMATIC = 1
MANUAL = 2
- certificate_id = proto.Field(proto.STRING, number=1,)
- ssl_management_type = proto.Field(proto.ENUM, number=3, enum=SslManagementType,)
- pending_managed_certificate_id = proto.Field(proto.STRING, number=4,)
+ certificate_id = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ ssl_management_type = proto.Field(
+ proto.ENUM,
+ number=3,
+ enum=SslManagementType,
+ )
+ pending_managed_certificate_id = proto.Field(
+ proto.STRING,
+ number=4,
+ )
class ResourceRecord(proto.Message):
@@ -122,9 +148,19 @@ class RecordType(proto.Enum):
AAAA = 2
CNAME = 3
- name = proto.Field(proto.STRING, number=1,)
- rrdata = proto.Field(proto.STRING, number=2,)
- type_ = proto.Field(proto.ENUM, number=3, enum=RecordType,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ rrdata = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ type_ = proto.Field(
+ proto.ENUM,
+ number=3,
+ enum=RecordType,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/firewall.py b/google/cloud/appengine_admin_v1/types/firewall.py
index 9c053fc..4c35c94 100644
--- a/google/cloud/appengine_admin_v1/types/firewall.py
+++ b/google/cloud/appengine_admin_v1/types/firewall.py
@@ -16,7 +16,12 @@
import proto # type: ignore
-__protobuf__ = proto.module(package="google.appengine.v1", manifest={"FirewallRule",},)
+__protobuf__ = proto.module(
+ package="google.appengine.v1",
+ manifest={
+ "FirewallRule",
+ },
+)
class FirewallRule(proto.Message):
@@ -60,10 +65,23 @@ class Action(proto.Enum):
ALLOW = 1
DENY = 2
- priority = proto.Field(proto.INT32, number=1,)
- action = proto.Field(proto.ENUM, number=2, enum=Action,)
- source_range = proto.Field(proto.STRING, number=3,)
- description = proto.Field(proto.STRING, number=4,)
+ priority = proto.Field(
+ proto.INT32,
+ number=1,
+ )
+ action = proto.Field(
+ proto.ENUM,
+ number=2,
+ enum=Action,
+ )
+ source_range = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ description = proto.Field(
+ proto.STRING,
+ number=4,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/instance.py b/google/cloud/appengine_admin_v1/types/instance.py
index c34449a..29ec859 100644
--- a/google/cloud/appengine_admin_v1/types/instance.py
+++ b/google/cloud/appengine_admin_v1/types/instance.py
@@ -18,7 +18,12 @@
from google.protobuf import timestamp_pb2 # type: ignore
-__protobuf__ = proto.module(package="google.appengine.v1", manifest={"Instance",},)
+__protobuf__ = proto.module(
+ package="google.appengine.v1",
+ manifest={
+ "Instance",
+ },
+)
class Instance(proto.Message):
@@ -93,8 +98,7 @@ class Availability(proto.Enum):
DYNAMIC = 2
class Liveness(proto.Message):
- r"""Wrapper for LivenessState enum.
- """
+ r"""Wrapper for LivenessState enum."""
class LivenessState(proto.Enum):
r"""Liveness health check status for Flex instances."""
@@ -105,23 +109,77 @@ class LivenessState(proto.Enum):
DRAINING = 4
TIMEOUT = 5
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
- app_engine_release = proto.Field(proto.STRING, number=3,)
- availability = proto.Field(proto.ENUM, number=4, enum=Availability,)
- vm_name = proto.Field(proto.STRING, number=5,)
- vm_zone_name = proto.Field(proto.STRING, number=6,)
- vm_id = proto.Field(proto.STRING, number=7,)
- start_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,)
- requests = proto.Field(proto.INT32, number=9,)
- errors = proto.Field(proto.INT32, number=10,)
- qps = proto.Field(proto.FLOAT, number=11,)
- average_latency = proto.Field(proto.INT32, number=12,)
- memory_usage = proto.Field(proto.INT64, number=13,)
- vm_status = proto.Field(proto.STRING, number=14,)
- vm_debug_enabled = proto.Field(proto.BOOL, number=15,)
- vm_ip = proto.Field(proto.STRING, number=16,)
- vm_liveness = proto.Field(proto.ENUM, number=17, enum=Liveness.LivenessState,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ app_engine_release = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ availability = proto.Field(
+ proto.ENUM,
+ number=4,
+ enum=Availability,
+ )
+ vm_name = proto.Field(
+ proto.STRING,
+ number=5,
+ )
+ vm_zone_name = proto.Field(
+ proto.STRING,
+ number=6,
+ )
+ vm_id = proto.Field(
+ proto.STRING,
+ number=7,
+ )
+ start_time = proto.Field(
+ proto.MESSAGE,
+ number=8,
+ message=timestamp_pb2.Timestamp,
+ )
+ requests = proto.Field(
+ proto.INT32,
+ number=9,
+ )
+ errors = proto.Field(
+ proto.INT32,
+ number=10,
+ )
+ qps = proto.Field(
+ proto.FLOAT,
+ number=11,
+ )
+ average_latency = proto.Field(
+ proto.INT32,
+ number=12,
+ )
+ memory_usage = proto.Field(
+ proto.INT64,
+ number=13,
+ )
+ vm_status = proto.Field(
+ proto.STRING,
+ number=14,
+ )
+ vm_debug_enabled = proto.Field(
+ proto.BOOL,
+ number=15,
+ )
+ vm_ip = proto.Field(
+ proto.STRING,
+ number=16,
+ )
+ vm_liveness = proto.Field(
+ proto.ENUM,
+ number=17,
+ enum=Liveness.LivenessState,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/location.py b/google/cloud/appengine_admin_v1/types/location.py
index 380bc37..2d333a6 100644
--- a/google/cloud/appengine_admin_v1/types/location.py
+++ b/google/cloud/appengine_admin_v1/types/location.py
@@ -17,7 +17,10 @@
__protobuf__ = proto.module(
- package="google.appengine.v1", manifest={"LocationMetadata",},
+ package="google.appengine.v1",
+ manifest={
+ "LocationMetadata",
+ },
)
@@ -40,9 +43,18 @@ class LocationMetadata(proto.Message):
is available in the given location.
"""
- standard_environment_available = proto.Field(proto.BOOL, number=2,)
- flexible_environment_available = proto.Field(proto.BOOL, number=4,)
- search_api_available = proto.Field(proto.BOOL, number=6,)
+ standard_environment_available = proto.Field(
+ proto.BOOL,
+ number=2,
+ )
+ flexible_environment_available = proto.Field(
+ proto.BOOL,
+ number=4,
+ )
+ search_api_available = proto.Field(
+ proto.BOOL,
+ number=6,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/network_settings.py b/google/cloud/appengine_admin_v1/types/network_settings.py
index f47b470..f931b83 100644
--- a/google/cloud/appengine_admin_v1/types/network_settings.py
+++ b/google/cloud/appengine_admin_v1/types/network_settings.py
@@ -17,7 +17,10 @@
__protobuf__ = proto.module(
- package="google.appengine.v1", manifest={"NetworkSettings",},
+ package="google.appengine.v1",
+ manifest={
+ "NetworkSettings",
+ },
)
@@ -38,7 +41,9 @@ class IngressTrafficAllowed(proto.Enum):
INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB = 3
ingress_traffic_allowed = proto.Field(
- proto.ENUM, number=1, enum=IngressTrafficAllowed,
+ proto.ENUM,
+ number=1,
+ enum=IngressTrafficAllowed,
)
diff --git a/google/cloud/appengine_admin_v1/types/operation.py b/google/cloud/appengine_admin_v1/types/operation.py
index d373c7b..873d2f5 100644
--- a/google/cloud/appengine_admin_v1/types/operation.py
+++ b/google/cloud/appengine_admin_v1/types/operation.py
@@ -20,7 +20,10 @@
__protobuf__ = proto.module(
package="google.appengine.v1",
- manifest={"OperationMetadataV1", "CreateVersionMetadataV1",},
+ manifest={
+ "OperationMetadataV1",
+ "CreateVersionMetadataV1",
+ },
)
@@ -62,13 +65,36 @@ class OperationMetadataV1(proto.Message):
This field is a member of `oneof`_ ``method_metadata``.
"""
- method = proto.Field(proto.STRING, number=1,)
- insert_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,)
- end_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
- user = proto.Field(proto.STRING, number=4,)
- target = proto.Field(proto.STRING, number=5,)
- ephemeral_message = proto.Field(proto.STRING, number=6,)
- warning = proto.RepeatedField(proto.STRING, number=7,)
+ method = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ insert_time = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message=timestamp_pb2.Timestamp,
+ )
+ end_time = proto.Field(
+ proto.MESSAGE,
+ number=3,
+ message=timestamp_pb2.Timestamp,
+ )
+ user = proto.Field(
+ proto.STRING,
+ number=4,
+ )
+ target = proto.Field(
+ proto.STRING,
+ number=5,
+ )
+ ephemeral_message = proto.Field(
+ proto.STRING,
+ number=6,
+ )
+ warning = proto.RepeatedField(
+ proto.STRING,
+ number=7,
+ )
create_version_metadata = proto.Field(
proto.MESSAGE,
number=8,
@@ -89,7 +115,10 @@ class CreateVersionMetadataV1(proto.Message):
of the version create. @OutputOnly
"""
- cloud_build_id = proto.Field(proto.STRING, number=1,)
+ cloud_build_id = proto.Field(
+ proto.STRING,
+ number=1,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/service.py b/google/cloud/appengine_admin_v1/types/service.py
index a124123..77e2608 100644
--- a/google/cloud/appengine_admin_v1/types/service.py
+++ b/google/cloud/appengine_admin_v1/types/service.py
@@ -21,7 +21,11 @@
__protobuf__ = proto.module(
- package="google.appengine.v1", manifest={"Service", "TrafficSplit",},
+ package="google.appengine.v1",
+ manifest={
+ "Service",
+ "TrafficSplit",
+ },
)
@@ -55,11 +59,23 @@ class Service(proto.Message):
to all versions.
"""
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
- split = proto.Field(proto.MESSAGE, number=3, message="TrafficSplit",)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ split = proto.Field(
+ proto.MESSAGE,
+ number=3,
+ message="TrafficSplit",
+ )
network_settings = proto.Field(
- proto.MESSAGE, number=6, message=ga_network_settings.NetworkSettings,
+ proto.MESSAGE,
+ number=6,
+ message=ga_network_settings.NetworkSettings,
)
@@ -74,7 +90,7 @@ class TrafficSplit(proto.Message):
request is sent to. The traffic selection
algorithm will be stable for either type until
allocations are changed.
- allocations (Sequence[google.cloud.appengine_admin_v1.types.TrafficSplit.AllocationsEntry]):
+ allocations (Mapping[str, float]):
Mapping from version IDs within the service to fractional
(0.000, 1] allocations of traffic for that version. Each
version can be specified only once, but some versions in the
@@ -93,8 +109,16 @@ class ShardBy(proto.Enum):
IP = 2
RANDOM = 3
- shard_by = proto.Field(proto.ENUM, number=1, enum=ShardBy,)
- allocations = proto.MapField(proto.STRING, proto.DOUBLE, number=2,)
+ shard_by = proto.Field(
+ proto.ENUM,
+ number=1,
+ enum=ShardBy,
+ )
+ allocations = proto.MapField(
+ proto.STRING,
+ proto.DOUBLE,
+ number=2,
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/google/cloud/appengine_admin_v1/types/version.py b/google/cloud/appengine_admin_v1/types/version.py
index 1c3b4b8..7ea3028 100644
--- a/google/cloud/appengine_admin_v1/types/version.py
+++ b/google/cloud/appengine_admin_v1/types/version.py
@@ -148,7 +148,7 @@ class Version(proto.Message):
vm (bool):
Whether to deploy this version in a container
on a virtual machine.
- beta_settings (Sequence[google.cloud.appengine_admin_v1.types.Version.BetaSettingsEntry]):
+ beta_settings (Mapping[str, str]):
Metadata settings that are supplied to this
version to enable beta runtime features.
env (str):
@@ -208,11 +208,11 @@ class Version(proto.Message):
Endpoints `__.
Only returned in ``GET`` requests if ``view=FULL`` is set.
- env_variables (Sequence[google.cloud.appengine_admin_v1.types.Version.EnvVariablesEntry]):
+ env_variables (Mapping[str, str]):
Environment variables available to the application.
Only returned in ``GET`` requests if ``view=FULL`` is set.
- build_env_variables (Sequence[google.cloud.appengine_admin_v1.types.Version.BuildEnvVariablesEntry]):
+ build_env_variables (Mapping[str, str]):
Environment variables available to the build environment.
Only returned in ``GET`` requests if ``view=FULL`` is set.
@@ -265,70 +265,187 @@ class Version(proto.Message):
Enables VPC connectivity for standard apps.
"""
- name = proto.Field(proto.STRING, number=1,)
- id = proto.Field(proto.STRING, number=2,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
automatic_scaling = proto.Field(
- proto.MESSAGE, number=3, oneof="scaling", message="AutomaticScaling",
+ proto.MESSAGE,
+ number=3,
+ oneof="scaling",
+ message="AutomaticScaling",
)
basic_scaling = proto.Field(
- proto.MESSAGE, number=4, oneof="scaling", message="BasicScaling",
+ proto.MESSAGE,
+ number=4,
+ oneof="scaling",
+ message="BasicScaling",
)
manual_scaling = proto.Field(
- proto.MESSAGE, number=5, oneof="scaling", message="ManualScaling",
+ proto.MESSAGE,
+ number=5,
+ oneof="scaling",
+ message="ManualScaling",
)
inbound_services = proto.RepeatedField(
- proto.ENUM, number=6, enum="InboundServiceType",
- )
- instance_class = proto.Field(proto.STRING, number=7,)
- network = proto.Field(proto.MESSAGE, number=8, message="Network",)
- zones = proto.RepeatedField(proto.STRING, number=118,)
- resources = proto.Field(proto.MESSAGE, number=9, message="Resources",)
- runtime = proto.Field(proto.STRING, number=10,)
- runtime_channel = proto.Field(proto.STRING, number=117,)
- threadsafe = proto.Field(proto.BOOL, number=11,)
- vm = proto.Field(proto.BOOL, number=12,)
- beta_settings = proto.MapField(proto.STRING, proto.STRING, number=13,)
- env = proto.Field(proto.STRING, number=14,)
- serving_status = proto.Field(proto.ENUM, number=15, enum="ServingStatus",)
- created_by = proto.Field(proto.STRING, number=16,)
+ proto.ENUM,
+ number=6,
+ enum="InboundServiceType",
+ )
+ instance_class = proto.Field(
+ proto.STRING,
+ number=7,
+ )
+ network = proto.Field(
+ proto.MESSAGE,
+ number=8,
+ message="Network",
+ )
+ zones = proto.RepeatedField(
+ proto.STRING,
+ number=118,
+ )
+ resources = proto.Field(
+ proto.MESSAGE,
+ number=9,
+ message="Resources",
+ )
+ runtime = proto.Field(
+ proto.STRING,
+ number=10,
+ )
+ runtime_channel = proto.Field(
+ proto.STRING,
+ number=117,
+ )
+ threadsafe = proto.Field(
+ proto.BOOL,
+ number=11,
+ )
+ vm = proto.Field(
+ proto.BOOL,
+ number=12,
+ )
+ beta_settings = proto.MapField(
+ proto.STRING,
+ proto.STRING,
+ number=13,
+ )
+ env = proto.Field(
+ proto.STRING,
+ number=14,
+ )
+ serving_status = proto.Field(
+ proto.ENUM,
+ number=15,
+ enum="ServingStatus",
+ )
+ created_by = proto.Field(
+ proto.STRING,
+ number=16,
+ )
create_time = proto.Field(
- proto.MESSAGE, number=17, message=timestamp_pb2.Timestamp,
+ proto.MESSAGE,
+ number=17,
+ message=timestamp_pb2.Timestamp,
+ )
+ disk_usage_bytes = proto.Field(
+ proto.INT64,
+ number=18,
+ )
+ runtime_api_version = proto.Field(
+ proto.STRING,
+ number=21,
+ )
+ runtime_main_executable_path = proto.Field(
+ proto.STRING,
+ number=22,
+ )
+ service_account = proto.Field(
+ proto.STRING,
+ number=127,
+ )
+ handlers = proto.RepeatedField(
+ proto.MESSAGE,
+ number=100,
+ message=app_yaml.UrlMap,
)
- disk_usage_bytes = proto.Field(proto.INT64, number=18,)
- runtime_api_version = proto.Field(proto.STRING, number=21,)
- runtime_main_executable_path = proto.Field(proto.STRING, number=22,)
- service_account = proto.Field(proto.STRING, number=127,)
- handlers = proto.RepeatedField(proto.MESSAGE, number=100, message=app_yaml.UrlMap,)
error_handlers = proto.RepeatedField(
- proto.MESSAGE, number=101, message=app_yaml.ErrorHandler,
+ proto.MESSAGE,
+ number=101,
+ message=app_yaml.ErrorHandler,
)
libraries = proto.RepeatedField(
- proto.MESSAGE, number=102, message=app_yaml.Library,
+ proto.MESSAGE,
+ number=102,
+ message=app_yaml.Library,
)
api_config = proto.Field(
- proto.MESSAGE, number=103, message=app_yaml.ApiConfigHandler,
+ proto.MESSAGE,
+ number=103,
+ message=app_yaml.ApiConfigHandler,
+ )
+ env_variables = proto.MapField(
+ proto.STRING,
+ proto.STRING,
+ number=104,
+ )
+ build_env_variables = proto.MapField(
+ proto.STRING,
+ proto.STRING,
+ number=125,
)
- env_variables = proto.MapField(proto.STRING, proto.STRING, number=104,)
- build_env_variables = proto.MapField(proto.STRING, proto.STRING, number=125,)
default_expiration = proto.Field(
- proto.MESSAGE, number=105, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=105,
+ message=duration_pb2.Duration,
+ )
+ health_check = proto.Field(
+ proto.MESSAGE,
+ number=106,
+ message=app_yaml.HealthCheck,
)
- health_check = proto.Field(proto.MESSAGE, number=106, message=app_yaml.HealthCheck,)
readiness_check = proto.Field(
- proto.MESSAGE, number=112, message=app_yaml.ReadinessCheck,
+ proto.MESSAGE,
+ number=112,
+ message=app_yaml.ReadinessCheck,
)
liveness_check = proto.Field(
- proto.MESSAGE, number=113, message=app_yaml.LivenessCheck,
+ proto.MESSAGE,
+ number=113,
+ message=app_yaml.LivenessCheck,
+ )
+ nobuild_files_regex = proto.Field(
+ proto.STRING,
+ number=107,
+ )
+ deployment = proto.Field(
+ proto.MESSAGE,
+ number=108,
+ message=deploy.Deployment,
+ )
+ version_url = proto.Field(
+ proto.STRING,
+ number=109,
)
- nobuild_files_regex = proto.Field(proto.STRING, number=107,)
- deployment = proto.Field(proto.MESSAGE, number=108, message=deploy.Deployment,)
- version_url = proto.Field(proto.STRING, number=109,)
endpoints_api_service = proto.Field(
- proto.MESSAGE, number=110, message="EndpointsApiService",
+ proto.MESSAGE,
+ number=110,
+ message="EndpointsApiService",
+ )
+ entrypoint = proto.Field(
+ proto.MESSAGE,
+ number=122,
+ message="Entrypoint",
)
- entrypoint = proto.Field(proto.MESSAGE, number=122, message="Entrypoint",)
vpc_access_connector = proto.Field(
- proto.MESSAGE, number=121, message="VpcAccessConnector",
+ proto.MESSAGE,
+ number=121,
+ message="VpcAccessConnector",
)
@@ -378,10 +495,23 @@ class RolloutStrategy(proto.Enum):
FIXED = 1
MANAGED = 2
- name = proto.Field(proto.STRING, number=1,)
- config_id = proto.Field(proto.STRING, number=2,)
- rollout_strategy = proto.Field(proto.ENUM, number=3, enum=RolloutStrategy,)
- disable_trace_sampling = proto.Field(proto.BOOL, number=4,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ config_id = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ rollout_strategy = proto.Field(
+ proto.ENUM,
+ number=3,
+ enum=RolloutStrategy,
+ )
+ disable_trace_sampling = proto.Field(
+ proto.BOOL,
+ number=4,
+ )
class AutomaticScaling(proto.Message):
@@ -436,29 +566,64 @@ class AutomaticScaling(proto.Message):
"""
cool_down_period = proto.Field(
- proto.MESSAGE, number=1, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=1,
+ message=duration_pb2.Duration,
+ )
+ cpu_utilization = proto.Field(
+ proto.MESSAGE,
+ number=2,
+ message="CpuUtilization",
+ )
+ max_concurrent_requests = proto.Field(
+ proto.INT32,
+ number=3,
+ )
+ max_idle_instances = proto.Field(
+ proto.INT32,
+ number=4,
+ )
+ max_total_instances = proto.Field(
+ proto.INT32,
+ number=5,
)
- cpu_utilization = proto.Field(proto.MESSAGE, number=2, message="CpuUtilization",)
- max_concurrent_requests = proto.Field(proto.INT32, number=3,)
- max_idle_instances = proto.Field(proto.INT32, number=4,)
- max_total_instances = proto.Field(proto.INT32, number=5,)
max_pending_latency = proto.Field(
- proto.MESSAGE, number=6, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=6,
+ message=duration_pb2.Duration,
+ )
+ min_idle_instances = proto.Field(
+ proto.INT32,
+ number=7,
+ )
+ min_total_instances = proto.Field(
+ proto.INT32,
+ number=8,
)
- min_idle_instances = proto.Field(proto.INT32, number=7,)
- min_total_instances = proto.Field(proto.INT32, number=8,)
min_pending_latency = proto.Field(
- proto.MESSAGE, number=9, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=9,
+ message=duration_pb2.Duration,
)
request_utilization = proto.Field(
- proto.MESSAGE, number=10, message="RequestUtilization",
+ proto.MESSAGE,
+ number=10,
+ message="RequestUtilization",
+ )
+ disk_utilization = proto.Field(
+ proto.MESSAGE,
+ number=11,
+ message="DiskUtilization",
)
- disk_utilization = proto.Field(proto.MESSAGE, number=11, message="DiskUtilization",)
network_utilization = proto.Field(
- proto.MESSAGE, number=12, message="NetworkUtilization",
+ proto.MESSAGE,
+ number=12,
+ message="NetworkUtilization",
)
standard_scheduler_settings = proto.Field(
- proto.MESSAGE, number=20, message="StandardSchedulerSettings",
+ proto.MESSAGE,
+ number=20,
+ message="StandardSchedulerSettings",
)
@@ -478,8 +643,15 @@ class BasicScaling(proto.Message):
this version.
"""
- idle_timeout = proto.Field(proto.MESSAGE, number=1, message=duration_pb2.Duration,)
- max_instances = proto.Field(proto.INT32, number=2,)
+ idle_timeout = proto.Field(
+ proto.MESSAGE,
+ number=1,
+ message=duration_pb2.Duration,
+ )
+ max_instances = proto.Field(
+ proto.INT32,
+ number=2,
+ )
class ManualScaling(proto.Message):
@@ -495,7 +667,10 @@ class ManualScaling(proto.Message):
``set_num_instances()`` function.
"""
- instances = proto.Field(proto.INT32, number=1,)
+ instances = proto.Field(
+ proto.INT32,
+ number=1,
+ )
class CpuUtilization(proto.Message):
@@ -511,9 +686,14 @@ class CpuUtilization(proto.Message):
"""
aggregation_window_length = proto.Field(
- proto.MESSAGE, number=1, message=duration_pb2.Duration,
+ proto.MESSAGE,
+ number=1,
+ message=duration_pb2.Duration,
+ )
+ target_utilization = proto.Field(
+ proto.DOUBLE,
+ number=2,
)
- target_utilization = proto.Field(proto.DOUBLE, number=2,)
class RequestUtilization(proto.Message):
@@ -527,8 +707,14 @@ class RequestUtilization(proto.Message):
Target number of concurrent requests.
"""
- target_request_count_per_second = proto.Field(proto.INT32, number=1,)
- target_concurrent_requests = proto.Field(proto.INT32, number=2,)
+ target_request_count_per_second = proto.Field(
+ proto.INT32,
+ number=1,
+ )
+ target_concurrent_requests = proto.Field(
+ proto.INT32,
+ number=2,
+ )
class DiskUtilization(proto.Message):
@@ -546,10 +732,22 @@ class DiskUtilization(proto.Message):
Target ops read per seconds.
"""
- target_write_bytes_per_second = proto.Field(proto.INT32, number=14,)
- target_write_ops_per_second = proto.Field(proto.INT32, number=15,)
- target_read_bytes_per_second = proto.Field(proto.INT32, number=16,)
- target_read_ops_per_second = proto.Field(proto.INT32, number=17,)
+ target_write_bytes_per_second = proto.Field(
+ proto.INT32,
+ number=14,
+ )
+ target_write_ops_per_second = proto.Field(
+ proto.INT32,
+ number=15,
+ )
+ target_read_bytes_per_second = proto.Field(
+ proto.INT32,
+ number=16,
+ )
+ target_read_ops_per_second = proto.Field(
+ proto.INT32,
+ number=17,
+ )
class NetworkUtilization(proto.Message):
@@ -567,10 +765,22 @@ class NetworkUtilization(proto.Message):
Target packets received per second.
"""
- target_sent_bytes_per_second = proto.Field(proto.INT32, number=1,)
- target_sent_packets_per_second = proto.Field(proto.INT32, number=11,)
- target_received_bytes_per_second = proto.Field(proto.INT32, number=12,)
- target_received_packets_per_second = proto.Field(proto.INT32, number=13,)
+ target_sent_bytes_per_second = proto.Field(
+ proto.INT32,
+ number=1,
+ )
+ target_sent_packets_per_second = proto.Field(
+ proto.INT32,
+ number=11,
+ )
+ target_received_bytes_per_second = proto.Field(
+ proto.INT32,
+ number=12,
+ )
+ target_received_packets_per_second = proto.Field(
+ proto.INT32,
+ number=13,
+ )
class StandardSchedulerSettings(proto.Message):
@@ -591,10 +801,22 @@ class StandardSchedulerSettings(proto.Message):
zero to disable ``max_instances`` configuration.
"""
- target_cpu_utilization = proto.Field(proto.DOUBLE, number=1,)
- target_throughput_utilization = proto.Field(proto.DOUBLE, number=2,)
- min_instances = proto.Field(proto.INT32, number=3,)
- max_instances = proto.Field(proto.INT32, number=4,)
+ target_cpu_utilization = proto.Field(
+ proto.DOUBLE,
+ number=1,
+ )
+ target_throughput_utilization = proto.Field(
+ proto.DOUBLE,
+ number=2,
+ )
+ min_instances = proto.Field(
+ proto.INT32,
+ number=3,
+ )
+ max_instances = proto.Field(
+ proto.INT32,
+ number=4,
+ )
class Network(proto.Message):
@@ -644,11 +866,26 @@ class Network(proto.Message):
environment.
"""
- forwarded_ports = proto.RepeatedField(proto.STRING, number=1,)
- instance_tag = proto.Field(proto.STRING, number=2,)
- name = proto.Field(proto.STRING, number=3,)
- subnetwork_name = proto.Field(proto.STRING, number=4,)
- session_affinity = proto.Field(proto.BOOL, number=5,)
+ forwarded_ports = proto.RepeatedField(
+ proto.STRING,
+ number=1,
+ )
+ instance_tag = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ name = proto.Field(
+ proto.STRING,
+ number=3,
+ )
+ subnetwork_name = proto.Field(
+ proto.STRING,
+ number=4,
+ )
+ session_affinity = proto.Field(
+ proto.BOOL,
+ number=5,
+ )
class Volume(proto.Message):
@@ -664,9 +901,18 @@ class Volume(proto.Message):
Volume size in gigabytes.
"""
- name = proto.Field(proto.STRING, number=1,)
- volume_type = proto.Field(proto.STRING, number=2,)
- size_gb = proto.Field(proto.DOUBLE, number=3,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
+ volume_type = proto.Field(
+ proto.STRING,
+ number=2,
+ )
+ size_gb = proto.Field(
+ proto.DOUBLE,
+ number=3,
+ )
class Resources(proto.Message):
@@ -687,11 +933,27 @@ class Resources(proto.Message):
Cloud Composer to encrypt the vm disk
"""
- cpu = proto.Field(proto.DOUBLE, number=1,)
- disk_gb = proto.Field(proto.DOUBLE, number=2,)
- memory_gb = proto.Field(proto.DOUBLE, number=3,)
- volumes = proto.RepeatedField(proto.MESSAGE, number=4, message="Volume",)
- kms_key_reference = proto.Field(proto.STRING, number=5,)
+ cpu = proto.Field(
+ proto.DOUBLE,
+ number=1,
+ )
+ disk_gb = proto.Field(
+ proto.DOUBLE,
+ number=2,
+ )
+ memory_gb = proto.Field(
+ proto.DOUBLE,
+ number=3,
+ )
+ volumes = proto.RepeatedField(
+ proto.MESSAGE,
+ number=4,
+ message="Volume",
+ )
+ kms_key_reference = proto.Field(
+ proto.STRING,
+ number=5,
+ )
class VpcAccessConnector(proto.Message):
@@ -704,7 +966,10 @@ class VpcAccessConnector(proto.Message):
/projects/my-project/locations/us-central1/connectors/c1.
"""
- name = proto.Field(proto.STRING, number=1,)
+ name = proto.Field(
+ proto.STRING,
+ number=1,
+ )
class Entrypoint(proto.Message):
@@ -720,7 +985,11 @@ class Entrypoint(proto.Message):
This field is a member of `oneof`_ ``command``.
"""
- shell = proto.Field(proto.STRING, number=1, oneof="command",)
+ shell = proto.Field(
+ proto.STRING,
+ number=1,
+ oneof="command",
+ )
__all__ = tuple(sorted(__protobuf__.manifest))
diff --git a/noxfile.py b/noxfile.py
index 2a2001c..6ee5e8a 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -20,16 +20,40 @@
import os
import pathlib
import shutil
+import warnings
import nox
-
-BLACK_VERSION = "black==19.10b0"
+BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
DEFAULT_PYTHON_VERSION = "3.8"
-SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
+
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
+UNIT_TEST_STANDARD_DEPENDENCIES = [
+ "mock",
+ "asyncmock",
+ "pytest",
+ "pytest-cov",
+ "pytest-asyncio",
+]
+UNIT_TEST_EXTERNAL_DEPENDENCIES = []
+UNIT_TEST_LOCAL_DEPENDENCIES = []
+UNIT_TEST_DEPENDENCIES = []
+UNIT_TEST_EXTRAS = []
+UNIT_TEST_EXTRAS_BY_PYTHON = {}
+
+SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
+SYSTEM_TEST_STANDARD_DEPENDENCIES = [
+ "mock",
+ "pytest",
+ "google-cloud-testutils",
+]
+SYSTEM_TEST_EXTERNAL_DEPENDENCIES = []
+SYSTEM_TEST_LOCAL_DEPENDENCIES = []
+SYSTEM_TEST_DEPENDENCIES = []
+SYSTEM_TEST_EXTRAS = []
+SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
@@ -57,7 +81,9 @@ def lint(session):
"""
session.install("flake8", BLACK_VERSION)
session.run(
- "black", "--check", *BLACK_PATHS,
+ "black",
+ "--check",
+ *BLACK_PATHS,
)
session.run("flake8", "google", "tests")
@@ -67,7 +93,8 @@ def blacken(session):
"""Run black. Format code to uniform standard."""
session.install(BLACK_VERSION)
session.run(
- "black", *BLACK_PATHS,
+ "black",
+ *BLACK_PATHS,
)
@@ -78,23 +105,41 @@ def lint_setup_py(session):
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
+def install_unittest_dependencies(session, *constraints):
+ standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
+ session.install(*standard_deps, *constraints)
+
+ if UNIT_TEST_EXTERNAL_DEPENDENCIES:
+ warnings.warn(
+ "'unit_test_external_dependencies' is deprecated. Instead, please "
+ "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.",
+ DeprecationWarning,
+ )
+ session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints)
+
+ if UNIT_TEST_LOCAL_DEPENDENCIES:
+ session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints)
+
+ if UNIT_TEST_EXTRAS_BY_PYTHON:
+ extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
+ elif UNIT_TEST_EXTRAS:
+ extras = UNIT_TEST_EXTRAS
+ else:
+ extras = []
+
+ if extras:
+ session.install("-e", f".[{','.join(extras)}]", *constraints)
+ else:
+ session.install("-e", ".", *constraints)
+
+
def default(session):
# Install all test dependencies, then install this package in-place.
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
- session.install(
- "mock",
- "asyncmock",
- "pytest",
- "pytest-cov",
- "pytest-asyncio",
- "-c",
- constraints_path,
- )
-
- session.install("-e", ".", "-c", constraints_path)
+ install_unittest_dependencies(session, "-c", constraints_path)
# Run py.test against the unit tests.
session.run(
@@ -118,6 +163,35 @@ def unit(session):
default(session)
+def install_systemtest_dependencies(session, *constraints):
+
+ # Use pre-release gRPC for system tests.
+ session.install("--pre", "grpcio")
+
+ session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_EXTERNAL_DEPENDENCIES:
+ session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_LOCAL_DEPENDENCIES:
+ session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_DEPENDENCIES:
+ session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints)
+
+ if SYSTEM_TEST_EXTRAS_BY_PYTHON:
+ extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
+ elif SYSTEM_TEST_EXTRAS:
+ extras = SYSTEM_TEST_EXTRAS
+ else:
+ extras = []
+
+ if extras:
+ session.install("-e", f".[{','.join(extras)}]", *constraints)
+ else:
+ session.install("-e", ".", *constraints)
+
+
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
"""Run the system test suite."""
@@ -140,13 +214,7 @@ def system(session):
if not system_test_exists and not system_test_folder_exists:
session.skip("System tests were not found")
- # Use pre-release gRPC for system tests.
- session.install("--pre", "grpcio")
-
- # Install all test dependencies, then install this package into the
- # virtualenv's dist-packages.
- session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path)
- session.install("-e", ".", "-c", constraints_path)
+ install_systemtest_dependencies(session, "-c", constraints_path)
# Run py.test against the system tests.
if system_test_exists:
diff --git a/samples/generated_samples/snippet_metadata_appengine admin_v1.json b/samples/generated_samples/snippet_metadata_appengine admin_v1.json
index 445ed92..7d498a2 100644
--- a/samples/generated_samples/snippet_metadata_appengine admin_v1.json
+++ b/samples/generated_samples/snippet_metadata_appengine admin_v1.json
@@ -1,16 +1,57 @@
{
+ "clientLibrary": {
+ "apis": [
+ {
+ "id": "google.appengine.v1",
+ "version": "v1"
+ }
+ ],
+ "language": "PYTHON",
+ "name": "google-cloud-appengine-admin"
+ },
"snippets": [
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient",
+ "shortName": "ApplicationsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient.create_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.CreateApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "CreateApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "create_application"
},
+ "description": "Sample for CreateApplication",
"file": "appengine_v1_generated_applications_create_application_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_CreateApplication_async",
"segments": [
{
@@ -43,18 +84,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_create_application_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient",
+ "shortName": "ApplicationsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient.create_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.CreateApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "CreateApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "create_application"
},
+ "description": "Sample for CreateApplication",
"file": "appengine_v1_generated_applications_create_application_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_CreateApplication_sync",
"segments": [
{
@@ -87,19 +160,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_create_application_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient",
+ "shortName": "ApplicationsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient.get_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.GetApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "GetApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Application",
+ "shortName": "get_application"
},
+ "description": "Sample for GetApplication",
"file": "appengine_v1_generated_applications_get_application_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_GetApplication_async",
"segments": [
{
@@ -132,18 +237,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_get_application_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient",
+ "shortName": "ApplicationsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient.get_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.GetApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "GetApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Application",
+ "shortName": "get_application"
},
+ "description": "Sample for GetApplication",
"file": "appengine_v1_generated_applications_get_application_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_GetApplication_sync",
"segments": [
{
@@ -176,19 +313,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_get_application_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient",
+ "shortName": "ApplicationsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient.repair_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.RepairApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "RepairApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.RepairApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "repair_application"
},
+ "description": "Sample for RepairApplication",
"file": "appengine_v1_generated_applications_repair_application_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_RepairApplication_async",
"segments": [
{
@@ -221,18 +390,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_repair_application_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient",
+ "shortName": "ApplicationsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient.repair_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.RepairApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "RepairApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.RepairApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "repair_application"
},
+ "description": "Sample for RepairApplication",
"file": "appengine_v1_generated_applications_repair_application_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_RepairApplication_sync",
"segments": [
{
@@ -265,19 +466,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_repair_application_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient",
+ "shortName": "ApplicationsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsAsyncClient.update_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.UpdateApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "UpdateApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "update_application"
},
+ "description": "Sample for UpdateApplication",
"file": "appengine_v1_generated_applications_update_application_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_UpdateApplication_async",
"segments": [
{
@@ -310,18 +543,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_update_application_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient",
+ "shortName": "ApplicationsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ApplicationsClient.update_application",
"method": {
+ "fullName": "google.appengine.v1.Applications.UpdateApplication",
"service": {
+ "fullName": "google.appengine.v1.Applications",
"shortName": "Applications"
},
"shortName": "UpdateApplication"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateApplicationRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "update_application"
},
+ "description": "Sample for UpdateApplication",
"file": "appengine_v1_generated_applications_update_application_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Applications_UpdateApplication_sync",
"segments": [
{
@@ -354,19 +619,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_applications_update_application_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient",
+ "shortName": "AuthorizedCertificatesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient.create_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "CreateAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "create_authorized_certificate"
},
+ "description": "Sample for CreateAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_create_authorized_certificate_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_async",
"segments": [
{
@@ -399,18 +696,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_create_authorized_certificate_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient",
+ "shortName": "AuthorizedCertificatesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient.create_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.CreateAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "CreateAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "create_authorized_certificate"
},
+ "description": "Sample for CreateAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_create_authorized_certificate_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_sync",
"segments": [
{
@@ -443,19 +772,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_create_authorized_certificate_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient",
+ "shortName": "AuthorizedCertificatesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient.delete_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "DeleteAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "shortName": "delete_authorized_certificate"
},
+ "description": "Sample for DeleteAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_delete_authorized_certificate_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_async",
"segments": [
{
@@ -486,18 +846,49 @@
"end": 42,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_delete_authorized_certificate_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient",
+ "shortName": "AuthorizedCertificatesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient.delete_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.DeleteAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "DeleteAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "shortName": "delete_authorized_certificate"
},
+ "description": "Sample for DeleteAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_delete_authorized_certificate_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_sync",
"segments": [
{
@@ -528,19 +919,51 @@
"end": 42,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_delete_authorized_certificate_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient",
+ "shortName": "AuthorizedCertificatesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient.get_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "GetAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "get_authorized_certificate"
},
+ "description": "Sample for GetAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_get_authorized_certificate_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_async",
"segments": [
{
@@ -573,18 +996,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_get_authorized_certificate_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient",
+ "shortName": "AuthorizedCertificatesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient.get_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.GetAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "GetAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "get_authorized_certificate"
},
+ "description": "Sample for GetAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_get_authorized_certificate_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_sync",
"segments": [
{
@@ -617,19 +1072,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_get_authorized_certificate_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient",
+ "shortName": "AuthorizedCertificatesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient.list_authorized_certificates",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificates",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "ListAuthorizedCertificates"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListAuthorizedCertificatesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.authorized_certificates.pagers.ListAuthorizedCertificatesAsyncPager",
+ "shortName": "list_authorized_certificates"
},
+ "description": "Sample for ListAuthorizedCertificates",
"file": "appengine_v1_generated_authorized_certificates_list_authorized_certificates_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_async",
"segments": [
{
@@ -662,18 +1149,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_list_authorized_certificates_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient",
+ "shortName": "AuthorizedCertificatesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient.list_authorized_certificates",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.ListAuthorizedCertificates",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "ListAuthorizedCertificates"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListAuthorizedCertificatesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.authorized_certificates.pagers.ListAuthorizedCertificatesPager",
+ "shortName": "list_authorized_certificates"
},
+ "description": "Sample for ListAuthorizedCertificates",
"file": "appengine_v1_generated_authorized_certificates_list_authorized_certificates_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_sync",
"segments": [
{
@@ -706,19 +1225,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_list_authorized_certificates_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient",
+ "shortName": "AuthorizedCertificatesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesAsyncClient.update_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "UpdateAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "update_authorized_certificate"
},
+ "description": "Sample for UpdateAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_update_authorized_certificate_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_async",
"segments": [
{
@@ -751,18 +1302,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_update_authorized_certificate_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient",
+ "shortName": "AuthorizedCertificatesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedCertificatesClient.update_authorized_certificate",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates.UpdateAuthorizedCertificate",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedCertificates",
"shortName": "AuthorizedCertificates"
},
"shortName": "UpdateAuthorizedCertificate"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateAuthorizedCertificateRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.AuthorizedCertificate",
+ "shortName": "update_authorized_certificate"
},
+ "description": "Sample for UpdateAuthorizedCertificate",
"file": "appengine_v1_generated_authorized_certificates_update_authorized_certificate_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_sync",
"segments": [
{
@@ -795,19 +1378,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_certificates_update_authorized_certificate_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedDomainsAsyncClient",
+ "shortName": "AuthorizedDomainsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedDomainsAsyncClient.list_authorized_domains",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedDomains.ListAuthorizedDomains",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedDomains",
"shortName": "AuthorizedDomains"
},
"shortName": "ListAuthorizedDomains"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListAuthorizedDomainsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.authorized_domains.pagers.ListAuthorizedDomainsAsyncPager",
+ "shortName": "list_authorized_domains"
},
+ "description": "Sample for ListAuthorizedDomains",
"file": "appengine_v1_generated_authorized_domains_list_authorized_domains_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_async",
"segments": [
{
@@ -840,18 +1455,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_domains_list_authorized_domains_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedDomainsClient",
+ "shortName": "AuthorizedDomainsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.AuthorizedDomainsClient.list_authorized_domains",
"method": {
+ "fullName": "google.appengine.v1.AuthorizedDomains.ListAuthorizedDomains",
"service": {
+ "fullName": "google.appengine.v1.AuthorizedDomains",
"shortName": "AuthorizedDomains"
},
"shortName": "ListAuthorizedDomains"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListAuthorizedDomainsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.authorized_domains.pagers.ListAuthorizedDomainsPager",
+ "shortName": "list_authorized_domains"
},
+ "description": "Sample for ListAuthorizedDomains",
"file": "appengine_v1_generated_authorized_domains_list_authorized_domains_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_sync",
"segments": [
{
@@ -884,19 +1531,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_authorized_domains_list_authorized_domains_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient",
+ "shortName": "DomainMappingsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient.create_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.CreateDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "CreateDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "create_domain_mapping"
},
+ "description": "Sample for CreateDomainMapping",
"file": "appengine_v1_generated_domain_mappings_create_domain_mapping_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_CreateDomainMapping_async",
"segments": [
{
@@ -929,18 +1608,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_create_domain_mapping_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient",
+ "shortName": "DomainMappingsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient.create_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.CreateDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "CreateDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "create_domain_mapping"
},
+ "description": "Sample for CreateDomainMapping",
"file": "appengine_v1_generated_domain_mappings_create_domain_mapping_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_CreateDomainMapping_sync",
"segments": [
{
@@ -973,19 +1684,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_create_domain_mapping_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient",
+ "shortName": "DomainMappingsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient.delete_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.DeleteDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "DeleteDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "delete_domain_mapping"
},
+ "description": "Sample for DeleteDomainMapping",
"file": "appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_DeleteDomainMapping_async",
"segments": [
{
@@ -1018,18 +1761,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient",
+ "shortName": "DomainMappingsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient.delete_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.DeleteDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "DeleteDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "delete_domain_mapping"
},
+ "description": "Sample for DeleteDomainMapping",
"file": "appengine_v1_generated_domain_mappings_delete_domain_mapping_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_DeleteDomainMapping_sync",
"segments": [
{
@@ -1062,19 +1837,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_delete_domain_mapping_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient",
+ "shortName": "DomainMappingsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient.get_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.GetDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "GetDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.DomainMapping",
+ "shortName": "get_domain_mapping"
},
+ "description": "Sample for GetDomainMapping",
"file": "appengine_v1_generated_domain_mappings_get_domain_mapping_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_GetDomainMapping_async",
"segments": [
{
@@ -1107,18 +1914,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_get_domain_mapping_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient",
+ "shortName": "DomainMappingsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient.get_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.GetDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "GetDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.DomainMapping",
+ "shortName": "get_domain_mapping"
},
+ "description": "Sample for GetDomainMapping",
"file": "appengine_v1_generated_domain_mappings_get_domain_mapping_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_GetDomainMapping_sync",
"segments": [
{
@@ -1151,19 +1990,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_get_domain_mapping_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient",
+ "shortName": "DomainMappingsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient.list_domain_mappings",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.ListDomainMappings",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "ListDomainMappings"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListDomainMappingsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.domain_mappings.pagers.ListDomainMappingsAsyncPager",
+ "shortName": "list_domain_mappings"
},
+ "description": "Sample for ListDomainMappings",
"file": "appengine_v1_generated_domain_mappings_list_domain_mappings_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_ListDomainMappings_async",
"segments": [
{
@@ -1196,18 +2067,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_list_domain_mappings_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient",
+ "shortName": "DomainMappingsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient.list_domain_mappings",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.ListDomainMappings",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "ListDomainMappings"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListDomainMappingsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.domain_mappings.pagers.ListDomainMappingsPager",
+ "shortName": "list_domain_mappings"
},
+ "description": "Sample for ListDomainMappings",
"file": "appengine_v1_generated_domain_mappings_list_domain_mappings_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_ListDomainMappings_sync",
"segments": [
{
@@ -1240,19 +2143,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_list_domain_mappings_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient",
+ "shortName": "DomainMappingsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsAsyncClient.update_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.UpdateDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "UpdateDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "update_domain_mapping"
},
+ "description": "Sample for UpdateDomainMapping",
"file": "appengine_v1_generated_domain_mappings_update_domain_mapping_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_UpdateDomainMapping_async",
"segments": [
{
@@ -1285,18 +2220,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_update_domain_mapping_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient",
+ "shortName": "DomainMappingsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.DomainMappingsClient.update_domain_mapping",
"method": {
+ "fullName": "google.appengine.v1.DomainMappings.UpdateDomainMapping",
"service": {
+ "fullName": "google.appengine.v1.DomainMappings",
"shortName": "DomainMappings"
},
"shortName": "UpdateDomainMapping"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateDomainMappingRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "update_domain_mapping"
},
+ "description": "Sample for UpdateDomainMapping",
"file": "appengine_v1_generated_domain_mappings_update_domain_mapping_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_DomainMappings_UpdateDomainMapping_sync",
"segments": [
{
@@ -1329,19 +2296,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_domain_mappings_update_domain_mapping_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.batch_update_ingress_rules",
"method": {
+ "fullName": "google.appengine.v1.Firewall.BatchUpdateIngressRules",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "BatchUpdateIngressRules"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.BatchUpdateIngressRulesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.BatchUpdateIngressRulesResponse",
+ "shortName": "batch_update_ingress_rules"
},
+ "description": "Sample for BatchUpdateIngressRules",
"file": "appengine_v1_generated_firewall_batch_update_ingress_rules_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_BatchUpdateIngressRules_async",
"segments": [
{
@@ -1374,18 +2373,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_batch_update_ingress_rules_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.batch_update_ingress_rules",
"method": {
+ "fullName": "google.appengine.v1.Firewall.BatchUpdateIngressRules",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "BatchUpdateIngressRules"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.BatchUpdateIngressRulesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.BatchUpdateIngressRulesResponse",
+ "shortName": "batch_update_ingress_rules"
},
+ "description": "Sample for BatchUpdateIngressRules",
"file": "appengine_v1_generated_firewall_batch_update_ingress_rules_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_BatchUpdateIngressRules_sync",
"segments": [
{
@@ -1418,19 +2449,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_batch_update_ingress_rules_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.create_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.CreateIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "CreateIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "create_ingress_rule"
},
+ "description": "Sample for CreateIngressRule",
"file": "appengine_v1_generated_firewall_create_ingress_rule_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_CreateIngressRule_async",
"segments": [
{
@@ -1463,18 +2526,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_create_ingress_rule_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.create_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.CreateIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "CreateIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "create_ingress_rule"
},
+ "description": "Sample for CreateIngressRule",
"file": "appengine_v1_generated_firewall_create_ingress_rule_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_CreateIngressRule_sync",
"segments": [
{
@@ -1507,19 +2602,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_create_ingress_rule_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.delete_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.DeleteIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "DeleteIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "shortName": "delete_ingress_rule"
},
+ "description": "Sample for DeleteIngressRule",
"file": "appengine_v1_generated_firewall_delete_ingress_rule_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_DeleteIngressRule_async",
"segments": [
{
@@ -1550,18 +2676,49 @@
"end": 42,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_delete_ingress_rule_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.delete_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.DeleteIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "DeleteIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "shortName": "delete_ingress_rule"
},
+ "description": "Sample for DeleteIngressRule",
"file": "appengine_v1_generated_firewall_delete_ingress_rule_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_DeleteIngressRule_sync",
"segments": [
{
@@ -1592,19 +2749,51 @@
"end": 42,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_delete_ingress_rule_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.get_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.GetIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "GetIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "get_ingress_rule"
},
+ "description": "Sample for GetIngressRule",
"file": "appengine_v1_generated_firewall_get_ingress_rule_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_GetIngressRule_async",
"segments": [
{
@@ -1637,18 +2826,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_get_ingress_rule_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.get_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.GetIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "GetIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "get_ingress_rule"
},
+ "description": "Sample for GetIngressRule",
"file": "appengine_v1_generated_firewall_get_ingress_rule_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_GetIngressRule_sync",
"segments": [
{
@@ -1681,19 +2902,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_get_ingress_rule_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.list_ingress_rules",
"method": {
+ "fullName": "google.appengine.v1.Firewall.ListIngressRules",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "ListIngressRules"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListIngressRulesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.firewall.pagers.ListIngressRulesAsyncPager",
+ "shortName": "list_ingress_rules"
},
+ "description": "Sample for ListIngressRules",
"file": "appengine_v1_generated_firewall_list_ingress_rules_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_ListIngressRules_async",
"segments": [
{
@@ -1726,18 +2979,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_list_ingress_rules_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.list_ingress_rules",
"method": {
+ "fullName": "google.appengine.v1.Firewall.ListIngressRules",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "ListIngressRules"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListIngressRulesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.firewall.pagers.ListIngressRulesPager",
+ "shortName": "list_ingress_rules"
},
+ "description": "Sample for ListIngressRules",
"file": "appengine_v1_generated_firewall_list_ingress_rules_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_ListIngressRules_sync",
"segments": [
{
@@ -1770,19 +3055,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_list_ingress_rules_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient",
+ "shortName": "FirewallAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallAsyncClient.update_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.UpdateIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "UpdateIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "update_ingress_rule"
},
+ "description": "Sample for UpdateIngressRule",
"file": "appengine_v1_generated_firewall_update_ingress_rule_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_UpdateIngressRule_async",
"segments": [
{
@@ -1815,18 +3132,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_update_ingress_rule_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient",
+ "shortName": "FirewallClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.FirewallClient.update_ingress_rule",
"method": {
+ "fullName": "google.appengine.v1.Firewall.UpdateIngressRule",
"service": {
+ "fullName": "google.appengine.v1.Firewall",
"shortName": "Firewall"
},
"shortName": "UpdateIngressRule"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateIngressRuleRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.FirewallRule",
+ "shortName": "update_ingress_rule"
},
+ "description": "Sample for UpdateIngressRule",
"file": "appengine_v1_generated_firewall_update_ingress_rule_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Firewall_UpdateIngressRule_sync",
"segments": [
{
@@ -1859,19 +3208,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_firewall_update_ingress_rule_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient",
+ "shortName": "InstancesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient.debug_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.DebugInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "DebugInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DebugInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "debug_instance"
},
+ "description": "Sample for DebugInstance",
"file": "appengine_v1_generated_instances_debug_instance_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_DebugInstance_async",
"segments": [
{
@@ -1904,18 +3285,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_debug_instance_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient",
+ "shortName": "InstancesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient.debug_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.DebugInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "DebugInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DebugInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "debug_instance"
},
+ "description": "Sample for DebugInstance",
"file": "appengine_v1_generated_instances_debug_instance_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_DebugInstance_sync",
"segments": [
{
@@ -1948,19 +3361,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_debug_instance_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient",
+ "shortName": "InstancesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient.delete_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.DeleteInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "DeleteInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "delete_instance"
},
+ "description": "Sample for DeleteInstance",
"file": "appengine_v1_generated_instances_delete_instance_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_DeleteInstance_async",
"segments": [
{
@@ -1993,18 +3438,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_delete_instance_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient",
+ "shortName": "InstancesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient.delete_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.DeleteInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "DeleteInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "delete_instance"
},
+ "description": "Sample for DeleteInstance",
"file": "appengine_v1_generated_instances_delete_instance_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_DeleteInstance_sync",
"segments": [
{
@@ -2037,19 +3514,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_delete_instance_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient",
+ "shortName": "InstancesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient.get_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.GetInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "GetInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Instance",
+ "shortName": "get_instance"
},
+ "description": "Sample for GetInstance",
"file": "appengine_v1_generated_instances_get_instance_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_GetInstance_async",
"segments": [
{
@@ -2082,18 +3591,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_get_instance_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient",
+ "shortName": "InstancesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient.get_instance",
"method": {
+ "fullName": "google.appengine.v1.Instances.GetInstance",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "GetInstance"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetInstanceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Instance",
+ "shortName": "get_instance"
},
+ "description": "Sample for GetInstance",
"file": "appengine_v1_generated_instances_get_instance_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_GetInstance_sync",
"segments": [
{
@@ -2126,19 +3667,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_get_instance_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient",
+ "shortName": "InstancesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesAsyncClient.list_instances",
"method": {
+ "fullName": "google.appengine.v1.Instances.ListInstances",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "ListInstances"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListInstancesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.instances.pagers.ListInstancesAsyncPager",
+ "shortName": "list_instances"
},
+ "description": "Sample for ListInstances",
"file": "appengine_v1_generated_instances_list_instances_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_ListInstances_async",
"segments": [
{
@@ -2171,18 +3744,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_list_instances_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient",
+ "shortName": "InstancesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.InstancesClient.list_instances",
"method": {
+ "fullName": "google.appengine.v1.Instances.ListInstances",
"service": {
+ "fullName": "google.appengine.v1.Instances",
"shortName": "Instances"
},
"shortName": "ListInstances"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListInstancesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.instances.pagers.ListInstancesPager",
+ "shortName": "list_instances"
},
+ "description": "Sample for ListInstances",
"file": "appengine_v1_generated_instances_list_instances_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Instances_ListInstances_sync",
"segments": [
{
@@ -2215,19 +3820,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_instances_list_instances_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient",
+ "shortName": "ServicesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient.delete_service",
"method": {
+ "fullName": "google.appengine.v1.Services.DeleteService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "DeleteService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "delete_service"
},
+ "description": "Sample for DeleteService",
"file": "appengine_v1_generated_services_delete_service_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_DeleteService_async",
"segments": [
{
@@ -2260,18 +3897,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_delete_service_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient",
+ "shortName": "ServicesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient.delete_service",
"method": {
+ "fullName": "google.appengine.v1.Services.DeleteService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "DeleteService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "delete_service"
},
+ "description": "Sample for DeleteService",
"file": "appengine_v1_generated_services_delete_service_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_DeleteService_sync",
"segments": [
{
@@ -2304,19 +3973,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_delete_service_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient",
+ "shortName": "ServicesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient.get_service",
"method": {
+ "fullName": "google.appengine.v1.Services.GetService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "GetService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Service",
+ "shortName": "get_service"
},
+ "description": "Sample for GetService",
"file": "appengine_v1_generated_services_get_service_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_GetService_async",
"segments": [
{
@@ -2349,18 +4050,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_get_service_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient",
+ "shortName": "ServicesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient.get_service",
"method": {
+ "fullName": "google.appengine.v1.Services.GetService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "GetService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Service",
+ "shortName": "get_service"
},
+ "description": "Sample for GetService",
"file": "appengine_v1_generated_services_get_service_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_GetService_sync",
"segments": [
{
@@ -2393,19 +4126,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_get_service_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient",
+ "shortName": "ServicesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient.list_services",
"method": {
+ "fullName": "google.appengine.v1.Services.ListServices",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "ListServices"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListServicesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.services.pagers.ListServicesAsyncPager",
+ "shortName": "list_services"
},
+ "description": "Sample for ListServices",
"file": "appengine_v1_generated_services_list_services_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_ListServices_async",
"segments": [
{
@@ -2438,18 +4203,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_list_services_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient",
+ "shortName": "ServicesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient.list_services",
"method": {
+ "fullName": "google.appengine.v1.Services.ListServices",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "ListServices"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListServicesRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.services.pagers.ListServicesPager",
+ "shortName": "list_services"
},
+ "description": "Sample for ListServices",
"file": "appengine_v1_generated_services_list_services_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_ListServices_sync",
"segments": [
{
@@ -2482,19 +4279,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_list_services_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient",
+ "shortName": "ServicesAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesAsyncClient.update_service",
"method": {
+ "fullName": "google.appengine.v1.Services.UpdateService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "UpdateService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "update_service"
},
+ "description": "Sample for UpdateService",
"file": "appengine_v1_generated_services_update_service_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_UpdateService_async",
"segments": [
{
@@ -2527,18 +4356,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_update_service_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient",
+ "shortName": "ServicesClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.ServicesClient.update_service",
"method": {
+ "fullName": "google.appengine.v1.Services.UpdateService",
"service": {
+ "fullName": "google.appengine.v1.Services",
"shortName": "Services"
},
"shortName": "UpdateService"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateServiceRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "update_service"
},
+ "description": "Sample for UpdateService",
"file": "appengine_v1_generated_services_update_service_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Services_UpdateService_sync",
"segments": [
{
@@ -2571,19 +4432,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_services_update_service_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient",
+ "shortName": "VersionsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient.create_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.CreateVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "CreateVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "create_version"
},
+ "description": "Sample for CreateVersion",
"file": "appengine_v1_generated_versions_create_version_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_CreateVersion_async",
"segments": [
{
@@ -2616,18 +4509,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_create_version_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient",
+ "shortName": "VersionsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient.create_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.CreateVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "CreateVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.CreateVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "create_version"
},
+ "description": "Sample for CreateVersion",
"file": "appengine_v1_generated_versions_create_version_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_CreateVersion_sync",
"segments": [
{
@@ -2660,19 +4585,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_create_version_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient",
+ "shortName": "VersionsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient.delete_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.DeleteVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "DeleteVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "delete_version"
},
+ "description": "Sample for DeleteVersion",
"file": "appengine_v1_generated_versions_delete_version_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_DeleteVersion_async",
"segments": [
{
@@ -2705,18 +4662,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_delete_version_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient",
+ "shortName": "VersionsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient.delete_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.DeleteVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "DeleteVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.DeleteVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "delete_version"
},
+ "description": "Sample for DeleteVersion",
"file": "appengine_v1_generated_versions_delete_version_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_DeleteVersion_sync",
"segments": [
{
@@ -2749,19 +4738,51 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_delete_version_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient",
+ "shortName": "VersionsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient.get_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.GetVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "GetVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Version",
+ "shortName": "get_version"
},
+ "description": "Sample for GetVersion",
"file": "appengine_v1_generated_versions_get_version_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_GetVersion_async",
"segments": [
{
@@ -2794,18 +4815,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_get_version_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient",
+ "shortName": "VersionsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient.get_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.GetVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "GetVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.GetVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.types.Version",
+ "shortName": "get_version"
},
+ "description": "Sample for GetVersion",
"file": "appengine_v1_generated_versions_get_version_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_GetVersion_sync",
"segments": [
{
@@ -2838,19 +4891,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_get_version_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient",
+ "shortName": "VersionsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient.list_versions",
"method": {
+ "fullName": "google.appengine.v1.Versions.ListVersions",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "ListVersions"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListVersionsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.versions.pagers.ListVersionsAsyncPager",
+ "shortName": "list_versions"
},
+ "description": "Sample for ListVersions",
"file": "appengine_v1_generated_versions_list_versions_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_ListVersions_async",
"segments": [
{
@@ -2883,18 +4968,50 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_list_versions_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient",
+ "shortName": "VersionsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient.list_versions",
"method": {
+ "fullName": "google.appengine.v1.Versions.ListVersions",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "ListVersions"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.ListVersionsRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.cloud.appengine_admin_v1.services.versions.pagers.ListVersionsPager",
+ "shortName": "list_versions"
},
+ "description": "Sample for ListVersions",
"file": "appengine_v1_generated_versions_list_versions_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_ListVersions_sync",
"segments": [
{
@@ -2927,19 +5044,51 @@
"start": 41,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_list_versions_sync.py"
},
{
+ "canonical": true,
"clientMethod": {
"async": true,
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient",
+ "shortName": "VersionsAsyncClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsAsyncClient.update_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.UpdateVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "UpdateVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation_async.AsyncOperation",
+ "shortName": "update_version"
},
+ "description": "Sample for UpdateVersion",
"file": "appengine_v1_generated_versions_update_version_async.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_UpdateVersion_async",
"segments": [
{
@@ -2972,18 +5121,50 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_update_version_async.py"
},
{
+ "canonical": true,
"clientMethod": {
+ "client": {
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient",
+ "shortName": "VersionsClient"
+ },
+ "fullName": "google.cloud.appengine_admin_v1.VersionsClient.update_version",
"method": {
+ "fullName": "google.appengine.v1.Versions.UpdateVersion",
"service": {
+ "fullName": "google.appengine.v1.Versions",
"shortName": "Versions"
},
"shortName": "UpdateVersion"
- }
+ },
+ "parameters": [
+ {
+ "name": "request",
+ "type": "google.cloud.appengine_admin_v1.types.UpdateVersionRequest"
+ },
+ {
+ "name": "retry",
+ "type": "google.api_core.retry.Retry"
+ },
+ {
+ "name": "timeout",
+ "type": "float"
+ },
+ {
+ "name": "metadata",
+ "type": "Sequence[Tuple[str, str]"
+ }
+ ],
+ "resultType": "google.api_core.operation.Operation",
+ "shortName": "update_version"
},
+ "description": "Sample for UpdateVersion",
"file": "appengine_v1_generated_versions_update_version_sync.py",
+ "language": "PYTHON",
+ "origin": "API_DEFINITION",
"regionTag": "appengine_v1_generated_Versions_UpdateVersion_sync",
"segments": [
{
@@ -3016,7 +5197,8 @@
"start": 45,
"type": "RESPONSE_HANDLING"
}
- ]
+ ],
+ "title": "appengine_v1_generated_versions_update_version_sync.py"
}
]
}
diff --git a/setup.py b/setup.py
index 4dcb351..c82e031 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
import setuptools # type: ignore
name = "google-cloud-appengine-admin"
-version = "1.3.2"
+version = "1.3.3"
description = "App Engine Admin API client library"
release_status = "Development Status :: 5 - Production/Stable"
url = "https://github.com/googleapis/python-appengine-admin"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_applications.py b/tests/unit/gapic/appengine_admin_v1/test_applications.py
index c2bd823..8fa343a 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_applications.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_applications.py
@@ -91,19 +91,25 @@ def test__get_default_mtls_endpoint():
assert ApplicationsClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi
-@pytest.mark.parametrize("client_class", [ApplicationsClient, ApplicationsAsyncClient,])
-def test_applications_client_from_service_account_info(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (ApplicationsClient, "grpc"),
+ (ApplicationsAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_applications_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -131,22 +137,32 @@ def test_applications_client_service_account_always_use_jwt(
use_jwt.assert_not_called()
-@pytest.mark.parametrize("client_class", [ApplicationsClient, ApplicationsAsyncClient,])
-def test_applications_client_from_service_account_file(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (ApplicationsClient, "grpc"),
+ (ApplicationsAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_applications_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_applications_client_get_transport_class():
@@ -486,7 +502,9 @@ def test_applications_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -628,10 +646,17 @@ def test_applications_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.GetApplicationRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetApplicationRequest,
+ dict,
+ ],
+)
def test_get_application(request_type, transport: str = "grpc"):
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -680,7 +705,8 @@ def test_get_application_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -696,7 +722,8 @@ async def test_get_application_async(
transport: str = "grpc_asyncio", request_type=appengine.GetApplicationRequest
):
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -749,7 +776,9 @@ async def test_get_application_async_from_dict():
def test_get_application_field_headers():
- client = ApplicationsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -769,12 +798,17 @@ def test_get_application_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_get_application_field_headers_async():
- client = ApplicationsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -796,13 +830,23 @@ async def test_get_application_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.CreateApplicationRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.CreateApplicationRequest,
+ dict,
+ ],
+)
def test_create_application(request_type, transport: str = "grpc"):
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -830,7 +874,8 @@ def test_create_application_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -848,7 +893,8 @@ async def test_create_application_async(
transport: str = "grpc_asyncio", request_type=appengine.CreateApplicationRequest
):
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -879,10 +925,17 @@ async def test_create_application_async_from_dict():
await test_create_application_async(request_type=dict)
-@pytest.mark.parametrize("request_type", [appengine.UpdateApplicationRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.UpdateApplicationRequest,
+ dict,
+ ],
+)
def test_update_application(request_type, transport: str = "grpc"):
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -910,7 +963,8 @@ def test_update_application_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -928,7 +982,8 @@ async def test_update_application_async(
transport: str = "grpc_asyncio", request_type=appengine.UpdateApplicationRequest
):
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -960,7 +1015,9 @@ async def test_update_application_async_from_dict():
def test_update_application_field_headers():
- client = ApplicationsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -982,12 +1039,17 @@ def test_update_application_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_update_application_field_headers_async():
- client = ApplicationsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1011,13 +1073,23 @@ async def test_update_application_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.RepairApplicationRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.RepairApplicationRequest,
+ dict,
+ ],
+)
def test_repair_application(request_type, transport: str = "grpc"):
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1045,7 +1117,8 @@ def test_repair_application_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1063,7 +1136,8 @@ async def test_repair_application_async(
transport: str = "grpc_asyncio", request_type=appengine.RepairApplicationRequest
):
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1095,7 +1169,9 @@ async def test_repair_application_async_from_dict():
def test_repair_application_field_headers():
- client = ApplicationsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1117,12 +1193,17 @@ def test_repair_application_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_repair_application_field_headers_async():
- client = ApplicationsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ApplicationsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1146,7 +1227,10 @@ async def test_repair_application_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1156,7 +1240,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1176,7 +1261,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = ApplicationsClient(client_options=options, transport=transport,)
+ client = ApplicationsClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1192,7 +1280,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = ApplicationsClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1235,10 +1324,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = ApplicationsClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = ApplicationsClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.ApplicationsGrpcTransport,)
+ client = ApplicationsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.ApplicationsGrpcTransport,
+ )
def test_applications_base_transport_error():
@@ -1280,6 +1387,14 @@ def test_applications_base_transport():
with pytest.raises(NotImplementedError):
transport.operations_client
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_applications_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1291,7 +1406,8 @@ def test_applications_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.ApplicationsTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1437,24 +1553,40 @@ def test_applications_grpc_transport_client_cert_source_for_mtls(transport_class
)
-def test_applications_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_applications_host_no_port(transport_name):
client = ApplicationsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_applications_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_applications_host_with_port(transport_name):
client = ApplicationsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_applications_grpc_transport_channel():
@@ -1462,7 +1594,8 @@ def test_applications_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.ApplicationsGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1474,7 +1607,8 @@ def test_applications_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.ApplicationsGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1575,12 +1709,16 @@ def test_applications_transport_channel_mtls_with_adc(transport_class):
def test_applications_grpc_lro_client():
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1588,12 +1726,16 @@ def test_applications_grpc_lro_client():
def test_applications_grpc_lro_async_client():
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsAsyncClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1621,7 +1763,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = ApplicationsClient.common_folder_path(folder)
assert expected == actual
@@ -1639,7 +1783,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = ApplicationsClient.common_organization_path(organization)
assert expected == actual
@@ -1657,7 +1803,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = ApplicationsClient.common_project_path(project)
assert expected == actual
@@ -1677,7 +1825,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = ApplicationsClient.common_location_path(project, location)
assert expected == actual
@@ -1702,7 +1851,8 @@ def test_client_with_default_client_info():
transports.ApplicationsTransport, "_prep_wrapped_messages"
) as prep:
client = ApplicationsClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1711,7 +1861,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = ApplicationsClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1719,7 +1870,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = ApplicationsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py b/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py
index 9966789..ad07779 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py
@@ -93,20 +93,26 @@ def test__get_default_mtls_endpoint():
@pytest.mark.parametrize(
- "client_class", [AuthorizedCertificatesClient, AuthorizedCertificatesAsyncClient,]
+ "client_class,transport_name",
+ [
+ (AuthorizedCertificatesClient, "grpc"),
+ (AuthorizedCertificatesAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_authorized_certificates_client_from_service_account_info(client_class):
+def test_authorized_certificates_client_from_service_account_info(
+ client_class, transport_name
+):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -135,23 +141,33 @@ def test_authorized_certificates_client_service_account_always_use_jwt(
@pytest.mark.parametrize(
- "client_class", [AuthorizedCertificatesClient, AuthorizedCertificatesAsyncClient,]
+ "client_class,transport_name",
+ [
+ (AuthorizedCertificatesClient, "grpc"),
+ (AuthorizedCertificatesAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_authorized_certificates_client_from_service_account_file(client_class):
+def test_authorized_certificates_client_from_service_account_file(
+ client_class, transport_name
+):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_authorized_certificates_client_get_transport_class():
@@ -517,7 +533,9 @@ def test_authorized_certificates_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -662,11 +680,16 @@ def test_authorized_certificates_client_create_channel_credentials_file(
@pytest.mark.parametrize(
- "request_type", [appengine.ListAuthorizedCertificatesRequest, dict,]
+ "request_type",
+ [
+ appengine.ListAuthorizedCertificatesRequest,
+ dict,
+ ],
)
def test_list_authorized_certificates(request_type, transport: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -697,7 +720,8 @@ def test_list_authorized_certificates_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -716,7 +740,8 @@ async def test_list_authorized_certificates_async(
request_type=appengine.ListAuthorizedCertificatesRequest,
):
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -775,7 +800,10 @@ def test_list_authorized_certificates_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -806,12 +834,16 @@ async def test_list_authorized_certificates_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_authorized_certificates_pager(transport_name: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -829,10 +861,13 @@ def test_list_authorized_certificates_pager(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[], next_page_token="def",
+ certificates=[],
+ next_page_token="def",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[certificate.AuthorizedCertificate(),],
+ certificates=[
+ certificate.AuthorizedCertificate(),
+ ],
next_page_token="ghi",
),
appengine.ListAuthorizedCertificatesResponse(
@@ -859,7 +894,8 @@ def test_list_authorized_certificates_pager(transport_name: str = "grpc"):
def test_list_authorized_certificates_pages(transport_name: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -877,10 +913,13 @@ def test_list_authorized_certificates_pages(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[], next_page_token="def",
+ certificates=[],
+ next_page_token="def",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[certificate.AuthorizedCertificate(),],
+ certificates=[
+ certificate.AuthorizedCertificate(),
+ ],
next_page_token="ghi",
),
appengine.ListAuthorizedCertificatesResponse(
@@ -919,10 +958,13 @@ async def test_list_authorized_certificates_async_pager():
next_page_token="abc",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[], next_page_token="def",
+ certificates=[],
+ next_page_token="def",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[certificate.AuthorizedCertificate(),],
+ certificates=[
+ certificate.AuthorizedCertificate(),
+ ],
next_page_token="ghi",
),
appengine.ListAuthorizedCertificatesResponse(
@@ -933,10 +975,12 @@ async def test_list_authorized_certificates_async_pager():
),
RuntimeError,
)
- async_pager = await client.list_authorized_certificates(request={},)
+ async_pager = await client.list_authorized_certificates(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -966,10 +1010,13 @@ async def test_list_authorized_certificates_async_pages():
next_page_token="abc",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[], next_page_token="def",
+ certificates=[],
+ next_page_token="def",
),
appengine.ListAuthorizedCertificatesResponse(
- certificates=[certificate.AuthorizedCertificate(),],
+ certificates=[
+ certificate.AuthorizedCertificate(),
+ ],
next_page_token="ghi",
),
appengine.ListAuthorizedCertificatesResponse(
@@ -983,18 +1030,23 @@ async def test_list_authorized_certificates_async_pages():
pages = []
async for page_ in (
await client.list_authorized_certificates(request={})
- ).pages:
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
@pytest.mark.parametrize(
- "request_type", [appengine.GetAuthorizedCertificateRequest, dict,]
+ "request_type",
+ [
+ appengine.GetAuthorizedCertificateRequest,
+ dict,
+ ],
)
def test_get_authorized_certificate(request_type, transport: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1035,7 +1087,8 @@ def test_get_authorized_certificate_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1054,7 +1107,8 @@ async def test_get_authorized_certificate_async(
request_type=appengine.GetAuthorizedCertificateRequest,
):
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1123,7 +1177,10 @@ def test_get_authorized_certificate_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1154,15 +1211,23 @@ async def test_get_authorized_certificate_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.parametrize(
- "request_type", [appengine.CreateAuthorizedCertificateRequest, dict,]
+ "request_type",
+ [
+ appengine.CreateAuthorizedCertificateRequest,
+ dict,
+ ],
)
def test_create_authorized_certificate(request_type, transport: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1203,7 +1268,8 @@ def test_create_authorized_certificate_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1222,7 +1288,8 @@ async def test_create_authorized_certificate_async(
request_type=appengine.CreateAuthorizedCertificateRequest,
):
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1291,7 +1358,10 @@ def test_create_authorized_certificate_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1322,15 +1392,23 @@ async def test_create_authorized_certificate_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.parametrize(
- "request_type", [appengine.UpdateAuthorizedCertificateRequest, dict,]
+ "request_type",
+ [
+ appengine.UpdateAuthorizedCertificateRequest,
+ dict,
+ ],
)
def test_update_authorized_certificate(request_type, transport: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1371,7 +1449,8 @@ def test_update_authorized_certificate_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1390,7 +1469,8 @@ async def test_update_authorized_certificate_async(
request_type=appengine.UpdateAuthorizedCertificateRequest,
):
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1459,7 +1539,10 @@ def test_update_authorized_certificate_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1490,15 +1573,23 @@ async def test_update_authorized_certificate_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.parametrize(
- "request_type", [appengine.DeleteAuthorizedCertificateRequest, dict,]
+ "request_type",
+ [
+ appengine.DeleteAuthorizedCertificateRequest,
+ dict,
+ ],
)
def test_delete_authorized_certificate(request_type, transport: str = "grpc"):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1526,7 +1617,8 @@ def test_delete_authorized_certificate_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1545,7 +1637,8 @@ async def test_delete_authorized_certificate_async(
request_type=appengine.DeleteAuthorizedCertificateRequest,
):
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1599,7 +1692,10 @@ def test_delete_authorized_certificate_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1628,7 +1724,10 @@ async def test_delete_authorized_certificate_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1638,7 +1737,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1659,7 +1759,8 @@ def test_credentials_transport_error():
options.api_key = "api_key"
with pytest.raises(ValueError):
client = AuthorizedCertificatesClient(
- client_options=options, transport=transport,
+ client_options=options,
+ transport=transport,
)
# It is an error to provide an api_key and a credential.
@@ -1676,7 +1777,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = AuthorizedCertificatesClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1719,12 +1821,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = AuthorizedCertificatesClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
client = AuthorizedCertificatesClient(
credentials=ga_credentials.AnonymousCredentials(),
)
- assert isinstance(client.transport, transports.AuthorizedCertificatesGrpcTransport,)
+ assert isinstance(
+ client.transport,
+ transports.AuthorizedCertificatesGrpcTransport,
+ )
def test_authorized_certificates_base_transport_error():
@@ -1762,6 +1880,14 @@ def test_authorized_certificates_base_transport():
with pytest.raises(NotImplementedError):
transport.close()
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_authorized_certificates_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1773,7 +1899,8 @@ def test_authorized_certificates_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.AuthorizedCertificatesTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1926,24 +2053,40 @@ def test_authorized_certificates_grpc_transport_client_cert_source_for_mtls(
)
-def test_authorized_certificates_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_authorized_certificates_host_no_port(transport_name):
client = AuthorizedCertificatesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_authorized_certificates_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_authorized_certificates_host_with_port(transport_name):
client = AuthorizedCertificatesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_authorized_certificates_grpc_transport_channel():
@@ -1951,7 +2094,8 @@ def test_authorized_certificates_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.AuthorizedCertificatesGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1963,7 +2107,8 @@ def test_authorized_certificates_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.AuthorizedCertificatesGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -2092,7 +2237,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = AuthorizedCertificatesClient.common_folder_path(folder)
assert expected == actual
@@ -2110,7 +2257,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = AuthorizedCertificatesClient.common_organization_path(organization)
assert expected == actual
@@ -2128,7 +2277,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = AuthorizedCertificatesClient.common_project_path(project)
assert expected == actual
@@ -2148,7 +2299,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = AuthorizedCertificatesClient.common_location_path(project, location)
assert expected == actual
@@ -2173,7 +2325,8 @@ def test_client_with_default_client_info():
transports.AuthorizedCertificatesTransport, "_prep_wrapped_messages"
) as prep:
client = AuthorizedCertificatesClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2182,7 +2335,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = AuthorizedCertificatesClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2190,7 +2344,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = AuthorizedCertificatesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py b/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py
index 7ca50da..728aef6 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py
@@ -91,20 +91,26 @@ def test__get_default_mtls_endpoint():
@pytest.mark.parametrize(
- "client_class", [AuthorizedDomainsClient, AuthorizedDomainsAsyncClient,]
+ "client_class,transport_name",
+ [
+ (AuthorizedDomainsClient, "grpc"),
+ (AuthorizedDomainsAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_authorized_domains_client_from_service_account_info(client_class):
+def test_authorized_domains_client_from_service_account_info(
+ client_class, transport_name
+):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -133,23 +139,33 @@ def test_authorized_domains_client_service_account_always_use_jwt(
@pytest.mark.parametrize(
- "client_class", [AuthorizedDomainsClient, AuthorizedDomainsAsyncClient,]
+ "client_class,transport_name",
+ [
+ (AuthorizedDomainsClient, "grpc"),
+ (AuthorizedDomainsAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_authorized_domains_client_from_service_account_file(client_class):
+def test_authorized_domains_client_from_service_account_file(
+ client_class, transport_name
+):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_authorized_domains_client_get_transport_class():
@@ -507,7 +523,9 @@ def test_authorized_domains_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -652,11 +670,16 @@ def test_authorized_domains_client_create_channel_credentials_file(
@pytest.mark.parametrize(
- "request_type", [appengine.ListAuthorizedDomainsRequest, dict,]
+ "request_type",
+ [
+ appengine.ListAuthorizedDomainsRequest,
+ dict,
+ ],
)
def test_list_authorized_domains(request_type, transport: str = "grpc"):
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -687,7 +710,8 @@ def test_list_authorized_domains_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -705,7 +729,8 @@ async def test_list_authorized_domains_async(
transport: str = "grpc_asyncio", request_type=appengine.ListAuthorizedDomainsRequest
):
client = AuthorizedDomainsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -740,7 +765,9 @@ async def test_list_authorized_domains_async_from_dict():
def test_list_authorized_domains_field_headers():
- client = AuthorizedDomainsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = AuthorizedDomainsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -762,7 +789,10 @@ def test_list_authorized_domains_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -793,12 +823,16 @@ async def test_list_authorized_domains_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_authorized_domains_pager(transport_name: str = "grpc"):
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -815,12 +849,21 @@ def test_list_authorized_domains_pager(transport_name: str = "grpc"):
],
next_page_token="abc",
),
- appengine.ListAuthorizedDomainsResponse(domains=[], next_page_token="def",),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(),], next_page_token="ghi",
+ domains=[],
+ next_page_token="def",
+ ),
+ appengine.ListAuthorizedDomainsResponse(
+ domains=[
+ domain.AuthorizedDomain(),
+ ],
+ next_page_token="ghi",
),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(), domain.AuthorizedDomain(),],
+ domains=[
+ domain.AuthorizedDomain(),
+ domain.AuthorizedDomain(),
+ ],
),
RuntimeError,
)
@@ -840,7 +883,8 @@ def test_list_authorized_domains_pager(transport_name: str = "grpc"):
def test_list_authorized_domains_pages(transport_name: str = "grpc"):
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -857,12 +901,21 @@ def test_list_authorized_domains_pages(transport_name: str = "grpc"):
],
next_page_token="abc",
),
- appengine.ListAuthorizedDomainsResponse(domains=[], next_page_token="def",),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(),], next_page_token="ghi",
+ domains=[],
+ next_page_token="def",
),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(), domain.AuthorizedDomain(),],
+ domains=[
+ domain.AuthorizedDomain(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListAuthorizedDomainsResponse(
+ domains=[
+ domain.AuthorizedDomain(),
+ domain.AuthorizedDomain(),
+ ],
),
RuntimeError,
)
@@ -893,19 +946,30 @@ async def test_list_authorized_domains_async_pager():
],
next_page_token="abc",
),
- appengine.ListAuthorizedDomainsResponse(domains=[], next_page_token="def",),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(),], next_page_token="ghi",
+ domains=[],
+ next_page_token="def",
+ ),
+ appengine.ListAuthorizedDomainsResponse(
+ domains=[
+ domain.AuthorizedDomain(),
+ ],
+ next_page_token="ghi",
),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(), domain.AuthorizedDomain(),],
+ domains=[
+ domain.AuthorizedDomain(),
+ domain.AuthorizedDomain(),
+ ],
),
RuntimeError,
)
- async_pager = await client.list_authorized_domains(request={},)
+ async_pager = await client.list_authorized_domains(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -934,17 +998,28 @@ async def test_list_authorized_domains_async_pages():
],
next_page_token="abc",
),
- appengine.ListAuthorizedDomainsResponse(domains=[], next_page_token="def",),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(),], next_page_token="ghi",
+ domains=[],
+ next_page_token="def",
),
appengine.ListAuthorizedDomainsResponse(
- domains=[domain.AuthorizedDomain(), domain.AuthorizedDomain(),],
+ domains=[
+ domain.AuthorizedDomain(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListAuthorizedDomainsResponse(
+ domains=[
+ domain.AuthorizedDomain(),
+ domain.AuthorizedDomain(),
+ ],
),
RuntimeError,
)
pages = []
- async for page_ in (await client.list_authorized_domains(request={})).pages:
+ async for page_ in (
+ await client.list_authorized_domains(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
@@ -957,7 +1032,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -977,7 +1053,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = AuthorizedDomainsClient(client_options=options, transport=transport,)
+ client = AuthorizedDomainsClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -993,7 +1072,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = AuthorizedDomainsClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1036,10 +1116,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = AuthorizedDomainsClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = AuthorizedDomainsClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.AuthorizedDomainsGrpcTransport,)
+ client = AuthorizedDomainsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.AuthorizedDomainsGrpcTransport,
+ )
def test_authorized_domains_base_transport_error():
@@ -1071,6 +1169,14 @@ def test_authorized_domains_base_transport():
with pytest.raises(NotImplementedError):
transport.close()
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_authorized_domains_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1082,7 +1188,8 @@ def test_authorized_domains_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.AuthorizedDomainsTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1231,24 +1338,40 @@ def test_authorized_domains_grpc_transport_client_cert_source_for_mtls(transport
)
-def test_authorized_domains_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_authorized_domains_host_no_port(transport_name):
client = AuthorizedDomainsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_authorized_domains_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_authorized_domains_host_with_port(transport_name):
client = AuthorizedDomainsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_authorized_domains_grpc_transport_channel():
@@ -1256,7 +1379,8 @@ def test_authorized_domains_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.AuthorizedDomainsGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1268,7 +1392,8 @@ def test_authorized_domains_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.AuthorizedDomainsGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1397,7 +1522,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = AuthorizedDomainsClient.common_folder_path(folder)
assert expected == actual
@@ -1415,7 +1542,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = AuthorizedDomainsClient.common_organization_path(organization)
assert expected == actual
@@ -1433,7 +1562,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = AuthorizedDomainsClient.common_project_path(project)
assert expected == actual
@@ -1453,7 +1584,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = AuthorizedDomainsClient.common_location_path(project, location)
assert expected == actual
@@ -1478,7 +1610,8 @@ def test_client_with_default_client_info():
transports.AuthorizedDomainsTransport, "_prep_wrapped_messages"
) as prep:
client = AuthorizedDomainsClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1487,7 +1620,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = AuthorizedDomainsClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1495,7 +1629,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = AuthorizedDomainsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py b/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py
index d46c61a..3ca570d 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py
@@ -97,20 +97,24 @@ def test__get_default_mtls_endpoint():
@pytest.mark.parametrize(
- "client_class", [DomainMappingsClient, DomainMappingsAsyncClient,]
+ "client_class,transport_name",
+ [
+ (DomainMappingsClient, "grpc"),
+ (DomainMappingsAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_domain_mappings_client_from_service_account_info(client_class):
+def test_domain_mappings_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -139,23 +143,31 @@ def test_domain_mappings_client_service_account_always_use_jwt(
@pytest.mark.parametrize(
- "client_class", [DomainMappingsClient, DomainMappingsAsyncClient,]
+ "client_class,transport_name",
+ [
+ (DomainMappingsClient, "grpc"),
+ (DomainMappingsAsyncClient, "grpc_asyncio"),
+ ],
)
-def test_domain_mappings_client_from_service_account_file(client_class):
+def test_domain_mappings_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_domain_mappings_client_get_transport_class():
@@ -503,7 +515,9 @@ def test_domain_mappings_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -647,10 +661,17 @@ def test_domain_mappings_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.ListDomainMappingsRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.ListDomainMappingsRequest,
+ dict,
+ ],
+)
def test_list_domain_mappings(request_type, transport: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -681,7 +702,8 @@ def test_list_domain_mappings_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -699,7 +721,8 @@ async def test_list_domain_mappings_async(
transport: str = "grpc_asyncio", request_type=appengine.ListDomainMappingsRequest
):
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -734,7 +757,9 @@ async def test_list_domain_mappings_async_from_dict():
def test_list_domain_mappings_field_headers():
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -756,7 +781,10 @@ def test_list_domain_mappings_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -787,12 +815,16 @@ async def test_list_domain_mappings_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_domain_mappings_pager(transport_name: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -810,10 +842,13 @@ def test_list_domain_mappings_pager(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[], next_page_token="def",
+ domain_mappings=[],
+ next_page_token="def",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[domain_mapping.DomainMapping(),],
+ domain_mappings=[
+ domain_mapping.DomainMapping(),
+ ],
next_page_token="ghi",
),
appengine.ListDomainMappingsResponse(
@@ -840,7 +875,8 @@ def test_list_domain_mappings_pager(transport_name: str = "grpc"):
def test_list_domain_mappings_pages(transport_name: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -858,10 +894,13 @@ def test_list_domain_mappings_pages(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[], next_page_token="def",
+ domain_mappings=[],
+ next_page_token="def",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[domain_mapping.DomainMapping(),],
+ domain_mappings=[
+ domain_mapping.DomainMapping(),
+ ],
next_page_token="ghi",
),
appengine.ListDomainMappingsResponse(
@@ -879,7 +918,9 @@ def test_list_domain_mappings_pages(transport_name: str = "grpc"):
@pytest.mark.asyncio
async def test_list_domain_mappings_async_pager():
- client = DomainMappingsAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = DomainMappingsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -898,10 +939,13 @@ async def test_list_domain_mappings_async_pager():
next_page_token="abc",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[], next_page_token="def",
+ domain_mappings=[],
+ next_page_token="def",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[domain_mapping.DomainMapping(),],
+ domain_mappings=[
+ domain_mapping.DomainMapping(),
+ ],
next_page_token="ghi",
),
appengine.ListDomainMappingsResponse(
@@ -912,10 +956,12 @@ async def test_list_domain_mappings_async_pager():
),
RuntimeError,
)
- async_pager = await client.list_domain_mappings(request={},)
+ async_pager = await client.list_domain_mappings(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -924,7 +970,9 @@ async def test_list_domain_mappings_async_pager():
@pytest.mark.asyncio
async def test_list_domain_mappings_async_pages():
- client = DomainMappingsAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = DomainMappingsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -943,10 +991,13 @@ async def test_list_domain_mappings_async_pages():
next_page_token="abc",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[], next_page_token="def",
+ domain_mappings=[],
+ next_page_token="def",
),
appengine.ListDomainMappingsResponse(
- domain_mappings=[domain_mapping.DomainMapping(),],
+ domain_mappings=[
+ domain_mapping.DomainMapping(),
+ ],
next_page_token="ghi",
),
appengine.ListDomainMappingsResponse(
@@ -958,16 +1009,25 @@ async def test_list_domain_mappings_async_pages():
RuntimeError,
)
pages = []
- async for page_ in (await client.list_domain_mappings(request={})).pages:
+ async for page_ in (
+ await client.list_domain_mappings(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
-@pytest.mark.parametrize("request_type", [appengine.GetDomainMappingRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetDomainMappingRequest,
+ dict,
+ ],
+)
def test_get_domain_mapping(request_type, transport: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -980,7 +1040,8 @@ def test_get_domain_mapping(request_type, transport: str = "grpc"):
) as call:
# Designate an appropriate return value for the call.
call.return_value = domain_mapping.DomainMapping(
- name="name_value", id="id_value",
+ name="name_value",
+ id="id_value",
)
response = client.get_domain_mapping(request)
@@ -999,7 +1060,8 @@ def test_get_domain_mapping_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1017,7 +1079,8 @@ async def test_get_domain_mapping_async(
transport: str = "grpc_asyncio", request_type=appengine.GetDomainMappingRequest
):
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1030,7 +1093,10 @@ async def test_get_domain_mapping_async(
) as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- domain_mapping.DomainMapping(name="name_value", id="id_value",)
+ domain_mapping.DomainMapping(
+ name="name_value",
+ id="id_value",
+ )
)
response = await client.get_domain_mapping(request)
@@ -1051,7 +1117,9 @@ async def test_get_domain_mapping_async_from_dict():
def test_get_domain_mapping_field_headers():
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1073,7 +1141,10 @@ def test_get_domain_mapping_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1104,13 +1175,23 @@ async def test_get_domain_mapping_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.CreateDomainMappingRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.CreateDomainMappingRequest,
+ dict,
+ ],
+)
def test_create_domain_mapping(request_type, transport: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1138,7 +1219,8 @@ def test_create_domain_mapping_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1156,7 +1238,8 @@ async def test_create_domain_mapping_async(
transport: str = "grpc_asyncio", request_type=appengine.CreateDomainMappingRequest
):
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1188,7 +1271,9 @@ async def test_create_domain_mapping_async_from_dict():
def test_create_domain_mapping_field_headers():
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1210,7 +1295,10 @@ def test_create_domain_mapping_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1241,13 +1329,23 @@ async def test_create_domain_mapping_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.UpdateDomainMappingRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.UpdateDomainMappingRequest,
+ dict,
+ ],
+)
def test_update_domain_mapping(request_type, transport: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1275,7 +1373,8 @@ def test_update_domain_mapping_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1293,7 +1392,8 @@ async def test_update_domain_mapping_async(
transport: str = "grpc_asyncio", request_type=appengine.UpdateDomainMappingRequest
):
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1325,7 +1425,9 @@ async def test_update_domain_mapping_async_from_dict():
def test_update_domain_mapping_field_headers():
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1347,7 +1449,10 @@ def test_update_domain_mapping_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1378,13 +1483,23 @@ async def test_update_domain_mapping_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DeleteDomainMappingRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DeleteDomainMappingRequest,
+ dict,
+ ],
+)
def test_delete_domain_mapping(request_type, transport: str = "grpc"):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1412,7 +1527,8 @@ def test_delete_domain_mapping_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1430,7 +1546,8 @@ async def test_delete_domain_mapping_async(
transport: str = "grpc_asyncio", request_type=appengine.DeleteDomainMappingRequest
):
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1462,7 +1579,9 @@ async def test_delete_domain_mapping_async_from_dict():
def test_delete_domain_mapping_field_headers():
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1484,7 +1603,10 @@ def test_delete_domain_mapping_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
@@ -1515,7 +1637,10 @@ async def test_delete_domain_mapping_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1525,7 +1650,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1545,7 +1671,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = DomainMappingsClient(client_options=options, transport=transport,)
+ client = DomainMappingsClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1561,7 +1690,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = DomainMappingsClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1604,10 +1734,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = DomainMappingsClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = DomainMappingsClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.DomainMappingsGrpcTransport,)
+ client = DomainMappingsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.DomainMappingsGrpcTransport,
+ )
def test_domain_mappings_base_transport_error():
@@ -1650,6 +1798,14 @@ def test_domain_mappings_base_transport():
with pytest.raises(NotImplementedError):
transport.operations_client
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_domain_mappings_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1661,7 +1817,8 @@ def test_domain_mappings_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.DomainMappingsTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1810,24 +1967,40 @@ def test_domain_mappings_grpc_transport_client_cert_source_for_mtls(transport_cl
)
-def test_domain_mappings_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_domain_mappings_host_no_port(transport_name):
client = DomainMappingsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_domain_mappings_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_domain_mappings_host_with_port(transport_name):
client = DomainMappingsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_domain_mappings_grpc_transport_channel():
@@ -1835,7 +2008,8 @@ def test_domain_mappings_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.DomainMappingsGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1847,7 +2021,8 @@ def test_domain_mappings_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.DomainMappingsGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1956,12 +2131,16 @@ def test_domain_mappings_transport_channel_mtls_with_adc(transport_class):
def test_domain_mappings_grpc_lro_client():
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1969,12 +2148,16 @@ def test_domain_mappings_grpc_lro_client():
def test_domain_mappings_grpc_lro_async_client():
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsAsyncClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -2002,7 +2185,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = DomainMappingsClient.common_folder_path(folder)
assert expected == actual
@@ -2020,7 +2205,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = DomainMappingsClient.common_organization_path(organization)
assert expected == actual
@@ -2038,7 +2225,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = DomainMappingsClient.common_project_path(project)
assert expected == actual
@@ -2058,7 +2247,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = DomainMappingsClient.common_location_path(project, location)
assert expected == actual
@@ -2083,7 +2273,8 @@ def test_client_with_default_client_info():
transports.DomainMappingsTransport, "_prep_wrapped_messages"
) as prep:
client = DomainMappingsClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2092,7 +2283,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = DomainMappingsClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2100,7 +2292,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = DomainMappingsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_firewall.py b/tests/unit/gapic/appengine_admin_v1/test_firewall.py
index 49e3343..19a09af 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_firewall.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_firewall.py
@@ -81,19 +81,25 @@ def test__get_default_mtls_endpoint():
assert FirewallClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi
-@pytest.mark.parametrize("client_class", [FirewallClient, FirewallAsyncClient,])
-def test_firewall_client_from_service_account_info(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (FirewallClient, "grpc"),
+ (FirewallAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_firewall_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -121,22 +127,32 @@ def test_firewall_client_service_account_always_use_jwt(
use_jwt.assert_not_called()
-@pytest.mark.parametrize("client_class", [FirewallClient, FirewallAsyncClient,])
-def test_firewall_client_from_service_account_file(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (FirewallClient, "grpc"),
+ (FirewallAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_firewall_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_firewall_client_get_transport_class():
@@ -466,7 +482,9 @@ def test_firewall_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -598,10 +616,17 @@ def test_firewall_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.ListIngressRulesRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.ListIngressRulesRequest,
+ dict,
+ ],
+)
def test_list_ingress_rules(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -632,7 +657,8 @@ def test_list_ingress_rules_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -650,7 +676,8 @@ async def test_list_ingress_rules_async(
transport: str = "grpc_asyncio", request_type=appengine.ListIngressRulesRequest
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -663,7 +690,9 @@ async def test_list_ingress_rules_async(
) as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- appengine.ListIngressRulesResponse(next_page_token="next_page_token_value",)
+ appengine.ListIngressRulesResponse(
+ next_page_token="next_page_token_value",
+ )
)
response = await client.list_ingress_rules(request)
@@ -683,7 +712,9 @@ async def test_list_ingress_rules_async_from_dict():
def test_list_ingress_rules_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -705,12 +736,17 @@ def test_list_ingress_rules_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_list_ingress_rules_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -734,12 +770,16 @@ async def test_list_ingress_rules_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_ingress_rules_pager(transport_name: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -757,13 +797,20 @@ def test_list_ingress_rules_pager(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[], next_page_token="def",
+ ingress_rules=[],
+ next_page_token="def",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(),], next_page_token="ghi",
+ ingress_rules=[
+ firewall.FirewallRule(),
+ ],
+ next_page_token="ghi",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(), firewall.FirewallRule(),],
+ ingress_rules=[
+ firewall.FirewallRule(),
+ firewall.FirewallRule(),
+ ],
),
RuntimeError,
)
@@ -783,7 +830,8 @@ def test_list_ingress_rules_pager(transport_name: str = "grpc"):
def test_list_ingress_rules_pages(transport_name: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -801,13 +849,20 @@ def test_list_ingress_rules_pages(transport_name: str = "grpc"):
next_page_token="abc",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[], next_page_token="def",
+ ingress_rules=[],
+ next_page_token="def",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(),], next_page_token="ghi",
+ ingress_rules=[
+ firewall.FirewallRule(),
+ ],
+ next_page_token="ghi",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(), firewall.FirewallRule(),],
+ ingress_rules=[
+ firewall.FirewallRule(),
+ firewall.FirewallRule(),
+ ],
),
RuntimeError,
)
@@ -818,7 +873,9 @@ def test_list_ingress_rules_pages(transport_name: str = "grpc"):
@pytest.mark.asyncio
async def test_list_ingress_rules_async_pager():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -837,20 +894,29 @@ async def test_list_ingress_rules_async_pager():
next_page_token="abc",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[], next_page_token="def",
+ ingress_rules=[],
+ next_page_token="def",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(),], next_page_token="ghi",
+ ingress_rules=[
+ firewall.FirewallRule(),
+ ],
+ next_page_token="ghi",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(), firewall.FirewallRule(),],
+ ingress_rules=[
+ firewall.FirewallRule(),
+ firewall.FirewallRule(),
+ ],
),
RuntimeError,
)
- async_pager = await client.list_ingress_rules(request={},)
+ async_pager = await client.list_ingress_rules(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -859,7 +925,9 @@ async def test_list_ingress_rules_async_pager():
@pytest.mark.asyncio
async def test_list_ingress_rules_async_pages():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -878,29 +946,43 @@ async def test_list_ingress_rules_async_pages():
next_page_token="abc",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[], next_page_token="def",
+ ingress_rules=[],
+ next_page_token="def",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(),], next_page_token="ghi",
+ ingress_rules=[
+ firewall.FirewallRule(),
+ ],
+ next_page_token="ghi",
),
appengine.ListIngressRulesResponse(
- ingress_rules=[firewall.FirewallRule(), firewall.FirewallRule(),],
+ ingress_rules=[
+ firewall.FirewallRule(),
+ firewall.FirewallRule(),
+ ],
),
RuntimeError,
)
pages = []
- async for page_ in (await client.list_ingress_rules(request={})).pages:
+ async for page_ in (
+ await client.list_ingress_rules(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
@pytest.mark.parametrize(
- "request_type", [appengine.BatchUpdateIngressRulesRequest, dict,]
+ "request_type",
+ [
+ appengine.BatchUpdateIngressRulesRequest,
+ dict,
+ ],
)
def test_batch_update_ingress_rules(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -928,7 +1010,8 @@ def test_batch_update_ingress_rules_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -947,7 +1030,8 @@ async def test_batch_update_ingress_rules_async(
request_type=appengine.BatchUpdateIngressRulesRequest,
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -979,7 +1063,9 @@ async def test_batch_update_ingress_rules_async_from_dict():
def test_batch_update_ingress_rules_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1001,12 +1087,17 @@ def test_batch_update_ingress_rules_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_batch_update_ingress_rules_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1030,13 +1121,23 @@ async def test_batch_update_ingress_rules_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.CreateIngressRuleRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.CreateIngressRuleRequest,
+ dict,
+ ],
+)
def test_create_ingress_rule(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1073,7 +1174,8 @@ def test_create_ingress_rule_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1091,7 +1193,8 @@ async def test_create_ingress_rule_async(
transport: str = "grpc_asyncio", request_type=appengine.CreateIngressRuleRequest
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1132,7 +1235,9 @@ async def test_create_ingress_rule_async_from_dict():
def test_create_ingress_rule_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1154,12 +1259,17 @@ def test_create_ingress_rule_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_create_ingress_rule_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1183,13 +1293,23 @@ async def test_create_ingress_rule_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.GetIngressRuleRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetIngressRuleRequest,
+ dict,
+ ],
+)
def test_get_ingress_rule(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1224,7 +1344,8 @@ def test_get_ingress_rule_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1240,7 +1361,8 @@ async def test_get_ingress_rule_async(
transport: str = "grpc_asyncio", request_type=appengine.GetIngressRuleRequest
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1279,7 +1401,9 @@ async def test_get_ingress_rule_async_from_dict():
def test_get_ingress_rule_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1299,12 +1423,17 @@ def test_get_ingress_rule_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_get_ingress_rule_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1326,13 +1455,23 @@ async def test_get_ingress_rule_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.UpdateIngressRuleRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.UpdateIngressRuleRequest,
+ dict,
+ ],
+)
def test_update_ingress_rule(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1369,7 +1508,8 @@ def test_update_ingress_rule_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1387,7 +1527,8 @@ async def test_update_ingress_rule_async(
transport: str = "grpc_asyncio", request_type=appengine.UpdateIngressRuleRequest
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1428,7 +1569,9 @@ async def test_update_ingress_rule_async_from_dict():
def test_update_ingress_rule_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1450,12 +1593,17 @@ def test_update_ingress_rule_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_update_ingress_rule_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1479,13 +1627,23 @@ async def test_update_ingress_rule_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DeleteIngressRuleRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DeleteIngressRuleRequest,
+ dict,
+ ],
+)
def test_delete_ingress_rule(request_type, transport: str = "grpc"):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1513,7 +1671,8 @@ def test_delete_ingress_rule_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1531,7 +1690,8 @@ async def test_delete_ingress_rule_async(
transport: str = "grpc_asyncio", request_type=appengine.DeleteIngressRuleRequest
):
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1561,7 +1721,9 @@ async def test_delete_ingress_rule_async_from_dict():
def test_delete_ingress_rule_field_headers():
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1583,12 +1745,17 @@ def test_delete_ingress_rule_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_delete_ingress_rule_field_headers_async():
- client = FirewallAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = FirewallAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1610,7 +1777,10 @@ async def test_delete_ingress_rule_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1620,7 +1790,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1640,7 +1811,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = FirewallClient(client_options=options, transport=transport,)
+ client = FirewallClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1656,7 +1830,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = FirewallClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1686,7 +1861,10 @@ def test_transport_get_channel():
@pytest.mark.parametrize(
"transport_class",
- [transports.FirewallGrpcTransport, transports.FirewallGrpcAsyncIOTransport,],
+ [
+ transports.FirewallGrpcTransport,
+ transports.FirewallGrpcAsyncIOTransport,
+ ],
)
def test_transport_adc(transport_class):
# Test default credentials are used if not provided.
@@ -1696,10 +1874,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = FirewallClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = FirewallClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.FirewallGrpcTransport,)
+ client = FirewallClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.FirewallGrpcTransport,
+ )
def test_firewall_base_transport_error():
@@ -1738,6 +1934,14 @@ def test_firewall_base_transport():
with pytest.raises(NotImplementedError):
transport.close()
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_firewall_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1749,7 +1953,8 @@ def test_firewall_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.FirewallTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1792,7 +1997,10 @@ def test_firewall_auth_adc():
@pytest.mark.parametrize(
"transport_class",
- [transports.FirewallGrpcTransport, transports.FirewallGrpcAsyncIOTransport,],
+ [
+ transports.FirewallGrpcTransport,
+ transports.FirewallGrpcAsyncIOTransport,
+ ],
)
def test_firewall_transport_auth_adc(transport_class):
# If credentials and host are not provided, the transport class should use
@@ -1892,24 +2100,40 @@ def test_firewall_grpc_transport_client_cert_source_for_mtls(transport_class):
)
-def test_firewall_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_firewall_host_no_port(transport_name):
client = FirewallClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_firewall_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_firewall_host_with_port(transport_name):
client = FirewallClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_firewall_grpc_transport_channel():
@@ -1917,7 +2141,8 @@ def test_firewall_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.FirewallGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1929,7 +2154,8 @@ def test_firewall_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.FirewallGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -2050,7 +2276,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = FirewallClient.common_folder_path(folder)
assert expected == actual
@@ -2068,7 +2296,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = FirewallClient.common_organization_path(organization)
assert expected == actual
@@ -2086,7 +2316,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = FirewallClient.common_project_path(project)
assert expected == actual
@@ -2106,7 +2338,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = FirewallClient.common_location_path(project, location)
assert expected == actual
@@ -2131,7 +2364,8 @@ def test_client_with_default_client_info():
transports.FirewallTransport, "_prep_wrapped_messages"
) as prep:
client = FirewallClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2140,7 +2374,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = FirewallClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2148,7 +2383,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = FirewallAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_instances.py b/tests/unit/gapic/appengine_admin_v1/test_instances.py
index 4935b8d..0a2ab1d 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_instances.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_instances.py
@@ -87,19 +87,25 @@ def test__get_default_mtls_endpoint():
assert InstancesClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi
-@pytest.mark.parametrize("client_class", [InstancesClient, InstancesAsyncClient,])
-def test_instances_client_from_service_account_info(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (InstancesClient, "grpc"),
+ (InstancesAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_instances_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -127,22 +133,32 @@ def test_instances_client_service_account_always_use_jwt(
use_jwt.assert_not_called()
-@pytest.mark.parametrize("client_class", [InstancesClient, InstancesAsyncClient,])
-def test_instances_client_from_service_account_file(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (InstancesClient, "grpc"),
+ (InstancesAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_instances_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_instances_client_get_transport_class():
@@ -480,7 +496,9 @@ def test_instances_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -612,10 +630,17 @@ def test_instances_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.ListInstancesRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.ListInstancesRequest,
+ dict,
+ ],
+)
def test_list_instances(request_type, transport: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -644,7 +669,8 @@ def test_list_instances_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -660,7 +686,8 @@ async def test_list_instances_async(
transport: str = "grpc_asyncio", request_type=appengine.ListInstancesRequest
):
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -671,7 +698,9 @@ async def test_list_instances_async(
with mock.patch.object(type(client.transport.list_instances), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- appengine.ListInstancesResponse(next_page_token="next_page_token_value",)
+ appengine.ListInstancesResponse(
+ next_page_token="next_page_token_value",
+ )
)
response = await client.list_instances(request)
@@ -691,7 +720,9 @@ async def test_list_instances_async_from_dict():
def test_list_instances_field_headers():
- client = InstancesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -711,12 +742,17 @@ def test_list_instances_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_list_instances_field_headers_async():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -738,12 +774,16 @@ async def test_list_instances_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_instances_pager(transport_name: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -758,12 +798,21 @@ def test_list_instances_pager(transport_name: str = "grpc"):
],
next_page_token="abc",
),
- appengine.ListInstancesResponse(instances=[], next_page_token="def",),
appengine.ListInstancesResponse(
- instances=[instance.Instance(),], next_page_token="ghi",
+ instances=[],
+ next_page_token="def",
),
appengine.ListInstancesResponse(
- instances=[instance.Instance(), instance.Instance(),],
+ instances=[
+ instance.Instance(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListInstancesResponse(
+ instances=[
+ instance.Instance(),
+ instance.Instance(),
+ ],
),
RuntimeError,
)
@@ -783,7 +832,8 @@ def test_list_instances_pager(transport_name: str = "grpc"):
def test_list_instances_pages(transport_name: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -798,12 +848,21 @@ def test_list_instances_pages(transport_name: str = "grpc"):
],
next_page_token="abc",
),
- appengine.ListInstancesResponse(instances=[], next_page_token="def",),
appengine.ListInstancesResponse(
- instances=[instance.Instance(),], next_page_token="ghi",
+ instances=[],
+ next_page_token="def",
),
appengine.ListInstancesResponse(
- instances=[instance.Instance(), instance.Instance(),],
+ instances=[
+ instance.Instance(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListInstancesResponse(
+ instances=[
+ instance.Instance(),
+ instance.Instance(),
+ ],
),
RuntimeError,
)
@@ -814,7 +873,9 @@ def test_list_instances_pages(transport_name: str = "grpc"):
@pytest.mark.asyncio
async def test_list_instances_async_pager():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -830,19 +891,30 @@ async def test_list_instances_async_pager():
],
next_page_token="abc",
),
- appengine.ListInstancesResponse(instances=[], next_page_token="def",),
appengine.ListInstancesResponse(
- instances=[instance.Instance(),], next_page_token="ghi",
+ instances=[],
+ next_page_token="def",
),
appengine.ListInstancesResponse(
- instances=[instance.Instance(), instance.Instance(),],
+ instances=[
+ instance.Instance(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListInstancesResponse(
+ instances=[
+ instance.Instance(),
+ instance.Instance(),
+ ],
),
RuntimeError,
)
- async_pager = await client.list_instances(request={},)
+ async_pager = await client.list_instances(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -851,7 +923,9 @@ async def test_list_instances_async_pager():
@pytest.mark.asyncio
async def test_list_instances_async_pages():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -867,26 +941,44 @@ async def test_list_instances_async_pages():
],
next_page_token="abc",
),
- appengine.ListInstancesResponse(instances=[], next_page_token="def",),
appengine.ListInstancesResponse(
- instances=[instance.Instance(),], next_page_token="ghi",
+ instances=[],
+ next_page_token="def",
),
appengine.ListInstancesResponse(
- instances=[instance.Instance(), instance.Instance(),],
+ instances=[
+ instance.Instance(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListInstancesResponse(
+ instances=[
+ instance.Instance(),
+ instance.Instance(),
+ ],
),
RuntimeError,
)
pages = []
- async for page_ in (await client.list_instances(request={})).pages:
+ async for page_ in (
+ await client.list_instances(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
-@pytest.mark.parametrize("request_type", [appengine.GetInstanceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetInstanceRequest,
+ dict,
+ ],
+)
def test_get_instance(request_type, transport: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -945,7 +1037,8 @@ def test_get_instance_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -961,7 +1054,8 @@ async def test_get_instance_async(
transport: str = "grpc_asyncio", request_type=appengine.GetInstanceRequest
):
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1024,7 +1118,9 @@ async def test_get_instance_async_from_dict():
def test_get_instance_field_headers():
- client = InstancesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1044,12 +1140,17 @@ def test_get_instance_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_get_instance_field_headers_async():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1069,13 +1170,23 @@ async def test_get_instance_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DeleteInstanceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DeleteInstanceRequest,
+ dict,
+ ],
+)
def test_delete_instance(request_type, transport: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1101,7 +1212,8 @@ def test_delete_instance_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1117,7 +1229,8 @@ async def test_delete_instance_async(
transport: str = "grpc_asyncio", request_type=appengine.DeleteInstanceRequest
):
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1147,7 +1260,9 @@ async def test_delete_instance_async_from_dict():
def test_delete_instance_field_headers():
- client = InstancesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1167,12 +1282,17 @@ def test_delete_instance_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_delete_instance_field_headers_async():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1194,13 +1314,23 @@ async def test_delete_instance_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DebugInstanceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DebugInstanceRequest,
+ dict,
+ ],
+)
def test_debug_instance(request_type, transport: str = "grpc"):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1226,7 +1356,8 @@ def test_debug_instance_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1242,7 +1373,8 @@ async def test_debug_instance_async(
transport: str = "grpc_asyncio", request_type=appengine.DebugInstanceRequest
):
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1272,7 +1404,9 @@ async def test_debug_instance_async_from_dict():
def test_debug_instance_field_headers():
- client = InstancesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1292,12 +1426,17 @@ def test_debug_instance_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_debug_instance_field_headers_async():
- client = InstancesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = InstancesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1319,7 +1458,10 @@ async def test_debug_instance_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1329,7 +1471,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1349,7 +1492,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = InstancesClient(client_options=options, transport=transport,)
+ client = InstancesClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1365,7 +1511,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = InstancesClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1395,7 +1542,10 @@ def test_transport_get_channel():
@pytest.mark.parametrize(
"transport_class",
- [transports.InstancesGrpcTransport, transports.InstancesGrpcAsyncIOTransport,],
+ [
+ transports.InstancesGrpcTransport,
+ transports.InstancesGrpcAsyncIOTransport,
+ ],
)
def test_transport_adc(transport_class):
# Test default credentials are used if not provided.
@@ -1405,10 +1555,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = InstancesClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = InstancesClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.InstancesGrpcTransport,)
+ client = InstancesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.InstancesGrpcTransport,
+ )
def test_instances_base_transport_error():
@@ -1450,6 +1618,14 @@ def test_instances_base_transport():
with pytest.raises(NotImplementedError):
transport.operations_client
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_instances_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1461,7 +1637,8 @@ def test_instances_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.InstancesTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1504,7 +1681,10 @@ def test_instances_auth_adc():
@pytest.mark.parametrize(
"transport_class",
- [transports.InstancesGrpcTransport, transports.InstancesGrpcAsyncIOTransport,],
+ [
+ transports.InstancesGrpcTransport,
+ transports.InstancesGrpcAsyncIOTransport,
+ ],
)
def test_instances_transport_auth_adc(transport_class):
# If credentials and host are not provided, the transport class should use
@@ -1604,24 +1784,40 @@ def test_instances_grpc_transport_client_cert_source_for_mtls(transport_class):
)
-def test_instances_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_instances_host_no_port(transport_name):
client = InstancesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_instances_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_instances_host_with_port(transport_name):
client = InstancesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_instances_grpc_transport_channel():
@@ -1629,7 +1825,8 @@ def test_instances_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.InstancesGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1641,7 +1838,8 @@ def test_instances_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.InstancesGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1742,12 +1940,16 @@ def test_instances_transport_channel_mtls_with_adc(transport_class):
def test_instances_grpc_lro_client():
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1755,12 +1957,16 @@ def test_instances_grpc_lro_client():
def test_instances_grpc_lro_async_client():
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsAsyncClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1771,8 +1977,13 @@ def test_instance_path():
service = "clam"
version = "whelk"
instance = "octopus"
- expected = "apps/{app}/services/{service}/versions/{version}/instances/{instance}".format(
- app=app, service=service, version=version, instance=instance,
+ expected = (
+ "apps/{app}/services/{service}/versions/{version}/instances/{instance}".format(
+ app=app,
+ service=service,
+ version=version,
+ instance=instance,
+ )
)
actual = InstancesClient.instance_path(app, service, version, instance)
assert expected == actual
@@ -1814,7 +2025,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "scallop"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = InstancesClient.common_folder_path(folder)
assert expected == actual
@@ -1832,7 +2045,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "squid"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = InstancesClient.common_organization_path(organization)
assert expected == actual
@@ -1850,7 +2065,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "whelk"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = InstancesClient.common_project_path(project)
assert expected == actual
@@ -1870,7 +2087,8 @@ def test_common_location_path():
project = "oyster"
location = "nudibranch"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = InstancesClient.common_location_path(project, location)
assert expected == actual
@@ -1895,7 +2113,8 @@ def test_client_with_default_client_info():
transports.InstancesTransport, "_prep_wrapped_messages"
) as prep:
client = InstancesClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1904,7 +2123,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = InstancesClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1912,7 +2132,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = InstancesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_services.py b/tests/unit/gapic/appengine_admin_v1/test_services.py
index d5f34de..361eee1 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_services.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_services.py
@@ -88,19 +88,25 @@ def test__get_default_mtls_endpoint():
assert ServicesClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi
-@pytest.mark.parametrize("client_class", [ServicesClient, ServicesAsyncClient,])
-def test_services_client_from_service_account_info(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (ServicesClient, "grpc"),
+ (ServicesAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_services_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -128,22 +134,32 @@ def test_services_client_service_account_always_use_jwt(
use_jwt.assert_not_called()
-@pytest.mark.parametrize("client_class", [ServicesClient, ServicesAsyncClient,])
-def test_services_client_from_service_account_file(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (ServicesClient, "grpc"),
+ (ServicesAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_services_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_services_client_get_transport_class():
@@ -473,7 +489,9 @@ def test_services_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -605,10 +623,17 @@ def test_services_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.ListServicesRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.ListServicesRequest,
+ dict,
+ ],
+)
def test_list_services(request_type, transport: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -637,7 +662,8 @@ def test_list_services_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -653,7 +679,8 @@ async def test_list_services_async(
transport: str = "grpc_asyncio", request_type=appengine.ListServicesRequest
):
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -664,7 +691,9 @@ async def test_list_services_async(
with mock.patch.object(type(client.transport.list_services), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- appengine.ListServicesResponse(next_page_token="next_page_token_value",)
+ appengine.ListServicesResponse(
+ next_page_token="next_page_token_value",
+ )
)
response = await client.list_services(request)
@@ -684,7 +713,9 @@ async def test_list_services_async_from_dict():
def test_list_services_field_headers():
- client = ServicesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -704,12 +735,17 @@ def test_list_services_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_list_services_field_headers_async():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -731,12 +767,16 @@ async def test_list_services_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_services_pager(transport_name: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -744,15 +784,28 @@ def test_list_services_pager(transport_name: str = "grpc"):
# Set the response to a series of pages.
call.side_effect = (
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ service.Service(),
+ service.Service(),
+ ],
next_page_token="abc",
),
- appengine.ListServicesResponse(services=[], next_page_token="def",),
appengine.ListServicesResponse(
- services=[service.Service(),], next_page_token="ghi",
+ services=[],
+ next_page_token="def",
),
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListServicesResponse(
+ services=[
+ service.Service(),
+ service.Service(),
+ ],
),
RuntimeError,
)
@@ -772,7 +825,8 @@ def test_list_services_pager(transport_name: str = "grpc"):
def test_list_services_pages(transport_name: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -780,15 +834,28 @@ def test_list_services_pages(transport_name: str = "grpc"):
# Set the response to a series of pages.
call.side_effect = (
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ service.Service(),
+ service.Service(),
+ ],
next_page_token="abc",
),
- appengine.ListServicesResponse(services=[], next_page_token="def",),
appengine.ListServicesResponse(
- services=[service.Service(),], next_page_token="ghi",
+ services=[],
+ next_page_token="def",
),
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListServicesResponse(
+ services=[
+ service.Service(),
+ service.Service(),
+ ],
),
RuntimeError,
)
@@ -799,7 +866,9 @@ def test_list_services_pages(transport_name: str = "grpc"):
@pytest.mark.asyncio
async def test_list_services_async_pager():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -808,22 +877,37 @@ async def test_list_services_async_pager():
# Set the response to a series of pages.
call.side_effect = (
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ service.Service(),
+ service.Service(),
+ ],
next_page_token="abc",
),
- appengine.ListServicesResponse(services=[], next_page_token="def",),
appengine.ListServicesResponse(
- services=[service.Service(),], next_page_token="ghi",
+ services=[],
+ next_page_token="def",
+ ),
+ appengine.ListServicesResponse(
+ services=[
+ service.Service(),
+ ],
+ next_page_token="ghi",
),
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ service.Service(),
+ ],
),
RuntimeError,
)
- async_pager = await client.list_services(request={},)
+ async_pager = await client.list_services(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -832,7 +916,9 @@ async def test_list_services_async_pager():
@pytest.mark.asyncio
async def test_list_services_async_pages():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -841,29 +927,51 @@ async def test_list_services_async_pages():
# Set the response to a series of pages.
call.side_effect = (
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ service.Service(),
+ service.Service(),
+ ],
next_page_token="abc",
),
- appengine.ListServicesResponse(services=[], next_page_token="def",),
appengine.ListServicesResponse(
- services=[service.Service(),], next_page_token="ghi",
+ services=[],
+ next_page_token="def",
),
appengine.ListServicesResponse(
- services=[service.Service(), service.Service(),],
+ services=[
+ service.Service(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListServicesResponse(
+ services=[
+ service.Service(),
+ service.Service(),
+ ],
),
RuntimeError,
)
pages = []
- async for page_ in (await client.list_services(request={})).pages:
+ async for page_ in (
+ await client.list_services(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
-@pytest.mark.parametrize("request_type", [appengine.GetServiceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetServiceRequest,
+ dict,
+ ],
+)
def test_get_service(request_type, transport: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -873,7 +981,10 @@ def test_get_service(request_type, transport: str = "grpc"):
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(type(client.transport.get_service), "__call__") as call:
# Designate an appropriate return value for the call.
- call.return_value = service.Service(name="name_value", id="id_value",)
+ call.return_value = service.Service(
+ name="name_value",
+ id="id_value",
+ )
response = client.get_service(request)
# Establish that the underlying gRPC stub method was called.
@@ -891,7 +1002,8 @@ def test_get_service_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -907,7 +1019,8 @@ async def test_get_service_async(
transport: str = "grpc_asyncio", request_type=appengine.GetServiceRequest
):
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -918,7 +1031,10 @@ async def test_get_service_async(
with mock.patch.object(type(client.transport.get_service), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- service.Service(name="name_value", id="id_value",)
+ service.Service(
+ name="name_value",
+ id="id_value",
+ )
)
response = await client.get_service(request)
@@ -939,7 +1055,9 @@ async def test_get_service_async_from_dict():
def test_get_service_field_headers():
- client = ServicesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -959,12 +1077,17 @@ def test_get_service_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_get_service_field_headers_async():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -984,13 +1107,23 @@ async def test_get_service_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.UpdateServiceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.UpdateServiceRequest,
+ dict,
+ ],
+)
def test_update_service(request_type, transport: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1016,7 +1149,8 @@ def test_update_service_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1032,7 +1166,8 @@ async def test_update_service_async(
transport: str = "grpc_asyncio", request_type=appengine.UpdateServiceRequest
):
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1062,7 +1197,9 @@ async def test_update_service_async_from_dict():
def test_update_service_field_headers():
- client = ServicesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1082,12 +1219,17 @@ def test_update_service_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_update_service_field_headers_async():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1109,13 +1251,23 @@ async def test_update_service_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DeleteServiceRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DeleteServiceRequest,
+ dict,
+ ],
+)
def test_delete_service(request_type, transport: str = "grpc"):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1141,7 +1293,8 @@ def test_delete_service_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1157,7 +1310,8 @@ async def test_delete_service_async(
transport: str = "grpc_asyncio", request_type=appengine.DeleteServiceRequest
):
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1187,7 +1341,9 @@ async def test_delete_service_async_from_dict():
def test_delete_service_field_headers():
- client = ServicesClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1207,12 +1363,17 @@ def test_delete_service_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_delete_service_field_headers_async():
- client = ServicesAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = ServicesAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1234,7 +1395,10 @@ async def test_delete_service_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1244,7 +1408,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1264,7 +1429,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = ServicesClient(client_options=options, transport=transport,)
+ client = ServicesClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1280,7 +1448,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = ServicesClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1310,7 +1479,10 @@ def test_transport_get_channel():
@pytest.mark.parametrize(
"transport_class",
- [transports.ServicesGrpcTransport, transports.ServicesGrpcAsyncIOTransport,],
+ [
+ transports.ServicesGrpcTransport,
+ transports.ServicesGrpcAsyncIOTransport,
+ ],
)
def test_transport_adc(transport_class):
# Test default credentials are used if not provided.
@@ -1320,10 +1492,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = ServicesClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = ServicesClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.ServicesGrpcTransport,)
+ client = ServicesClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.ServicesGrpcTransport,
+ )
def test_services_base_transport_error():
@@ -1365,6 +1555,14 @@ def test_services_base_transport():
with pytest.raises(NotImplementedError):
transport.operations_client
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_services_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1376,7 +1574,8 @@ def test_services_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.ServicesTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1419,7 +1618,10 @@ def test_services_auth_adc():
@pytest.mark.parametrize(
"transport_class",
- [transports.ServicesGrpcTransport, transports.ServicesGrpcAsyncIOTransport,],
+ [
+ transports.ServicesGrpcTransport,
+ transports.ServicesGrpcAsyncIOTransport,
+ ],
)
def test_services_transport_auth_adc(transport_class):
# If credentials and host are not provided, the transport class should use
@@ -1519,24 +1721,40 @@ def test_services_grpc_transport_client_cert_source_for_mtls(transport_class):
)
-def test_services_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_services_host_no_port(transport_name):
client = ServicesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_services_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_services_host_with_port(transport_name):
client = ServicesClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_services_grpc_transport_channel():
@@ -1544,7 +1762,8 @@ def test_services_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.ServicesGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1556,7 +1775,8 @@ def test_services_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.ServicesGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1657,12 +1877,16 @@ def test_services_transport_channel_mtls_with_adc(transport_class):
def test_services_grpc_lro_client():
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1670,12 +1894,16 @@ def test_services_grpc_lro_client():
def test_services_grpc_lro_async_client():
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsAsyncClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1703,7 +1931,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = ServicesClient.common_folder_path(folder)
assert expected == actual
@@ -1721,7 +1951,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = ServicesClient.common_organization_path(organization)
assert expected == actual
@@ -1739,7 +1971,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = ServicesClient.common_project_path(project)
assert expected == actual
@@ -1759,7 +1993,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = ServicesClient.common_location_path(project, location)
assert expected == actual
@@ -1784,7 +2019,8 @@ def test_client_with_default_client_info():
transports.ServicesTransport, "_prep_wrapped_messages"
) as prep:
client = ServicesClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1793,7 +2029,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = ServicesClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1801,7 +2038,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = ServicesAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"
diff --git a/tests/unit/gapic/appengine_admin_v1/test_versions.py b/tests/unit/gapic/appengine_admin_v1/test_versions.py
index 77d13a3..4b5a631 100644
--- a/tests/unit/gapic/appengine_admin_v1/test_versions.py
+++ b/tests/unit/gapic/appengine_admin_v1/test_versions.py
@@ -91,19 +91,25 @@ def test__get_default_mtls_endpoint():
assert VersionsClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi
-@pytest.mark.parametrize("client_class", [VersionsClient, VersionsAsyncClient,])
-def test_versions_client_from_service_account_info(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (VersionsClient, "grpc"),
+ (VersionsAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_versions_client_from_service_account_info(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_info"
) as factory:
factory.return_value = creds
info = {"valid": True}
- client = client_class.from_service_account_info(info)
+ client = client_class.from_service_account_info(info, transport=transport_name)
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
@pytest.mark.parametrize(
@@ -131,22 +137,32 @@ def test_versions_client_service_account_always_use_jwt(
use_jwt.assert_not_called()
-@pytest.mark.parametrize("client_class", [VersionsClient, VersionsAsyncClient,])
-def test_versions_client_from_service_account_file(client_class):
+@pytest.mark.parametrize(
+ "client_class,transport_name",
+ [
+ (VersionsClient, "grpc"),
+ (VersionsAsyncClient, "grpc_asyncio"),
+ ],
+)
+def test_versions_client_from_service_account_file(client_class, transport_name):
creds = ga_credentials.AnonymousCredentials()
with mock.patch.object(
service_account.Credentials, "from_service_account_file"
) as factory:
factory.return_value = creds
- client = client_class.from_service_account_file("dummy/file/path.json")
+ client = client_class.from_service_account_file(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- client = client_class.from_service_account_json("dummy/file/path.json")
+ client = client_class.from_service_account_json(
+ "dummy/file/path.json", transport=transport_name
+ )
assert client.transport._credentials == creds
assert isinstance(client, client_class)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
def test_versions_client_get_transport_class():
@@ -476,7 +492,9 @@ def test_versions_client_client_options_scopes(
client_class, transport_class, transport_name
):
# Check the case scopes are provided.
- options = client_options.ClientOptions(scopes=["1", "2"],)
+ options = client_options.ClientOptions(
+ scopes=["1", "2"],
+ )
with mock.patch.object(transport_class, "__init__") as patched:
patched.return_value = None
client = client_class(client_options=options, transport=transport_name)
@@ -608,10 +626,17 @@ def test_versions_client_create_channel_credentials_file(
)
-@pytest.mark.parametrize("request_type", [appengine.ListVersionsRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.ListVersionsRequest,
+ dict,
+ ],
+)
def test_list_versions(request_type, transport: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -640,7 +665,8 @@ def test_list_versions_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -656,7 +682,8 @@ async def test_list_versions_async(
transport: str = "grpc_asyncio", request_type=appengine.ListVersionsRequest
):
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -667,7 +694,9 @@ async def test_list_versions_async(
with mock.patch.object(type(client.transport.list_versions), "__call__") as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
- appengine.ListVersionsResponse(next_page_token="next_page_token_value",)
+ appengine.ListVersionsResponse(
+ next_page_token="next_page_token_value",
+ )
)
response = await client.list_versions(request)
@@ -687,7 +716,9 @@ async def test_list_versions_async_from_dict():
def test_list_versions_field_headers():
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -707,12 +738,17 @@ def test_list_versions_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_list_versions_field_headers_async():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -734,12 +770,16 @@ async def test_list_versions_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
def test_list_versions_pager(transport_name: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -747,15 +787,28 @@ def test_list_versions_pager(transport_name: str = "grpc"):
# Set the response to a series of pages.
call.side_effect = (
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ version.Version(),
+ ],
next_page_token="abc",
),
- appengine.ListVersionsResponse(versions=[], next_page_token="def",),
appengine.ListVersionsResponse(
- versions=[version.Version(),], next_page_token="ghi",
+ versions=[],
+ next_page_token="def",
+ ),
+ appengine.ListVersionsResponse(
+ versions=[
+ version.Version(),
+ ],
+ next_page_token="ghi",
),
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ ],
),
RuntimeError,
)
@@ -775,7 +828,8 @@ def test_list_versions_pager(transport_name: str = "grpc"):
def test_list_versions_pages(transport_name: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials, transport=transport_name,
+ credentials=ga_credentials.AnonymousCredentials,
+ transport=transport_name,
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -783,15 +837,28 @@ def test_list_versions_pages(transport_name: str = "grpc"):
# Set the response to a series of pages.
call.side_effect = (
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ version.Version(),
+ ],
next_page_token="abc",
),
- appengine.ListVersionsResponse(versions=[], next_page_token="def",),
appengine.ListVersionsResponse(
- versions=[version.Version(),], next_page_token="ghi",
+ versions=[],
+ next_page_token="def",
+ ),
+ appengine.ListVersionsResponse(
+ versions=[
+ version.Version(),
+ ],
+ next_page_token="ghi",
),
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ ],
),
RuntimeError,
)
@@ -802,7 +869,9 @@ def test_list_versions_pages(transport_name: str = "grpc"):
@pytest.mark.asyncio
async def test_list_versions_async_pager():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -811,22 +880,37 @@ async def test_list_versions_async_pager():
# Set the response to a series of pages.
call.side_effect = (
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ version.Version(),
+ ],
next_page_token="abc",
),
- appengine.ListVersionsResponse(versions=[], next_page_token="def",),
appengine.ListVersionsResponse(
- versions=[version.Version(),], next_page_token="ghi",
+ versions=[],
+ next_page_token="def",
),
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListVersionsResponse(
+ versions=[
+ version.Version(),
+ version.Version(),
+ ],
),
RuntimeError,
)
- async_pager = await client.list_versions(request={},)
+ async_pager = await client.list_versions(
+ request={},
+ )
assert async_pager.next_page_token == "abc"
responses = []
- async for response in async_pager:
+ async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
@@ -835,7 +919,9 @@ async def test_list_versions_async_pager():
@pytest.mark.asyncio
async def test_list_versions_async_pages():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials,)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials,
+ )
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
@@ -844,29 +930,51 @@ async def test_list_versions_async_pages():
# Set the response to a series of pages.
call.side_effect = (
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ version.Version(),
+ version.Version(),
+ ],
next_page_token="abc",
),
- appengine.ListVersionsResponse(versions=[], next_page_token="def",),
appengine.ListVersionsResponse(
- versions=[version.Version(),], next_page_token="ghi",
+ versions=[],
+ next_page_token="def",
),
appengine.ListVersionsResponse(
- versions=[version.Version(), version.Version(),],
+ versions=[
+ version.Version(),
+ ],
+ next_page_token="ghi",
+ ),
+ appengine.ListVersionsResponse(
+ versions=[
+ version.Version(),
+ version.Version(),
+ ],
),
RuntimeError,
)
pages = []
- async for page_ in (await client.list_versions(request={})).pages:
+ async for page_ in (
+ await client.list_versions(request={})
+ ).pages: # pragma: no branch
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
-@pytest.mark.parametrize("request_type", [appengine.GetVersionRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.GetVersionRequest,
+ dict,
+ ],
+)
def test_get_version(request_type, transport: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -934,7 +1042,8 @@ def test_get_version_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -950,7 +1059,8 @@ async def test_get_version_async(
transport: str = "grpc_asyncio", request_type=appengine.GetVersionRequest
):
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1019,7 +1129,9 @@ async def test_get_version_async_from_dict():
def test_get_version_field_headers():
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1039,12 +1151,17 @@ def test_get_version_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_get_version_field_headers_async():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1064,13 +1181,23 @@ async def test_get_version_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.CreateVersionRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.CreateVersionRequest,
+ dict,
+ ],
+)
def test_create_version(request_type, transport: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1096,7 +1223,8 @@ def test_create_version_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1112,7 +1240,8 @@ async def test_create_version_async(
transport: str = "grpc_asyncio", request_type=appengine.CreateVersionRequest
):
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1142,7 +1271,9 @@ async def test_create_version_async_from_dict():
def test_create_version_field_headers():
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1162,12 +1293,17 @@ def test_create_version_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_create_version_field_headers_async():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1189,13 +1325,23 @@ async def test_create_version_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "parent=parent/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.UpdateVersionRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.UpdateVersionRequest,
+ dict,
+ ],
+)
def test_update_version(request_type, transport: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1221,7 +1367,8 @@ def test_update_version_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1237,7 +1384,8 @@ async def test_update_version_async(
transport: str = "grpc_asyncio", request_type=appengine.UpdateVersionRequest
):
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1267,7 +1415,9 @@ async def test_update_version_async_from_dict():
def test_update_version_field_headers():
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1287,12 +1437,17 @@ def test_update_version_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_update_version_field_headers_async():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1314,13 +1469,23 @@ async def test_update_version_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
-@pytest.mark.parametrize("request_type", [appengine.DeleteVersionRequest, dict,])
+@pytest.mark.parametrize(
+ "request_type",
+ [
+ appengine.DeleteVersionRequest,
+ dict,
+ ],
+)
def test_delete_version(request_type, transport: str = "grpc"):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1346,7 +1511,8 @@ def test_delete_version_empty_call():
# This test is a coverage failsafe to make sure that totally empty calls,
# i.e. request == None and no flattened fields passed, work.
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
# Mock the actual call within the gRPC stub, and fake the request.
@@ -1362,7 +1528,8 @@ async def test_delete_version_async(
transport: str = "grpc_asyncio", request_type=appengine.DeleteVersionRequest
):
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# Everything is optional in proto3 as far as the runtime is concerned,
@@ -1392,7 +1559,9 @@ async def test_delete_version_async_from_dict():
def test_delete_version_field_headers():
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1412,12 +1581,17 @@ def test_delete_version_field_headers():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
@pytest.mark.asyncio
async def test_delete_version_field_headers_async():
- client = VersionsAsyncClient(credentials=ga_credentials.AnonymousCredentials(),)
+ client = VersionsAsyncClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
# Any value that is part of the HTTP/1.1 URI should be sent as
# a field header. Set these to a non-empty value.
@@ -1439,7 +1613,10 @@ async def test_delete_version_field_headers_async():
# Establish that the field header was sent.
_, _, kw = call.mock_calls[0]
- assert ("x-goog-request-params", "name=name/value",) in kw["metadata"]
+ assert (
+ "x-goog-request-params",
+ "name=name/value",
+ ) in kw["metadata"]
def test_credentials_transport_error():
@@ -1449,7 +1626,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport=transport,
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport=transport,
)
# It is an error to provide a credentials file and a transport instance.
@@ -1469,7 +1647,10 @@ def test_credentials_transport_error():
options = client_options.ClientOptions()
options.api_key = "api_key"
with pytest.raises(ValueError):
- client = VersionsClient(client_options=options, transport=transport,)
+ client = VersionsClient(
+ client_options=options,
+ transport=transport,
+ )
# It is an error to provide an api_key and a credential.
options = mock.Mock()
@@ -1485,7 +1666,8 @@ def test_credentials_transport_error():
)
with pytest.raises(ValueError):
client = VersionsClient(
- client_options={"scopes": ["1", "2"]}, transport=transport,
+ client_options={"scopes": ["1", "2"]},
+ transport=transport,
)
@@ -1515,7 +1697,10 @@ def test_transport_get_channel():
@pytest.mark.parametrize(
"transport_class",
- [transports.VersionsGrpcTransport, transports.VersionsGrpcAsyncIOTransport,],
+ [
+ transports.VersionsGrpcTransport,
+ transports.VersionsGrpcAsyncIOTransport,
+ ],
)
def test_transport_adc(transport_class):
# Test default credentials are used if not provided.
@@ -1525,10 +1710,28 @@ def test_transport_adc(transport_class):
adc.assert_called_once()
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ ],
+)
+def test_transport_kind(transport_name):
+ transport = VersionsClient.get_transport_class(transport_name)(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert transport.kind == transport_name
+
+
def test_transport_grpc_default():
# A client should use the gRPC transport by default.
- client = VersionsClient(credentials=ga_credentials.AnonymousCredentials(),)
- assert isinstance(client.transport, transports.VersionsGrpcTransport,)
+ client = VersionsClient(
+ credentials=ga_credentials.AnonymousCredentials(),
+ )
+ assert isinstance(
+ client.transport,
+ transports.VersionsGrpcTransport,
+ )
def test_versions_base_transport_error():
@@ -1571,6 +1774,14 @@ def test_versions_base_transport():
with pytest.raises(NotImplementedError):
transport.operations_client
+ # Catch all for all remaining methods and properties
+ remainder = [
+ "kind",
+ ]
+ for r in remainder:
+ with pytest.raises(NotImplementedError):
+ getattr(transport, r)()
+
def test_versions_base_transport_with_credentials_file():
# Instantiate the base transport with a credentials file
@@ -1582,7 +1793,8 @@ def test_versions_base_transport_with_credentials_file():
Transport.return_value = None
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
transport = transports.VersionsTransport(
- credentials_file="credentials.json", quota_project_id="octopus",
+ credentials_file="credentials.json",
+ quota_project_id="octopus",
)
load_creds.assert_called_once_with(
"credentials.json",
@@ -1625,7 +1837,10 @@ def test_versions_auth_adc():
@pytest.mark.parametrize(
"transport_class",
- [transports.VersionsGrpcTransport, transports.VersionsGrpcAsyncIOTransport,],
+ [
+ transports.VersionsGrpcTransport,
+ transports.VersionsGrpcAsyncIOTransport,
+ ],
)
def test_versions_transport_auth_adc(transport_class):
# If credentials and host are not provided, the transport class should use
@@ -1725,24 +1940,40 @@ def test_versions_grpc_transport_client_cert_source_for_mtls(transport_class):
)
-def test_versions_host_no_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_versions_host_no_port(transport_name):
client = VersionsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:443"
+ assert client.transport._host == ("appengine.googleapis.com:443")
-def test_versions_host_with_port():
+@pytest.mark.parametrize(
+ "transport_name",
+ [
+ "grpc",
+ "grpc_asyncio",
+ ],
+)
+def test_versions_host_with_port(transport_name):
client = VersionsClient(
credentials=ga_credentials.AnonymousCredentials(),
client_options=client_options.ClientOptions(
api_endpoint="appengine.googleapis.com:8000"
),
+ transport=transport_name,
)
- assert client.transport._host == "appengine.googleapis.com:8000"
+ assert client.transport._host == ("appengine.googleapis.com:8000")
def test_versions_grpc_transport_channel():
@@ -1750,7 +1981,8 @@ def test_versions_grpc_transport_channel():
# Check that channel is used if provided.
transport = transports.VersionsGrpcTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1762,7 +1994,8 @@ def test_versions_grpc_asyncio_transport_channel():
# Check that channel is used if provided.
transport = transports.VersionsGrpcAsyncIOTransport(
- host="squid.clam.whelk", channel=channel,
+ host="squid.clam.whelk",
+ channel=channel,
)
assert transport.grpc_channel == channel
assert transport._host == "squid.clam.whelk:443"
@@ -1863,12 +2096,16 @@ def test_versions_transport_channel_mtls_with_adc(transport_class):
def test_versions_grpc_lro_client():
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1876,12 +2113,16 @@ def test_versions_grpc_lro_client():
def test_versions_grpc_lro_async_client():
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
transport = client.transport
# Ensure that we have a api-core operations client.
- assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,)
+ assert isinstance(
+ transport.operations_client,
+ operations_v1.OperationsAsyncClient,
+ )
# Ensure that subsequent calls to the property send the exact same object.
assert transport.operations_client is transport.operations_client
@@ -1909,7 +2150,9 @@ def test_parse_common_billing_account_path():
def test_common_folder_path():
folder = "whelk"
- expected = "folders/{folder}".format(folder=folder,)
+ expected = "folders/{folder}".format(
+ folder=folder,
+ )
actual = VersionsClient.common_folder_path(folder)
assert expected == actual
@@ -1927,7 +2170,9 @@ def test_parse_common_folder_path():
def test_common_organization_path():
organization = "oyster"
- expected = "organizations/{organization}".format(organization=organization,)
+ expected = "organizations/{organization}".format(
+ organization=organization,
+ )
actual = VersionsClient.common_organization_path(organization)
assert expected == actual
@@ -1945,7 +2190,9 @@ def test_parse_common_organization_path():
def test_common_project_path():
project = "cuttlefish"
- expected = "projects/{project}".format(project=project,)
+ expected = "projects/{project}".format(
+ project=project,
+ )
actual = VersionsClient.common_project_path(project)
assert expected == actual
@@ -1965,7 +2212,8 @@ def test_common_location_path():
project = "winkle"
location = "nautilus"
expected = "projects/{project}/locations/{location}".format(
- project=project, location=location,
+ project=project,
+ location=location,
)
actual = VersionsClient.common_location_path(project, location)
assert expected == actual
@@ -1990,7 +2238,8 @@ def test_client_with_default_client_info():
transports.VersionsTransport, "_prep_wrapped_messages"
) as prep:
client = VersionsClient(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -1999,7 +2248,8 @@ def test_client_with_default_client_info():
) as prep:
transport_class = VersionsClient.get_transport_class()
transport = transport_class(
- credentials=ga_credentials.AnonymousCredentials(), client_info=client_info,
+ credentials=ga_credentials.AnonymousCredentials(),
+ client_info=client_info,
)
prep.assert_called_once_with(client_info)
@@ -2007,7 +2257,8 @@ def test_client_with_default_client_info():
@pytest.mark.asyncio
async def test_transport_close_async():
client = VersionsAsyncClient(
- credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio",
+ credentials=ga_credentials.AnonymousCredentials(),
+ transport="grpc_asyncio",
)
with mock.patch.object(
type(getattr(client.transport, "grpc_channel")), "close"