Skip to content

Commit

Permalink
docs(webrisk): add 2.7 deprecation warning; bump copyright year to 20…
Browse files Browse the repository at this point in the history
…20; use templated noxfile (via synth) (#10053)
  • Loading branch information
yoshi-automation committed Jan 30, 2020
1 parent 906e5fa commit b270311
Show file tree
Hide file tree
Showing 15 changed files with 210 additions and 124 deletions.
4 changes: 2 additions & 2 deletions webrisk/docs/conf.py
Expand Up @@ -264,7 +264,7 @@
u"google-cloud-webrisk Documentation",
author,
"manual",
),
)
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -320,7 +320,7 @@
"google-cloud-webrisk",
"GAPIC library for the {metadata.shortName} v1beta1 service",
"APIs",
),
)
]

# Documents to append as an appendix to all manuals.
Expand Down
2 changes: 1 addition & 1 deletion webrisk/google/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion webrisk/google/cloud/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 2 additions & 6 deletions webrisk/google/cloud/webrisk.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -22,8 +22,4 @@
from google.cloud.webrisk_v1beta1 import types


__all__ = (
"enums",
"types",
"WebRiskServiceV1Beta1Client",
)
__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client")
19 changes: 13 additions & 6 deletions webrisk/google/cloud/webrisk_v1beta1/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,21 +16,28 @@


from __future__ import absolute_import
import sys
import warnings

from google.cloud.webrisk_v1beta1 import types
from google.cloud.webrisk_v1beta1.gapic import enums
from google.cloud.webrisk_v1beta1.gapic import web_risk_service_v1_beta1_client


if sys.version_info[:2] == (2, 7):
message = (
"A future version of this library will drop support for Python 2.7."
"More details about Python 2 support for Google Cloud Client Libraries"
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
)
warnings.warn(message, DeprecationWarning)


class WebRiskServiceV1Beta1Client(
web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client
):
__doc__ = web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client.__doc__
enums = enums


__all__ = (
"enums",
"types",
"WebRiskServiceV1Beta1Client",
)
__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client")
2 changes: 1 addition & 1 deletion webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(
# exception (channels come with credentials baked in already).
if channel is not None and credentials is not None:
raise ValueError(
"The `channel` and `credentials` arguments are mutually " "exclusive.",
"The `channel` and `credentials` arguments are mutually " "exclusive."
)

# Create the channel.
Expand All @@ -74,7 +74,7 @@ def __init__(
self._stubs = {
"web_risk_service_v1_beta1_stub": webrisk_pb2_grpc.WebRiskServiceV1Beta1Stub(
channel
),
)
}

@classmethod
Expand Down
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,7 @@
from google.cloud.webrisk_v1beta1.proto import webrisk_pb2_grpc


_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-webrisk",).version
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-webrisk").version


class WebRiskServiceV1Beta1Client(object):
Expand Down Expand Up @@ -159,12 +159,12 @@ def __init__(
self.transport = transport
else:
self.transport = web_risk_service_v1_beta1_grpc_transport.WebRiskServiceV1Beta1GrpcTransport(
address=api_endpoint, channel=channel, credentials=credentials,
address=api_endpoint, channel=channel, credentials=credentials
)

if client_info is None:
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version=_GAPIC_LIBRARY_VERSION,
gapic_version=_GAPIC_LIBRARY_VERSION
)
else:
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
Expand All @@ -175,7 +175,7 @@ def __init__(
# (Ordinarily, these are the defaults specified in the `*_config.py`
# file next to this one.)
self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
client_config["interfaces"][self._INTERFACE_NAME],
client_config["interfaces"][self._INTERFACE_NAME]
)

# Save a dictionary of cached API call functions.
Expand Down Expand Up @@ -316,7 +316,7 @@ def search_uris(
client_info=self._client_info,
)

request = webrisk_pb2.SearchUrisRequest(uri=uri, threat_types=threat_types,)
request = webrisk_pb2.SearchUrisRequest(uri=uri, threat_types=threat_types)
return self._inner_api_calls["search_uris"](
request, retry=retry, timeout=timeout, metadata=metadata
)
Expand Down Expand Up @@ -382,7 +382,7 @@ def search_hashes(
)

request = webrisk_pb2.SearchHashesRequest(
threat_types=threat_types, hash_prefix=hash_prefix,
threat_types=threat_types, hash_prefix=hash_prefix
)
return self._inner_api_calls["search_hashes"](
request, retry=retry, timeout=timeout, metadata=metadata
Expand Down
38 changes: 21 additions & 17 deletions webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions webrisk/google/cloud/webrisk_v1beta1/types.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -24,13 +24,9 @@
from google.protobuf import timestamp_pb2


_shared_modules = [
timestamp_pb2,
]
_shared_modules = [timestamp_pb2]

_local_modules = [
webrisk_pb2,
]
_local_modules = [webrisk_pb2]

names = []

Expand Down

0 comments on commit b270311

Please sign in to comment.