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

Commit

Permalink
feat: add insight support; undeprecate resource name helper methods (…
Browse files Browse the repository at this point in the history
…via synth) (#7)

This PR was generated using Autosynth. 🌈


<details><summary>Log from Synthtool</summary>

```
2020-03-13 05:13:37,617 synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py.
2020-03-13 05:13:37,670 synthtool > Ensuring dependencies.
2020-03-13 05:13:37,681 synthtool > Cloning googleapis.
2020-03-13 05:13:38,022 synthtool > Generating code for: google/cloud/recommender/v1beta1.
2020-03-13 05:17:49,678 synthtool > Generated code into /tmpfs/tmp/tmpokj3pckh.
2020-03-13 05:17:49,698 synthtool > Generating code for: google/cloud/recommender/v1.
2020-03-13 05:17:53,565 synthtool > Generated code into /tmpfs/tmp/tmpq7cifckw.
2020-03-13 05:17:53,584 synthtool > No replacements made in google/**/recommender_client.py for pattern (/\^.*\$/), maybe replacement is no longer needed?
2020-03-13 05:17:53,585 synthtool > Replaced ':math:`(/)' in google/cloud/recommender_v1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,586 synthtool > Replaced ':math:`(/)' in google/cloud/recommender_v1beta1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,587 synthtool > Replaced '`/\\.' in google/cloud/recommender_v1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,588 synthtool > Replaced '`/\\.' in google/cloud/recommender_v1beta1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,590 synthtool > Replaced '(regex\\s+)(/.*?/)\\.' in google/cloud/recommender_v1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,590 synthtool > Replaced '(regex\\s+)(/.*?/)\\.' in google/cloud/recommender_v1beta1/proto/recommender_service_pb2.py.
2020-03-13 05:17:53,592 synthtool > Replaced '( -  Example: )(\\{.*?\\})' in google/cloud/recommender_v1/proto/recommendation_pb2.py.
2020-03-13 05:17:53,592 synthtool > Replaced '( -  Example: )(\\{.*?\\})' in google/cloud/recommender_v1beta1/proto/recommendation_pb2.py.
2020-03-13 05:17:53,599 synthtool > No replacements made in **/*_pb2.py for pattern (\# -\*- coding: utf-8 -\*-\n)(\# Generated by the protocol buffer compiler\.  DO NOT EDIT!.*?import sys), maybe replacement is no longer needed?
2020-03-13 05:17:53,601 synthtool > Replaced '(\\# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!)\n(import grpc)' in google/cloud/recommender_v1/proto/recommendation_pb2_grpc.py.
2020-03-13 05:17:53,602 synthtool > Replaced '(\\# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!)\n(import grpc)' in google/cloud/recommender_v1/proto/recommender_service_pb2_grpc.py.
2020-03-13 05:17:53,602 synthtool > Replaced '(\\# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!)\n(import grpc)' in google/cloud/recommender_v1beta1/proto/recommendation_pb2_grpc.py.
2020-03-13 05:17:53,602 synthtool > Replaced '(\\# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!)\n(import grpc)' in google/cloud/recommender_v1beta1/proto/insight_pb2_grpc.py.
2020-03-13 05:17:53,603 synthtool > Replaced '(\\# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!)\n(import grpc)' in google/cloud/recommender_v1beta1/proto/recommender_service_pb2_grpc.py.
.coveragerc
.flake8
.github/CONTRIBUTING.md
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/ISSUE_TEMPLATE/support_request.md
.github/PULL_REQUEST_TEMPLATE.md
.github/release-please.yml
.gitignore
.kokoro/build.sh
.kokoro/continuous/common.cfg
.kokoro/continuous/continuous.cfg
.kokoro/docs/common.cfg
.kokoro/docs/docs.cfg
.kokoro/presubmit/common.cfg
.kokoro/presubmit/presubmit.cfg
.kokoro/publish-docs.sh
.kokoro/release.sh
.kokoro/release/common.cfg
.kokoro/release/release.cfg
.kokoro/trampoline.sh
CODE_OF_CONDUCT.md
CONTRIBUTING.rst
LICENSE
MANIFEST.in
docs/_static/custom.css
docs/_templates/layout.html
docs/conf.py.j2
noxfile.py.j2
renovate.json
setup.cfg
2020-03-13 05:17:53,686 synthtool > Replaced '\\["2\\.7", ' in noxfile.py.
Running session blacken
Creating virtual environment (virtualenv) using python3.6 in .nox/blacken
pip install black==19.3b0
black docs google tests noxfile.py setup.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/__init__.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/__init__.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/__init__.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/gapic/enums.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/gapic/recommender_client_config.py
reformatted /tmpfs/src/git/autosynth/working_repo/docs/conf.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/gapic/transports/recommender_grpc_transport.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/proto/recommendation_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/proto/recommender_service_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/types.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/__init__.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/gapic/enums.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/gapic/recommender_client.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/gapic/recommender_client_config.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/gapic/transports/recommender_grpc_transport.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/gapic/recommender_client.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/insight_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/proto/recommender_service_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/recommendation_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/insight_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/recommender_service_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/types.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1/proto/recommendation_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/noxfile.py
reformatted /tmpfs/src/git/autosynth/working_repo/tests/unit/gapic/v1/test_recommender_client_v1.py
reformatted /tmpfs/src/git/autosynth/working_repo/tests/unit/gapic/v1beta1/test_recommender_client_v1beta1.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/recommendation_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/google/cloud/recommender_v1beta1/proto/recommender_service_pb2.py
All done! ✨ 🍰 ✨
29 files reformatted, 7 files left unchanged.
Session blacken was successful.
2020-03-13 05:17:59,666 synthtool > Wrote metadata to synth.metadata.

```
</details>
  • Loading branch information
yoshi-automation committed Mar 14, 2020
1 parent bc6ef8d commit 876c383
Show file tree
Hide file tree
Showing 30 changed files with 2,035 additions and 384 deletions.
2 changes: 1 addition & 1 deletion 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 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
2 changes: 1 addition & 1 deletion google/cloud/recommender.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 google/cloud/recommender_v1/__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 google/cloud/recommender_v1/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
16 changes: 3 additions & 13 deletions google/cloud/recommender_v1/gapic/recommender_client.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 Expand Up @@ -81,12 +81,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def recommendation_path(cls, project, location, recommender, recommendation):
"""DEPRECATED. Return a fully-qualified recommendation string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified recommendation string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}",
project=project,
Expand All @@ -97,12 +92,7 @@ def recommendation_path(cls, project, location, recommender, recommendation):

@classmethod
def recommender_path(cls, project, location, recommender):
"""DEPRECATED. Return a fully-qualified recommender string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified recommender string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/recommenders/{recommender}",
project=project,
Expand Down
14 changes: 0 additions & 14 deletions google/cloud/recommender_v1/gapic/recommender_client_config.py
@@ -1,17 +1,3 @@
# 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.
# 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.

config = {
"interfaces": {
"google.cloud.recommender.v1.Recommender": {
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
65 changes: 21 additions & 44 deletions google/cloud/recommender_v1/proto/recommendation_pb2.py

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

@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2019 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

0 comments on commit 876c383

Please sign in to comment.