Skip to content

Commit

Permalink
chore(python): use black==22.3.0 (#168)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/synthtool@6fab84a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Mar 28, 2022
1 parent be396b3 commit 186124d
Show file tree
Hide file tree
Showing 36 changed files with 1,122 additions and 300 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
5 changes: 4 additions & 1 deletion packages/google-cloud-monitoring-dashboards/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ def sample_create_dashboard():
)

# 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
Expand Down Expand Up @@ -361,12 +366,20 @@ def sample_list_dashboards():
)

# 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.ListDashboardsAsyncPager(
method=rpc, request=request, response=response, metadata=metadata,
method=rpc,
request=request,
response=response,
metadata=metadata,
)

# Done; return the response.
Expand Down Expand Up @@ -442,7 +455,12 @@ def sample_get_dashboard():
)

# 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
Expand Down Expand Up @@ -507,7 +525,10 @@ def sample_delete_dashboard():

# Send the request.
await rpc(
request, retry=retry, timeout=timeout, metadata=metadata,
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

async def update_dashboard(
Expand Down Expand Up @@ -585,7 +606,12 @@ def sample_update_dashboard():
)

# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class DashboardsServiceClientMeta(type):
_transport_registry["grpc_asyncio"] = DashboardsServiceGrpcAsyncIOTransport

def get_transport_class(
cls, label: str = None,
cls,
label: str = None,
) -> Type[DashboardsServiceTransport]:
"""Returns an appropriate transport class.
Expand Down Expand Up @@ -166,10 +167,14 @@ def transport(self) -> DashboardsServiceTransport:
return self._transport

@staticmethod
def alert_policy_path(project: str, alert_policy: str,) -> str:
def alert_policy_path(
project: str,
alert_policy: str,
) -> str:
"""Returns a fully-qualified alert_policy string."""
return "projects/{project}/alertPolicies/{alert_policy}".format(
project=project, alert_policy=alert_policy,
project=project,
alert_policy=alert_policy,
)

@staticmethod
Expand All @@ -181,10 +186,14 @@ def parse_alert_policy_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def dashboard_path(project: str, dashboard: str,) -> str:
def dashboard_path(
project: str,
dashboard: str,
) -> str:
"""Returns a fully-qualified dashboard string."""
return "projects/{project}/dashboards/{dashboard}".format(
project=project, dashboard=dashboard,
project=project,
dashboard=dashboard,
)

@staticmethod
Expand All @@ -194,7 +203,9 @@ def parse_dashboard_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,
Expand All @@ -207,9 +218,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]:
Expand All @@ -218,9 +233,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]:
Expand All @@ -229,9 +248,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]:
Expand All @@ -240,10 +263,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
Expand Down Expand Up @@ -493,7 +520,12 @@ def sample_create_dashboard():
)

# 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
Expand Down Expand Up @@ -570,12 +602,20 @@ def sample_list_dashboards():
)

# 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.ListDashboardsPager(
method=rpc, request=request, response=response, metadata=metadata,
method=rpc,
request=request,
response=response,
metadata=metadata,
)

# Done; return the response.
Expand Down Expand Up @@ -652,7 +692,12 @@ def sample_get_dashboard():
)

# 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
Expand Down Expand Up @@ -718,7 +763,10 @@ def sample_delete_dashboard():

# Send the request.
rpc(
request, retry=retry, timeout=timeout, metadata=metadata,
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

def update_dashboard(
Expand Down Expand Up @@ -797,7 +845,12 @@ def sample_update_dashboard():
)

# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,38 @@ def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.create_dashboard: gapic_v1.method.wrap_method(
self.create_dashboard, default_timeout=30.0, client_info=client_info,
self.create_dashboard,
default_timeout=30.0,
client_info=client_info,
),
self.list_dashboards: gapic_v1.method.wrap_method(
self.list_dashboards, default_timeout=None, client_info=client_info,
self.list_dashboards,
default_timeout=None,
client_info=client_info,
),
self.get_dashboard: gapic_v1.method.wrap_method(
self.get_dashboard, default_timeout=None, client_info=client_info,
self.get_dashboard,
default_timeout=None,
client_info=client_info,
),
self.delete_dashboard: gapic_v1.method.wrap_method(
self.delete_dashboard, default_timeout=30.0, client_info=client_info,
self.delete_dashboard,
default_timeout=30.0,
client_info=client_info,
),
self.update_dashboard: gapic_v1.method.wrap_method(
self.update_dashboard, default_timeout=30.0, client_info=client_info,
self.update_dashboard,
default_timeout=30.0,
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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@


__protobuf__ = proto.module(
package="google.monitoring.dashboard.v1", manifest={"AlertChart",},
package="google.monitoring.dashboard.v1",
manifest={
"AlertChart",
},
)


Expand All @@ -34,7 +37,10 @@ class AlertChart(proto.Message):
projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
"""

name = proto.Field(proto.STRING, number=1,)
name = proto.Field(
proto.STRING,
number=1,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading

0 comments on commit 186124d

Please sign in to comment.