Class: Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb

Overview

REST client for the AnalyticsHubService service.

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.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#data_exchange_path, #dataset_path, #listing_path, #location_path, #subscription_path, #table_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new AnalyticsHubService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the AnalyticsHubService client.

Yield Parameters:



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 134

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @analytics_hub_service_stub = ::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Operations (readonly)

Get the associated client for long-running operations.



177
178
179
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 177

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the AnalyticsHubService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all AnalyticsHubService clients
::Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 67

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Bigquery", "AnalyticsHub", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the AnalyticsHubService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



104
105
106
107
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 104

def configure
  yield @config if block_given?
  @config
end

#create_data_exchange(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange #create_data_exchange(parent: nil, data_exchange_id: nil, data_exchange: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

Creates a new data exchange.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest.new

# Call the create_data_exchange method.
result = client.create_data_exchange request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
p result

Overloads:

  • #create_data_exchange(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

    Pass arguments to create_data_exchange via a request object, either of type CreateDataExchangeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_data_exchange(parent: nil, data_exchange_id: nil, data_exchange: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

    Pass arguments to create_data_exchange via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource path of the data exchange. e.g. projects/myproject/locations/US.

    • data_exchange_id (::String) (defaults to: nil)

      Required. The ID of the data exchange. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. Max length: 100 bytes.

    • data_exchange (::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange, ::Hash) (defaults to: nil)

      Required. The data exchange to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 493

def create_data_exchange request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_data_exchange..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_data_exchange.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_data_exchange.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.create_data_exchange request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing #create_listing(parent: nil, listing_id: nil, listing: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

Creates a new listing.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest.new

# Call the create_listing method.
result = client.create_listing request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
p result

Overloads:

  • #create_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

    Pass arguments to create_listing via a request object, either of type CreateListingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_listing(parent: nil, listing_id: nil, listing: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

    Pass arguments to create_listing via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

    • listing_id (::String) (defaults to: nil)

      Required. The ID of the listing to create. Must contain only Unicode letters, numbers (0-9), underscores (_). Should not use characters that require URL-escaping, or characters outside of ASCII, spaces. Max length: 100 bytes.

    • listing (::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing, ::Hash) (defaults to: nil)

      Required. The listing to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 910

def create_listing request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_listing..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_listing.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_listing.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.create_listing request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_data_exchange(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_data_exchange(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an existing data exchange.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest.new

# Call the delete_data_exchange method.
result = client.delete_data_exchange request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_data_exchange(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_data_exchange via a request object, either of type DeleteDataExchangeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_data_exchange(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_data_exchange via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The full name of the data exchange resource that you want to delete. For example, projects/myproject/locations/US/dataExchanges/123.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 654

def delete_data_exchange request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_data_exchange..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_data_exchange.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_data_exchange.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.delete_data_exchange request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_listing(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_listing(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a listing.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest.new

# Call the delete_listing method.
result = client.delete_listing request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_listing(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_listing via a request object, either of type DeleteListingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_listing(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_listing via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the listing to delete. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1071

def delete_listing request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_listing..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_listing.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_listing.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.delete_listing request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_subscription(request, options = nil) ⇒ ::Gapic::Operation #delete_subscription(name: nil) ⇒ ::Gapic::Operation

Deletes a subscription.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest.new

# Call the delete_subscription method.
result = client.delete_subscription request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_subscription(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_subscription via a request object, either of type DeleteSubscriptionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_subscription(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_subscription via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the subscription to delete. e.g. projects/123/locations/US/subscriptions/456

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1769

def delete_subscription request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteSubscriptionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_subscription..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_subscription.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_subscription.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.delete_subscription request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_data_exchange(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange #get_data_exchange(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

Gets the details of a data exchange.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest.new

# Call the get_data_exchange method.
result = client.get_data_exchange request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
p result

Overloads:

  • #get_data_exchange(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

    Pass arguments to get_data_exchange via a request object, either of type GetDataExchangeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_data_exchange(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

    Pass arguments to get_data_exchange via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the data exchange. e.g. projects/myproject/locations/US/dataExchanges/123.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 406

def get_data_exchange request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_data_exchange..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_data_exchange.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_data_exchange.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.get_data_exchange request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

Gets the IAM policy.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1852

def get_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.get_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing #get_listing(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

Gets the details of a listing.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest.new

# Call the get_listing method.
result = client.get_listing request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
p result

Overloads:

  • #get_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

    Pass arguments to get_listing via a request object, either of type GetListingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_listing(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

    Pass arguments to get_listing via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the listing. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 823

def get_listing request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_listing..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_listing.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_listing.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.get_listing request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_subscription(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription #get_subscription(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription

Gets the details of a Subscription.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest.new

# Call the get_subscription method.
result = client.get_subscription request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
p result

Overloads:

  • #get_subscription(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription

    Pass arguments to get_subscription via a request object, either of type GetSubscriptionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_subscription(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription

    Pass arguments to get_subscription via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the subscription. e.g. projects/123/locations/US/subscriptions/456

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1421

def get_subscription request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetSubscriptionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_subscription..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_subscription.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_subscription.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.get_subscription request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_data_exchanges(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange> #list_data_exchanges(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

Lists all data exchanges in a given project and location.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest.new

# Call the list_data_exchanges method.
result = client.list_data_exchanges request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
  p item
end

Overloads:

  • #list_data_exchanges(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

    Pass arguments to list_data_exchanges via a request object, either of type ListDataExchangesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_data_exchanges(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

    Pass arguments to list_data_exchanges via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource path of the data exchanges. e.g. projects/myproject/locations/US.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.

    • page_token (::String) (defaults to: nil)

      Page token, returned by a previous call, to request the next page of results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 235

def list_data_exchanges request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_data_exchanges..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_data_exchanges.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_data_exchanges.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.list_data_exchanges request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_data_exchanges, "data_exchanges", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_listings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing> #list_listings(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing>

Lists all listings in a given project and location.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest.new

# Call the list_listings method.
result = client.list_listings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
  p item
end

Overloads:

  • #list_listings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing>

    Pass arguments to list_listings via a request object, either of type ListListingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_listings(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing>

    Pass arguments to list_listings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource path of the listing. e.g. projects/myproject/locations/US/dataExchanges/123.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.

    • page_token (::String) (defaults to: nil)

      Page token, returned by a previous call, to request the next page of results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 743

def list_listings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_listings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_listings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_listings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.list_listings request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_listings, "listings", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_org_data_exchanges(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange> #list_org_data_exchanges(organization: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

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

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest.new

# Call the list_org_data_exchanges method.
result = client.list_org_data_exchanges request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
  p item
end

Overloads:

  • #list_org_data_exchanges(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

    Pass arguments to list_org_data_exchanges via a request object, either of type ListOrgDataExchangesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_org_data_exchanges(organization: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange>

    Pass arguments to list_org_data_exchanges via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • organization (::String) (defaults to: nil)

      Required. The organization resource path of the projects containing DataExchanges. e.g. organizations/myorg/locations/US.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response page. Leverage the page tokens to iterate through the entire collection.

    • page_token (::String) (defaults to: nil)

      Page token, returned by a previous call, to request the next page of results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 326

def list_org_data_exchanges request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_org_data_exchanges..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_org_data_exchanges.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_org_data_exchanges.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.list_org_data_exchanges request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_org_data_exchanges, "data_exchanges", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_shared_resource_subscriptions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription> #list_shared_resource_subscriptions(resource: nil, include_deleted_subscriptions: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

Lists all subscriptions on a given Data Exchange or Listing.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest.new

# Call the list_shared_resource_subscriptions method.
result = client.list_shared_resource_subscriptions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
  p item
end

Overloads:

  • #list_shared_resource_subscriptions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

    Pass arguments to list_shared_resource_subscriptions via a request object, either of type ListSharedResourceSubscriptionsRequest or an equivalent Hash.

    Parameters:

  • #list_shared_resource_subscriptions(resource: nil, include_deleted_subscriptions: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

    Pass arguments to list_shared_resource_subscriptions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      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

    • include_deleted_subscriptions (::Boolean) (defaults to: nil)

      If selected, includes deleted subscriptions in the response (up to 63 days after deletion).

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response page.

    • page_token (::String) (defaults to: nil)

      Page token, returned by a previous call.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1603

def list_shared_resource_subscriptions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSharedResourceSubscriptionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_shared_resource_subscriptions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_shared_resource_subscriptions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_shared_resource_subscriptions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.list_shared_resource_subscriptions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_shared_resource_subscriptions, "shared_resource_subscriptions", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_subscriptions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription> #list_subscriptions(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

Lists all subscriptions in a given project and location.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest.new

# Call the list_subscriptions method.
result = client.list_subscriptions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription.
  p item
end

Overloads:

  • #list_subscriptions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

    Pass arguments to list_subscriptions via a request object, either of type ListSubscriptionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_subscriptions(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::Subscription>

    Pass arguments to list_subscriptions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource path of the subscription. e.g. projects/myproject/locations/US

    • filter (::String) (defaults to: nil)

      The filter expression may be used to filter by Data Exchange or Listing.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response page.

    • page_token (::String) (defaults to: nil)

      Page token, returned by a previous call.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1510

def list_subscriptions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListSubscriptionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_subscriptions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_subscriptions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_subscriptions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.list_subscriptions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_subscriptions, "subscriptions", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#refresh_subscription(request, options = nil) ⇒ ::Gapic::Operation #refresh_subscription(name: nil) ⇒ ::Gapic::Operation

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.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest.new

# Call the refresh_subscription method.
result = client.refresh_subscription request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #refresh_subscription(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to refresh_subscription via a request object, either of type RefreshSubscriptionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #refresh_subscription(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to refresh_subscription via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the Subscription to refresh. e.g. projects/subscriberproject/locations/US/subscriptions/123

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1341

def refresh_subscription request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::RefreshSubscriptionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.refresh_subscription..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.refresh_subscription.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.refresh_subscription.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.refresh_subscription request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#revoke_subscription(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse #revoke_subscription(name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse

Revokes a given subscription.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest.new

# Call the revoke_subscription method.
result = client.revoke_subscription request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1683

def revoke_subscription request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::RevokeSubscriptionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.revoke_subscription..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.revoke_subscription.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.revoke_subscription.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.revoke_subscription request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

Sets the IAM policy.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

      REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1942

def set_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.set_iam_policy request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#subscribe_data_exchange(request, options = nil) ⇒ ::Gapic::Operation #subscribe_data_exchange(name: nil, destination: nil, subscription: nil, subscriber_contact: nil) ⇒ ::Gapic::Operation

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

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest.new

# Call the subscribe_data_exchange method.
result = client.subscribe_data_exchange request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #subscribe_data_exchange(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to subscribe_data_exchange via a request object, either of type SubscribeDataExchangeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #subscribe_data_exchange(name: nil, destination: nil, subscription: nil, subscriber_contact: nil) ⇒ ::Gapic::Operation

    Pass arguments to subscribe_data_exchange via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Resource name of the Data Exchange. e.g. projects/publisherproject/locations/US/dataExchanges/123

    • destination (::String) (defaults to: nil)

      Required. The parent resource path of the Subscription. e.g. projects/subscriberproject/locations/US

    • subscription (::String) (defaults to: nil)

      Required. Name of the subscription to create. e.g. subscription1

    • subscriber_contact (::String) (defaults to: nil)

      Email of the subscriber.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1252

def subscribe_data_exchange request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeDataExchangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.subscribe_data_exchange..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.subscribe_data_exchange.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.subscribe_data_exchange.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.subscribe_data_exchange request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#subscribe_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse #subscribe_listing(destination_dataset: nil, name: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::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.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest.new

# Call the subscribe_listing method.
result = client.subscribe_listing request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 1157

def subscribe_listing request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.subscribe_listing..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.subscribe_listing.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.subscribe_listing.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.subscribe_listing request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

Returns the permissions that a caller has.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

    • permissions (::Array<::String>) (defaults to: nil)

      The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 2026

def test_iam_permissions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.test_iam_permissions request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


114
115
116
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 114

def universe_domain
  @analytics_hub_service_stub.universe_domain
end

#update_data_exchange(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange #update_data_exchange(update_mask: nil, data_exchange: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange

Updates an existing data exchange.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest.new

# Call the update_data_exchange method.
result = client.update_data_exchange request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 575

def update_data_exchange request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_data_exchange..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_data_exchange.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_data_exchange.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.update_data_exchange request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_listing(request, options = nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing #update_listing(update_mask: nil, listing: nil) ⇒ ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing

Updates an existing listing.

Examples:

Basic example

require "google/cloud/bigquery/analytics_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest.new

# Call the update_listing method.
result = client.update_listing request

# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/google/cloud/bigquery/analytics_hub/v1/analytics_hub_service/rest/client.rb', line 992

def update_listing request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_listing..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_listing.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_listing.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @analytics_hub_service_stub.update_listing request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end