From c724e7db67ea1efd73b7ab0d097475187d9f5cc8 Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 18 May 2020 16:56:52 -0700 Subject: [PATCH 1/4] docs: update links for product docs and API reference information (#5) * docs: update links for product docs and API reference information --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 95b9a7f4..da164f18 100644 --- a/README.rst +++ b/README.rst @@ -14,9 +14,9 @@ Python Client for Cloud BigQuery Reservation :target: https://pypi.org/project/google-cloud-bigquery-reservation/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-bigquery-reservation.svg :target: https://pypi.org/project/google-cloud-bigqyery-reservation/ -.. _BigQuery Reservation API: https:///cloud.google.com/bigquery/docs/reference/reservations +.. _BigQuery Reservation API: https://cloud.google.com/bigquery/docs/reference/reservations/rpc .. _Client Library Documentation: https://googleapis.dev/python/bigqueryreservation/latest -.. _Product Documentation: https:///cloud.google.com/bigquery/docs/reference/reservations +.. _Product Documentation: https://cloud.google.com/bigquery/docs/reservations-intro Quick Start ----------- @@ -30,7 +30,7 @@ In order to use this library, you first need to go through the following steps: .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud BigQuery Reservation API.: https:///cloud.google.com/bigquery/docs/reference/reservations +.. _Enable the Cloud BigQuery Reservation API.: https://cloud.google.com/bigquery/docs/reference/reservations/rpc .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html Installation @@ -78,5 +78,5 @@ Next Steps - View this `repository’s main README`_ to see the full list of Cloud APIs that we cover. -.. _BigQuery Reservation API Product documentation: https:///cloud.google.com/bigquery/docs/reference/reservations -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file +.. _BigQuery Reservation API Product documentation: https://cloud.google.com/bigquery/docs/reference/reservations/rpc +.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst From 8fc54cb70be698f6d265f60d7b8ee4561d12d2c9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 May 2020 14:16:01 -0700 Subject: [PATCH 2/4] feat: add helper methods to parse resource paths (via synth) (#7) --- .../services/reservation_service/client.py | 68 ++++++------- synth.metadata | 2 +- .../test_reservation_service.py | 98 +++++++++---------- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/google/cloud/bigquery/reservation_v1/services/reservation_service/client.py b/google/cloud/bigquery/reservation_v1/services/reservation_service/client.py index cfc1af4f..21a4397f 100644 --- a/google/cloud/bigquery/reservation_v1/services/reservation_service/client.py +++ b/google/cloud/bigquery/reservation_v1/services/reservation_service/client.py @@ -147,72 +147,72 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file @staticmethod - def assignment_path( - project: str, location: str, reservation: str, assignment: str + def capacity_commitment_path( + project: str, location: str, capacity_commitment: str ) -> str: - """Return a fully-qualified assignment string.""" - return "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( - project=project, - location=location, - reservation=reservation, - assignment=assignment, + """Return a fully-qualified capacity_commitment string.""" + return "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( + project=project, location=location, capacity_commitment=capacity_commitment ) @staticmethod - def parse_assignment_path(path: str) -> Dict[str, str]: - """Parse a assignment path into its component segments.""" + def parse_capacity_commitment_path(path: str) -> Dict[str, str]: + """Parse a capacity_commitment path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/reservations/(?P.+?)/assignments/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/capacityCommitments/(?P.+?)$", path, ) return m.groupdict() if m else {} @staticmethod - def reservation_path(project: str, location: str, reservation: str) -> str: - """Return a fully-qualified reservation string.""" - return "projects/{project}/locations/{location}/reservations/{reservation}".format( - project=project, location=location, reservation=reservation + def bi_reservation_path(project: str, location: str) -> str: + """Return a fully-qualified bi_reservation string.""" + return "projects/{project}/locations/{location}/bireservation".format( + project=project, location=location ) @staticmethod - def parse_reservation_path(path: str) -> Dict[str, str]: - """Parse a reservation path into its component segments.""" + def parse_bi_reservation_path(path: str) -> Dict[str, str]: + """Parse a bi_reservation path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/reservations/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/bireservation$", path, ) return m.groupdict() if m else {} @staticmethod - def capacity_commitment_path( - project: str, location: str, capacity_commitment: str - ) -> str: - """Return a fully-qualified capacity_commitment string.""" - return "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( - project=project, location=location, capacity_commitment=capacity_commitment + def reservation_path(project: str, location: str, reservation: str) -> str: + """Return a fully-qualified reservation string.""" + return "projects/{project}/locations/{location}/reservations/{reservation}".format( + project=project, location=location, reservation=reservation ) @staticmethod - def parse_capacity_commitment_path(path: str) -> Dict[str, str]: - """Parse a capacity_commitment path into its component segments.""" + def parse_reservation_path(path: str) -> Dict[str, str]: + """Parse a reservation path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/capacityCommitments/(?P.+?)$", + r"^projects/(?P.+?)/locations/(?P.+?)/reservations/(?P.+?)$", path, ) return m.groupdict() if m else {} @staticmethod - def bi_reservation_path(project: str, location: str) -> str: - """Return a fully-qualified bi_reservation string.""" - return "projects/{project}/locations/{location}/bireservation".format( - project=project, location=location + def assignment_path( + project: str, location: str, reservation: str, assignment: str + ) -> str: + """Return a fully-qualified assignment string.""" + return "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( + project=project, + location=location, + reservation=reservation, + assignment=assignment, ) @staticmethod - def parse_bi_reservation_path(path: str) -> Dict[str, str]: - """Parse a bi_reservation path into its component segments.""" + def parse_assignment_path(path: str) -> Dict[str, str]: + """Parse a assignment path into its component segments.""" m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/bireservation$", + r"^projects/(?P.+?)/locations/(?P.+?)/reservations/(?P.+?)/assignments/(?P.+?)$", path, ) return m.groupdict() if m else {} diff --git a/synth.metadata b/synth.metadata index 3ef04c2e..56520668 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-bigquery-reservation.git", - "sha": "46176500f8911a3559db8f757502aa05018ea7f7" + "sha": "c724e7db67ea1efd73b7ab0d097475187d9f5cc8" } }, { diff --git a/tests/unit/reservation_v1/test_reservation_service.py b/tests/unit/reservation_v1/test_reservation_service.py index 355b2b5a..3b77d6ab 100644 --- a/tests/unit/reservation_v1/test_reservation_service.py +++ b/tests/unit/reservation_v1/test_reservation_service.py @@ -2083,101 +2083,101 @@ def test_reservation_service_grpc_transport_channel_mtls_with_adc( assert transport.grpc_channel == mock_grpc_channel -def test_assignment_path(): +def test_capacity_commitment_path(): project = "squid" location = "clam" - reservation = "whelk" - assignment = "octopus" + capacity_commitment = "whelk" - expected = "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( - project=project, - location=location, - reservation=reservation, - assignment=assignment, + expected = "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( + project=project, location=location, capacity_commitment=capacity_commitment ) - actual = ReservationServiceClient.assignment_path( - project, location, reservation, assignment + actual = ReservationServiceClient.capacity_commitment_path( + project, location, capacity_commitment ) assert expected == actual -def test_parse_assignment_path(): +def test_parse_capacity_commitment_path(): expected = { - "project": "oyster", - "location": "nudibranch", - "reservation": "cuttlefish", - "assignment": "mussel", + "project": "octopus", + "location": "oyster", + "capacity_commitment": "nudibranch", } - path = ReservationServiceClient.assignment_path(**expected) + path = ReservationServiceClient.capacity_commitment_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_assignment_path(path) + actual = ReservationServiceClient.parse_capacity_commitment_path(path) assert expected == actual -def test_reservation_path(): +def test_bi_reservation_path(): project = "squid" location = "clam" - reservation = "whelk" - expected = "projects/{project}/locations/{location}/reservations/{reservation}".format( - project=project, location=location, reservation=reservation + expected = "projects/{project}/locations/{location}/bireservation".format( + project=project, location=location ) - actual = ReservationServiceClient.reservation_path(project, location, reservation) + actual = ReservationServiceClient.bi_reservation_path(project, location) assert expected == actual -def test_parse_reservation_path(): - expected = {"project": "octopus", "location": "oyster", "reservation": "nudibranch"} - path = ReservationServiceClient.reservation_path(**expected) +def test_parse_bi_reservation_path(): + expected = {"project": "whelk", "location": "octopus"} + path = ReservationServiceClient.bi_reservation_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_reservation_path(path) + actual = ReservationServiceClient.parse_bi_reservation_path(path) assert expected == actual -def test_capacity_commitment_path(): +def test_reservation_path(): project = "squid" location = "clam" - capacity_commitment = "whelk" + reservation = "whelk" - expected = "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( - project=project, location=location, capacity_commitment=capacity_commitment - ) - actual = ReservationServiceClient.capacity_commitment_path( - project, location, capacity_commitment + expected = "projects/{project}/locations/{location}/reservations/{reservation}".format( + project=project, location=location, reservation=reservation ) + actual = ReservationServiceClient.reservation_path(project, location, reservation) assert expected == actual -def test_parse_capacity_commitment_path(): - expected = { - "project": "octopus", - "location": "oyster", - "capacity_commitment": "nudibranch", - } - path = ReservationServiceClient.capacity_commitment_path(**expected) +def test_parse_reservation_path(): + expected = {"project": "octopus", "location": "oyster", "reservation": "nudibranch"} + path = ReservationServiceClient.reservation_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_capacity_commitment_path(path) + actual = ReservationServiceClient.parse_reservation_path(path) assert expected == actual -def test_bi_reservation_path(): +def test_assignment_path(): project = "squid" location = "clam" + reservation = "whelk" + assignment = "octopus" - expected = "projects/{project}/locations/{location}/bireservation".format( - project=project, location=location + expected = "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( + project=project, + location=location, + reservation=reservation, + assignment=assignment, + ) + actual = ReservationServiceClient.assignment_path( + project, location, reservation, assignment ) - actual = ReservationServiceClient.bi_reservation_path(project, location) assert expected == actual -def test_parse_bi_reservation_path(): - expected = {"project": "whelk", "location": "octopus"} - path = ReservationServiceClient.bi_reservation_path(**expected) +def test_parse_assignment_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + "reservation": "cuttlefish", + "assignment": "mussel", + } + path = ReservationServiceClient.assignment_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_bi_reservation_path(path) + actual = ReservationServiceClient.parse_assignment_path(path) assert expected == actual From ec9622835f4d1ed21d8f7f3d55c93dfc5ba5b214 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 May 2020 14:26:51 -0700 Subject: [PATCH 3/4] chore: update build scripts (via synth) (#9) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/114f5035-f0cf-4ea6-8fee-cdb41d93a838/targets Source-Link: https://github.com/googleapis/synthtool/commit/470789cee75ce93c41348ad6aa4c49363a80399b Source-Link: https://github.com/googleapis/synthtool/commit/849ae45d09ebacf90998e7352a682b2462eabbd6 Source-Link: https://github.com/googleapis/synthtool/commit/388f7aafee3d7a067c23db6c13b7e83fb361c64a Source-Link: https://github.com/googleapis/synthtool/commit/65f8c647c0bc0c6b38211b969a2a003e271a5ef1 Source-Link: https://github.com/googleapis/synthtool/commit/7ee92820e64c0aea379781b82399d6b3f3c8655f Source-Link: https://github.com/googleapis/synthtool/commit/520238f0b4d50ead1a20818855f7d732cb442540 Source-Link: https://github.com/googleapis/synthtool/commit/274dd49554809834287c24b6dd324a85283f1182 Source-Link: https://github.com/googleapis/synthtool/commit/d2364eb80b840a36136c8ce12f1c6efabcc9600e Source-Link: https://github.com/googleapis/synthtool/commit/2d9b52e5799722dac0ab5573e478e14daf388447 Source-Link: https://github.com/googleapis/synthtool/commit/7136daa5687f2a5bdcbba2cb25457f56fdf85d59 Source-Link: https://github.com/googleapis/synthtool/commit/2aa4a1ed43ab867793be8e8044f7e0210fd9dc92 Source-Link: https://github.com/googleapis/synthtool/commit/3593e3a995510c0570648d9a48fc756ab2bfc2cb Source-Link: https://github.com/googleapis/synthtool/commit/b6bdd4783f396f9252ce28af43f7215834a55c3c Source-Link: https://github.com/googleapis/synthtool/commit/f395615039665af6599f69305efcd886685e74f9 Source-Link: https://github.com/googleapis/synthtool/commit/7b7f386b393947a542b87707499f4458136f4f61 Source-Link: https://github.com/googleapis/synthtool/commit/3d2a7d0e21387ed455c966da9f9897b0a4bc5bb8 Source-Link: https://github.com/googleapis/synthtool/commit/f503622985e230a6792730bbc3b7746c11fce09e Source-Link: https://github.com/googleapis/synthtool/commit/84c4156c49be9dcabacc8fd7b0585b6fd789ae47 Source-Link: https://github.com/googleapis/synthtool/commit/b0461724be19443075b08c10d4a345cb217002b5 Source-Link: https://github.com/googleapis/synthtool/commit/c585ac3b5eff5cd2097a5315ffd9cf4823cc1ed2 Source-Link: https://github.com/googleapis/synthtool/commit/5b48b0716a36ca069db3038da7e205c87a22ed19 Source-Link: https://github.com/googleapis/synthtool/commit/a7759f81c25396207d46532ed389ad4d34879857 Source-Link: https://github.com/googleapis/synthtool/commit/7482e79a82e353248769d819788adc1213e8c207 Source-Link: https://github.com/googleapis/synthtool/commit/ba909fca409f6b38eae0fa735614e127d1fc0deb PiperOrigin-RevId: 311053644 Source-Link: https://github.com/googleapis/googleapis/commit/edd3b80fb770548d6ad780105f1782de6ff73ea0 Source-Link: https://github.com/googleapis/synthtool/commit/98c50772ec23295c64cf0d2ddf199ea52961fd4c --- .kokoro/publish-docs.sh | 2 -- .kokoro/release.sh | 2 -- synth.metadata | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh index cc5f0648..c898ec4a 100755 --- a/.kokoro/publish-docs.sh +++ b/.kokoro/publish-docs.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Disable buffering, so that the logs stream through. diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 18d33f9b..ecd73d18 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Start the releasetool reporter diff --git a/synth.metadata b/synth.metadata index 56520668..54c7a1df 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "98c50772ec23295c64cf0d2ddf199ea52961fd4c" + "sha": "470789cee75ce93c41348ad6aa4c49363a80399b" } } ], From bd99c23ca4b29514be055cd949e24cdf2d422519 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 May 2020 22:16:50 +0000 Subject: [PATCH 4/4] chore: release 0.2.0 (#10) :robot: I have created a release \*beep\* \*boop\* --- ## [0.2.0](https://www.github.com/googleapis/python-bigquery-reservation/compare/v0.1.0...v0.2.0) (2020-05-27) ### Features * add helper methods to parse resource paths (via synth) ([#7](https://www.github.com/googleapis/python-bigquery-reservation/issues/7)) ([8fc54cb](https://www.github.com/googleapis/python-bigquery-reservation/commit/8fc54cb70be698f6d265f60d7b8ee4561d12d2c9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c075cbaf..d70b7e0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.0](https://www.github.com/googleapis/python-bigquery-reservation/compare/v0.1.0...v0.2.0) (2020-05-27) + + +### Features + +* add helper methods to parse resource paths (via synth) ([#7](https://www.github.com/googleapis/python-bigquery-reservation/issues/7)) ([8fc54cb](https://www.github.com/googleapis/python-bigquery-reservation/commit/8fc54cb70be698f6d265f60d7b8ee4561d12d2c9)) + ## 0.1.0 (2020-05-12) diff --git a/setup.py b/setup.py index e6ea5d52..01a96e8b 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "0.1.0" +version = "0.2.0" package_root = os.path.abspath(os.path.dirname(__file__))