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

Commit

Permalink
feat: update BigQuery Analytics Hub API v1beta1 client (#32)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

refresh current dataexchange/v1beta1/* directory to include recent change in protos. 

fix: refactor references to Category message
docs: improve proto documentation.

PiperOrigin-RevId: 471349319

Source-Link: googleapis/googleapis@8495024

Source-Link: googleapis/googleapis-gen@2d8c38b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmQ4YzM4YjkwYTVhMTk4ZDcxZWIxYThlYjQzZTBjZTU2MTI3YWMwZCJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 1, 2022
1 parent fe715df commit 7c34320
Show file tree
Hide file tree
Showing 8 changed files with 1,039 additions and 362 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ branch = True
[report]
show_missing = True
omit =
google/cloud/bigquery_data_exchange/common/__init__.py
google/cloud/bigquery_data_exchange/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from google.oauth2 import service_account # type: ignore

from google.cloud.bigquery_data_exchange_v1beta1.types import dataexchange
from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
Expand Down Expand Up @@ -369,6 +370,27 @@ def test_iam_permissions(
]:
raise NotImplementedError()

@property
def get_location(
self,
) -> Callable[
[locations_pb2.GetLocationRequest],
Union[locations_pb2.Location, Awaitable[locations_pb2.Location]],
]:
raise NotImplementedError()

@property
def list_locations(
self,
) -> Callable[
[locations_pb2.ListLocationsRequest],
Union[
locations_pb2.ListLocationsResponse,
Awaitable[locations_pb2.ListLocationsResponse],
],
]:
raise NotImplementedError()

@property
def kind(self) -> str:
raise NotImplementedError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import grpc # type: ignore

from google.cloud.bigquery_data_exchange_v1beta1.types import dataexchange
from google.cloud.location import locations_pb2 # type: ignore
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
Expand All @@ -34,12 +35,13 @@
class AnalyticsHubServiceGrpcTransport(AnalyticsHubServiceTransport):
"""gRPC backend transport for AnalyticsHubService.
The AnalyticsHubService API facilitates data sharing within
and across organizations. It allows data providers to publish
Listings --- a discoverable and searchable SKU representing a
dataset. Data consumers can subscribe to Listings. Upon
subscription, AnalyticsHub provisions a "Linked Datasets"
surfacing the data in the consumer's project.
The ``AnalyticsHubService`` API facilitates data sharing within and
across organizations. It allows data providers to publish listings
that reference shared datasets. With Analytics Hub, users can
discover and search for listings that they have access to.
Subscribers can view and subscribe to listings. When you subscribe
to a listing, Analytics Hub creates a linked dataset in your
project.
This class defines the same methods as the primary client, so the
primary client can load the underlying transport implementation
Expand Down Expand Up @@ -245,7 +247,8 @@ def list_data_exchanges(
]:
r"""Return a callable for the list data exchanges method over gRPC.
Lists DataExchanges in a given project and location.
Lists all data exchanges in a given project and
location.
Returns:
Callable[[~.ListDataExchangesRequest],
Expand Down Expand Up @@ -274,7 +277,7 @@ def list_org_data_exchanges(
]:
r"""Return a callable for the list org data exchanges method over gRPC.
Lists DataExchanges from projects in a given
Lists all data exchanges from projects in a given
organization and location.
Returns:
Expand All @@ -301,7 +304,7 @@ def get_data_exchange(
) -> Callable[[dataexchange.GetDataExchangeRequest], dataexchange.DataExchange]:
r"""Return a callable for the get data exchange method over gRPC.
Gets details of a single DataExchange.
Gets the details of a data exchange.
Returns:
Callable[[~.GetDataExchangeRequest],
Expand All @@ -327,8 +330,7 @@ def create_data_exchange(
) -> Callable[[dataexchange.CreateDataExchangeRequest], dataexchange.DataExchange]:
r"""Return a callable for the create data exchange method over gRPC.
Creates a new DataExchange in a given project and
location.
Creates a new data exchange.
Returns:
Callable[[~.CreateDataExchangeRequest],
Expand All @@ -354,7 +356,7 @@ def update_data_exchange(
) -> Callable[[dataexchange.UpdateDataExchangeRequest], dataexchange.DataExchange]:
r"""Return a callable for the update data exchange method over gRPC.
Updates the parameters of a single DataExchange.
Updates an existing data exchange.
Returns:
Callable[[~.UpdateDataExchangeRequest],
Expand All @@ -380,7 +382,7 @@ def delete_data_exchange(
) -> Callable[[dataexchange.DeleteDataExchangeRequest], empty_pb2.Empty]:
r"""Return a callable for the delete data exchange method over gRPC.
Deletes a single DataExchange.
Deletes an existing data exchange.
Returns:
Callable[[~.DeleteDataExchangeRequest],
Expand Down Expand Up @@ -408,7 +410,7 @@ def list_listings(
]:
r"""Return a callable for the list listings method over gRPC.
Lists Listings in a given project and location.
Lists all listings in a given project and location.
Returns:
Callable[[~.ListListingsRequest],
Expand All @@ -434,7 +436,7 @@ def get_listing(
) -> Callable[[dataexchange.GetListingRequest], dataexchange.Listing]:
r"""Return a callable for the get listing method over gRPC.
Gets details of a single Listing.
Gets the details of a listing.
Returns:
Callable[[~.GetListingRequest],
Expand All @@ -460,8 +462,7 @@ def create_listing(
) -> Callable[[dataexchange.CreateListingRequest], dataexchange.Listing]:
r"""Return a callable for the create listing method over gRPC.
Creates a new Listing in a given project and
location.
Creates a new listing.
Returns:
Callable[[~.CreateListingRequest],
Expand All @@ -487,7 +488,7 @@ def update_listing(
) -> Callable[[dataexchange.UpdateListingRequest], dataexchange.Listing]:
r"""Return a callable for the update listing method over gRPC.
Updates the parameters of a single Listing.
Updates an existing listing.
Returns:
Callable[[~.UpdateListingRequest],
Expand All @@ -513,9 +514,7 @@ def delete_listing(
) -> Callable[[dataexchange.DeleteListingRequest], empty_pb2.Empty]:
r"""Return a callable for the delete listing method over gRPC.
Deletes a single Listing, as long as there are no
subscriptions associated with the source of this
Listing.
Deletes a listing.
Returns:
Callable[[~.DeleteListingRequest],
Expand Down Expand Up @@ -543,11 +542,12 @@ def subscribe_listing(
]:
r"""Return a callable for the subscribe listing method over gRPC.
Subscribes to a single Listing.
Data Exchange currently supports one type of Listing: a
BigQuery dataset. Upon subscription to a Listing for a
BigQuery dataset, Data Exchange creates a linked dataset
in the subscriber's project.
Subscribes to a listing.
Currently, with Analytics Hub, you can create listings
that reference only BigQuery datasets.
Upon subscription to a listing for a BigQuery dataset,
Analytics Hub creates a linked dataset in the
subscriber's project.
Returns:
Callable[[~.SubscribeListingRequest],
Expand All @@ -573,7 +573,7 @@ def get_iam_policy(
) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]:
r"""Return a callable for the get iam policy method over gRPC.
Gets the IAM policy for a dataExchange or a listing.
Gets the IAM policy.
Returns:
Callable[[~.GetIamPolicyRequest],
Expand All @@ -599,7 +599,7 @@ def set_iam_policy(
) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]:
r"""Return a callable for the set iam policy method over gRPC.
Sets the IAM policy for a dataExchange or a listing.
Sets the IAM policy.
Returns:
Callable[[~.SetIamPolicyRequest],
Expand Down Expand Up @@ -628,8 +628,7 @@ def test_iam_permissions(
]:
r"""Return a callable for the test iam permissions method over gRPC.
Returns the permissions that a caller has on a
specified dataExchange or listing.
Returns the permissions that a caller has.
Returns:
Callable[[~.TestIamPermissionsRequest],
Expand All @@ -652,6 +651,42 @@ def test_iam_permissions(
def close(self):
self.grpc_channel.close()

@property
def list_locations(
self,
) -> Callable[
[locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse
]:
r"""Return a callable for the list locations method over gRPC."""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "list_locations" not in self._stubs:
self._stubs["list_locations"] = self.grpc_channel.unary_unary(
"/google.cloud.location.Locations/ListLocations",
request_serializer=locations_pb2.ListLocationsRequest.SerializeToString,
response_deserializer=locations_pb2.ListLocationsResponse.FromString,
)
return self._stubs["list_locations"]

@property
def get_location(
self,
) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]:
r"""Return a callable for the list locations method over gRPC."""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "get_location" not in self._stubs:
self._stubs["get_location"] = self.grpc_channel.unary_unary(
"/google.cloud.location.Locations/GetLocation",
request_serializer=locations_pb2.GetLocationRequest.SerializeToString,
response_deserializer=locations_pb2.Location.FromString,
)
return self._stubs["get_location"]

@property
def kind(self) -> str:
return "grpc"
Expand Down

0 comments on commit 7c34320

Please sign in to comment.