Class AnalyticsHubServiceAsyncClient (0.4.12)

AnalyticsHubServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.transports.base.AnalyticsHubServiceTransport, typing.Callable[[...], google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.transports.base.AnalyticsHubServiceTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

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.

Properties

api_endpoint

Return the API endpoint used by the client instance.

Returns
Type Description
str The API endpoint used by the client instance.

transport

Returns the transport used by the client instance.

Returns
Type Description
AnalyticsHubServiceTransport The transport used by the client instance.

universe_domain

Return the universe domain used by the client instance.

Returns
Type Description
str The universe domain used by the client instance.

Methods

AnalyticsHubServiceAsyncClient

AnalyticsHubServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.transports.base.AnalyticsHubServiceTransport, typing.Callable[[...], google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.transports.base.AnalyticsHubServiceTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the analytics hub service async client.

Parameters
Name Description
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Optional[Union[str,AnalyticsHubServiceTransport,Callable[..., AnalyticsHubServiceTransport]]]

The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the AnalyticsHubServiceTransport constructor. If set to None, a transport is chosen automatically.

client_options Optional[Union[google.api_core.client_options.ClientOptions, dict]]

Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
Type Description
google.auth.exceptions.MutualTlsChannelError If mutual TLS transport creation failed for any reason.

common_billing_account_path

common_billing_account_path(billing_account: str) -> str

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str) -> str

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str) -> str

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str) -> str

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str) -> str

Returns a fully-qualified project string.

create_data_exchange

create_data_exchange(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.CreateDataExchangeRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    data_exchange: typing.Optional[
        google.cloud.bigquery_analyticshub_v1.types.analyticshub.DataExchange
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.DataExchange

Creates a new data exchange.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_create_data_exchange():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    data_exchange = bigquery_analyticshub_v1.DataExchange()
    data_exchange.display_name = "display_name_value"

    request = bigquery_analyticshub_v1.CreateDataExchangeRequest(
        parent="parent_value",
        data_exchange_id="data_exchange_id_value",
        data_exchange=data_exchange,
    )

    # Make the request
    response = await client.create_data_exchange(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.CreateDataExchangeRequest, dict]]

The request object. Message for creating a data exchange.

parent str

Required. The parent resource path of the data exchange. e.g. projects/myproject/locations/US. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

data_exchange DataExchange

Required. The data exchange to create. This corresponds to the data_exchange field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.DataExchange A data exchange is a container that lets you share data. Along with the descriptive information about the data exchange, it contains listings that reference shared datasets.

create_listing

create_listing(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.CreateListingRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    listing: typing.Optional[
        google.cloud.bigquery_analyticshub_v1.types.analyticshub.Listing
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.Listing

Creates a new listing.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_create_listing():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    listing = bigquery_analyticshub_v1.Listing()
    listing.display_name = "display_name_value"

    request = bigquery_analyticshub_v1.CreateListingRequest(
        parent="parent_value",
        listing_id="listing_id_value",
        listing=listing,
    )

    # Make the request
    response = await client.create_listing(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.CreateListingRequest, dict]]

The request object. Message for creating a listing.

parent str

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

listing Listing

Required. The listing to create. This corresponds to the listing field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.Listing A listing is what gets published into a data exchange that a subscriber can subscribe to. It contains a reference to the data source along with descriptive information that will help subscribers find and subscribe the data.

data_exchange_path

data_exchange_path(project: str, location: str, data_exchange: str) -> str

Returns a fully-qualified data_exchange string.

dataset_path

dataset_path(project: str, dataset: str) -> str

Returns a fully-qualified dataset string.

delete_data_exchange

delete_data_exchange(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.DeleteDataExchangeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes an existing data exchange.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_delete_data_exchange():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.DeleteDataExchangeRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_data_exchange(request=request)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.DeleteDataExchangeRequest, dict]]

The request object. Message for deleting a data exchange.

name str

Required. The full name of the data exchange resource that you want to delete. For example, projects/myproject/locations/US/dataExchanges/123. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

delete_listing

delete_listing(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.DeleteListingRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a listing.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_delete_listing():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.DeleteListingRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_listing(request=request)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.DeleteListingRequest, dict]]

The request object. Message for deleting a listing.

name str

Required. Resource name of the listing to delete. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

delete_subscription

delete_subscription(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.DeleteSubscriptionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation

Deletes a subscription.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_delete_subscription():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.DeleteSubscriptionRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_subscription(request=request)

    print("Waiting for operation to complete...")

    response = (await operation).result()

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.DeleteSubscriptionRequest, dict]]

The request object. Message for deleting a subscription.

name str

Required. Resource name of the subscription to delete. e.g. projects/123/locations/US/subscriptions/456 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation_async.AsyncOperation An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
AnalyticsHubServiceAsyncClient The constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
Name Description
info dict

The service account private key info.

Returns
Type Description
AnalyticsHubServiceAsyncClient The constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
AnalyticsHubServiceAsyncClient The constructed client.

get_data_exchange

get_data_exchange(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.GetDataExchangeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.DataExchange

Gets the details of a data exchange.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_get_data_exchange():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.GetDataExchangeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_data_exchange(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.GetDataExchangeRequest, dict]]

The request object. Message for getting a data exchange.

name str

Required. The resource name of the data exchange. e.g. projects/myproject/locations/US/dataExchanges/123. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.DataExchange A data exchange is a container that lets you share data. Along with the descriptive information about the data exchange, it contains listings that reference shared datasets.

get_iam_policy

get_iam_policy(
    request: typing.Optional[
        typing.Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.policy_pb2.Policy

Gets the IAM policy.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1
from google.iam.v1 import iam_policy_pb2  # type: ignore

async def sample_get_iam_policy():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = iam_policy_pb2.GetIamPolicyRequest(
        resource="resource_value",
    )

    # Make the request
    response = await client.get_iam_policy(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]

The request object. Request message for GetIamPolicy method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.iam.v1.policy_pb2.Policy An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds one or more members, or principals, to a single role. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions; each role can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a binding can also specify a condition, which is a logical expression that allows access to a resource only if the expression evaluates to true. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** :literal:\ { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01t00:00:00.000z')",="" }="" }="" ],="" "etag":="" "bwwwja0yfja=", " version":="" 3="">\ \ **YAML example:** :literal:\ bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01t00:00:00.000z')="" etag:="" bwwwja0yfja="version:">\ \ For a description of IAM and its features, see the [IAM documentation](\ https://cloud.google.com/iam/docs/).

get_listing

get_listing(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.GetListingRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.Listing

Gets the details of a listing.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_get_listing():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.GetListingRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_listing(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.GetListingRequest, dict]]

The request object. Message for getting a listing.

name str

Required. The resource name of the listing. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.Listing A listing is what gets published into a data exchange that a subscriber can subscribe to. It contains a reference to the data source along with descriptive information that will help subscribers find and subscribe the data.

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
Name Description
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If any errors happen.
Returns
Type Description
Tuple[str, Callable[[], Tuple[bytes, bytes]]] returns the API endpoint and the client cert source to use.

get_subscription

get_subscription(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.GetSubscriptionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.Subscription

Gets the details of a Subscription.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_get_subscription():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.GetSubscriptionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_subscription(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.GetSubscriptionRequest, dict]]

The request object. Message for getting a subscription.

name str

Required. Resource name of the subscription. e.g. projects/123/locations/US/subscriptions/456 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.Subscription A subscription represents a subscribers' access to a particular set of published data. It contains references to associated listings, data exchanges, and linked datasets.

get_transport_class

get_transport_class(
    label: typing.Optional[str] = None,
) -> typing.Type[
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.transports.base.AnalyticsHubServiceTransport
]

Returns an appropriate transport class.

Parameter
Name Description
label typing.Optional[str]

The name of the desired transport. If none is provided, then the first transport in the registry is used.

list_data_exchanges

list_data_exchanges(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.ListDataExchangesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListDataExchangesAsyncPager
)

Lists all data exchanges in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_list_data_exchanges():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.ListDataExchangesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_data_exchanges(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.ListDataExchangesRequest, dict]]

The request object. Message for requesting the list of data exchanges.

parent str

Required. The parent resource path of the data exchanges. e.g. projects/myproject/locations/US. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListDataExchangesAsyncPager Message for response to the list of data exchanges. Iterating over this object will yield results and resolve additional pages automatically.

list_listings

list_listings(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.ListListingsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListListingsAsyncPager
)

Lists all listings in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_list_listings():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.ListListingsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_listings(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.ListListingsRequest, dict]]

The request object. Message for requesting the list of listings.

parent str

Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListListingsAsyncPager Message for response to the list of Listings. Iterating over this object will yield results and resolve additional pages automatically.

list_org_data_exchanges

list_org_data_exchanges(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.ListOrgDataExchangesRequest,
            dict,
        ]
    ] = None,
    *,
    organization: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListOrgDataExchangesAsyncPager
)

Lists all data exchanges from projects in a given organization and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_list_org_data_exchanges():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.ListOrgDataExchangesRequest(
        organization="organization_value",
    )

    # Make the request
    page_result = client.list_org_data_exchanges(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.ListOrgDataExchangesRequest, dict]]

The request object. Message for requesting the list of data exchanges from projects in an organization and location.

organization str

Required. The organization resource path of the projects containing DataExchanges. e.g. organizations/myorg/locations/US. This corresponds to the organization field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListOrgDataExchangesAsyncPager Message for response to listing data exchanges in an organization and location. Iterating over this object will yield results and resolve additional pages automatically.

list_shared_resource_subscriptions

list_shared_resource_subscriptions(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.ListSharedResourceSubscriptionsRequest,
            dict,
        ]
    ] = None,
    *,
    resource: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListSharedResourceSubscriptionsAsyncPager
)

Lists all subscriptions on a given Data Exchange or Listing.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_list_shared_resource_subscriptions():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.ListSharedResourceSubscriptionsRequest(
        resource="resource_value",
    )

    # Make the request
    page_result = client.list_shared_resource_subscriptions(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.ListSharedResourceSubscriptionsRequest, dict]]

The request object. Message for listing subscriptions of a shared resource.

resource str

Required. Resource name of the requested target. This resource may be either a Listing or a DataExchange. e.g. projects/123/locations/US/dataExchanges/456 OR e.g. projects/123/locations/US/dataExchanges/456/listings/789 This corresponds to the resource field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListSharedResourceSubscriptionsAsyncPager Message for response to the listing of shared resource subscriptions. Iterating over this object will yield results and resolve additional pages automatically.

list_subscriptions

list_subscriptions(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.ListSubscriptionsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListSubscriptionsAsyncPager
)

Lists all subscriptions in a given project and location.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_list_subscriptions():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.ListSubscriptionsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_subscriptions(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.ListSubscriptionsRequest, dict]]

The request object. Message for listing subscriptions.

parent str

Required. The parent resource path of the subscription. e.g. projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.services.analytics_hub_service.pagers.ListSubscriptionsAsyncPager Message for response to the listing of subscriptions. Iterating over this object will yield results and resolve additional pages automatically.

listing_path

listing_path(project: str, location: str, data_exchange: str, listing: str) -> str

Returns a fully-qualified listing string.

parse_common_billing_account_path

parse_common_billing_account_path(path: str) -> typing.Dict[str, str]

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str) -> typing.Dict[str, str]

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str) -> typing.Dict[str, str]

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str) -> typing.Dict[str, str]

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str) -> typing.Dict[str, str]

Parse a project path into its component segments.

parse_data_exchange_path

parse_data_exchange_path(path: str) -> typing.Dict[str, str]

Parses a data_exchange path into its component segments.

parse_dataset_path

parse_dataset_path(path: str) -> typing.Dict[str, str]

Parses a dataset path into its component segments.

parse_listing_path

parse_listing_path(path: str) -> typing.Dict[str, str]

Parses a listing path into its component segments.

parse_subscription_path

parse_subscription_path(path: str) -> typing.Dict[str, str]

Parses a subscription path into its component segments.

parse_table_path

parse_table_path(path: str) -> typing.Dict[str, str]

Parses a table path into its component segments.

refresh_subscription

refresh_subscription(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.RefreshSubscriptionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation

Refreshes a Subscription to a Data Exchange. A Data Exchange can become stale when a publisher adds or removes data. This is a long-running operation as it may create many linked datasets.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_refresh_subscription():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.RefreshSubscriptionRequest(
        name="name_value",
    )

    # Make the request
    operation = client.refresh_subscription(request=request)

    print("Waiting for operation to complete...")

    response = (await operation).result()

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.RefreshSubscriptionRequest, dict]]

The request object. Message for refreshing a subscription.

name str

Required. Resource name of the Subscription to refresh. e.g. projects/subscriberproject/locations/US/subscriptions/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation_async.AsyncOperation An object representing a long-running operation. The result type for the operation will be RefreshSubscriptionResponse Message for response when you refresh a subscription.

revoke_subscription

revoke_subscription(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.RevokeSubscriptionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> (
    google.cloud.bigquery_analyticshub_v1.types.analyticshub.RevokeSubscriptionResponse
)

Revokes a given subscription.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_revoke_subscription():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.RevokeSubscriptionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.revoke_subscription(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.RevokeSubscriptionRequest, dict]]

The request object. Message for revoking a subscription.

name str

Required. Resource name of the subscription to revoke. e.g. projects/123/locations/US/subscriptions/456 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.RevokeSubscriptionResponse Message for response when you revoke a subscription.

set_iam_policy

set_iam_policy(
    request: typing.Optional[
        typing.Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.policy_pb2.Policy

Sets the IAM policy.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1
from google.iam.v1 import iam_policy_pb2  # type: ignore

async def sample_set_iam_policy():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = iam_policy_pb2.SetIamPolicyRequest(
        resource="resource_value",
    )

    # Make the request
    response = await client.set_iam_policy(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]

The request object. Request message for SetIamPolicy method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.iam.v1.policy_pb2.Policy An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds one or more members, or principals, to a single role. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A role is a named list of permissions; each role can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a binding can also specify a condition, which is a logical expression that allows access to a resource only if the expression evaluates to true. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** :literal:\ { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01t00:00:00.000z')",="" }="" }="" ],="" "etag":="" "bwwwja0yfja=", " version":="" 3="">\ \ **YAML example:** :literal:\ bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01t00:00:00.000z')="" etag:="" bwwwja0yfja="version:">\ \ For a description of IAM and its features, see the [IAM documentation](\ https://cloud.google.com/iam/docs/).

subscribe_data_exchange

subscribe_data_exchange(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.SubscribeDataExchangeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation

Creates a Subscription to a Data Exchange. This is a long-running operation as it will create one or more linked datasets.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_subscribe_data_exchange():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_analyticshub_v1.SubscribeDataExchangeRequest(
        name="name_value",
        destination="destination_value",
        subscription="subscription_value",
    )

    # Make the request
    operation = client.subscribe_data_exchange(request=request)

    print("Waiting for operation to complete...")

    response = (await operation).result()

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.SubscribeDataExchangeRequest, dict]]

The request object. Message for subscribing to a Data Exchange.

name str

Required. Resource name of the Data Exchange. e.g. projects/publisherproject/locations/US/dataExchanges/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.api_core.operation_async.AsyncOperation An object representing a long-running operation. The result type for the operation will be SubscribeDataExchangeResponse Message for response when you subscribe to a Data Exchange.

subscribe_listing

subscribe_listing(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.SubscribeListingRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.SubscribeListingResponse

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_subscribe_listing():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    destination_dataset = bigquery_analyticshub_v1.DestinationDataset()
    destination_dataset.dataset_reference.dataset_id = "dataset_id_value"
    destination_dataset.dataset_reference.project_id = "project_id_value"
    destination_dataset.location = "location_value"

    request = bigquery_analyticshub_v1.SubscribeListingRequest(
        destination_dataset=destination_dataset,
        name="name_value",
    )

    # Make the request
    response = await client.subscribe_listing(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.SubscribeListingRequest, dict]]

The request object. Message for subscribing to a listing.

name str

Required. Resource name of the listing that you want to subscribe to. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.SubscribeListingResponse Message for response when you subscribe to a listing.

subscription_path

subscription_path(project: str, location: str, subscription: str) -> str

Returns a fully-qualified subscription string.

table_path

table_path(project: str, dataset: str, table: str) -> str

Returns a fully-qualified table string.

test_iam_permissions

test_iam_permissions(
    request: typing.Optional[
        typing.Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse

Returns the permissions that a caller has.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1
from google.iam.v1 import iam_policy_pb2  # type: ignore

async def sample_test_iam_permissions():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    request = iam_policy_pb2.TestIamPermissionsRequest(
        resource="resource_value",
        permissions=['permissions_value1', 'permissions_value2'],
    )

    # Make the request
    response = await client.test_iam_permissions(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]

The request object. Request message for TestIamPermissions method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse Response message for TestIamPermissions method.

update_data_exchange

update_data_exchange(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.UpdateDataExchangeRequest,
            dict,
        ]
    ] = None,
    *,
    data_exchange: typing.Optional[
        google.cloud.bigquery_analyticshub_v1.types.analyticshub.DataExchange
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.DataExchange

Updates an existing data exchange.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_update_data_exchange():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    data_exchange = bigquery_analyticshub_v1.DataExchange()
    data_exchange.display_name = "display_name_value"

    request = bigquery_analyticshub_v1.UpdateDataExchangeRequest(
        data_exchange=data_exchange,
    )

    # Make the request
    response = await client.update_data_exchange(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.UpdateDataExchangeRequest, dict]]

The request object. Message for updating a data exchange.

data_exchange DataExchange

Required. The data exchange to update. This corresponds to the data_exchange field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Required. Field mask specifies the fields to update in the data exchange resource. The fields specified in the updateMask are relative to the resource and are not a full request. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.DataExchange A data exchange is a container that lets you share data. Along with the descriptive information about the data exchange, it contains listings that reference shared datasets.

update_listing

update_listing(
    request: typing.Optional[
        typing.Union[
            google.cloud.bigquery_analyticshub_v1.types.analyticshub.UpdateListingRequest,
            dict,
        ]
    ] = None,
    *,
    listing: typing.Optional[
        google.cloud.bigquery_analyticshub_v1.types.analyticshub.Listing
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.bigquery_analyticshub_v1.types.analyticshub.Listing

Updates an existing listing.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_analyticshub_v1

async def sample_update_listing():
    # Create a client
    client = bigquery_analyticshub_v1.AnalyticsHubServiceAsyncClient()

    # Initialize request argument(s)
    listing = bigquery_analyticshub_v1.Listing()
    listing.display_name = "display_name_value"

    request = bigquery_analyticshub_v1.UpdateListingRequest(
        listing=listing,
    )

    # Make the request
    response = await client.update_listing(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.bigquery_analyticshub_v1.types.UpdateListingRequest, dict]]

The request object. Message for updating a Listing.

listing Listing

Required. The listing to update. This corresponds to the listing field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Required. Field mask specifies the fields to update in the listing resource. The fields specified in the updateMask are relative to the resource and are not a full request. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
Type Description
google.cloud.bigquery_analyticshub_v1.types.Listing A listing is what gets published into a data exchange that a subscriber can subscribe to. It contains a reference to the data source along with descriptive information that will help subscribers find and subscribe the data.