google-cloud-bigquery-analytics_hub-v1 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2118,6 +2118,585 @@ module Google
2118
2118
  raise ::Google::Cloud::Error.from_error(e)
2119
2119
  end
2120
2120
 
2121
+ ##
2122
+ # Creates a new QueryTemplate
2123
+ #
2124
+ # @overload create_query_template(request, options = nil)
2125
+ # Pass arguments to `create_query_template` via a request object, either of type
2126
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest} or an equivalent Hash.
2127
+ #
2128
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest, ::Hash]
2129
+ # A request object representing the call parameters. Required. To specify no
2130
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2131
+ # @param options [::Gapic::CallOptions, ::Hash]
2132
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2133
+ #
2134
+ # @overload create_query_template(parent: nil, query_template_id: nil, query_template: nil)
2135
+ # Pass arguments to `create_query_template` via keyword arguments. Note that at
2136
+ # least one keyword argument is required. To specify no parameters, or to keep all
2137
+ # the default parameter values, pass an empty Hash as a request object (see above).
2138
+ #
2139
+ # @param parent [::String]
2140
+ # Required. The parent resource path of the QueryTemplate.
2141
+ # e.g.
2142
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
2143
+ # @param query_template_id [::String]
2144
+ # Required. The ID of the QueryTemplate to create.
2145
+ # Must contain only Unicode letters, numbers (0-9), underscores (_).
2146
+ # Max length: 100 bytes.
2147
+ # @param query_template [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate, ::Hash]
2148
+ # Required. The QueryTemplate to create.
2149
+ # @yield [result, operation] Access the result along with the TransportOperation object
2150
+ # @yieldparam result [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2151
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2152
+ #
2153
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2154
+ #
2155
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2156
+ #
2157
+ # @example Basic example
2158
+ # require "google/cloud/bigquery/analytics_hub/v1"
2159
+ #
2160
+ # # Create a client object. The client can be reused for multiple calls.
2161
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2162
+ #
2163
+ # # Create a request. To set request fields, pass in keyword arguments.
2164
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest.new
2165
+ #
2166
+ # # Call the create_query_template method.
2167
+ # result = client.create_query_template request
2168
+ #
2169
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2170
+ # p result
2171
+ #
2172
+ def create_query_template request, options = nil
2173
+ raise ::ArgumentError, "request must be provided" if request.nil?
2174
+
2175
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest
2176
+
2177
+ # Converts hash and nil to an options object
2178
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2179
+
2180
+ # Customize the options with defaults
2181
+ call_metadata = @config.rpcs.create_query_template.metadata.to_h
2182
+
2183
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2184
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2185
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2186
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2187
+ transports_version_send: [:rest]
2188
+
2189
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2190
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2191
+
2192
+ options.apply_defaults timeout: @config.rpcs.create_query_template.timeout,
2193
+ metadata: call_metadata,
2194
+ retry_policy: @config.rpcs.create_query_template.retry_policy
2195
+
2196
+ options.apply_defaults timeout: @config.timeout,
2197
+ metadata: @config.metadata,
2198
+ retry_policy: @config.retry_policy
2199
+
2200
+ @analytics_hub_service_stub.create_query_template request, options do |result, operation|
2201
+ yield result, operation if block_given?
2202
+ end
2203
+ rescue ::Gapic::Rest::Error => e
2204
+ raise ::Google::Cloud::Error.from_error(e)
2205
+ end
2206
+
2207
+ ##
2208
+ # Gets a QueryTemplate
2209
+ #
2210
+ # @overload get_query_template(request, options = nil)
2211
+ # Pass arguments to `get_query_template` via a request object, either of type
2212
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest} or an equivalent Hash.
2213
+ #
2214
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest, ::Hash]
2215
+ # A request object representing the call parameters. Required. To specify no
2216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2217
+ # @param options [::Gapic::CallOptions, ::Hash]
2218
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2219
+ #
2220
+ # @overload get_query_template(name: nil)
2221
+ # Pass arguments to `get_query_template` via keyword arguments. Note that at
2222
+ # least one keyword argument is required. To specify no parameters, or to keep all
2223
+ # the default parameter values, pass an empty Hash as a request object (see above).
2224
+ #
2225
+ # @param name [::String]
2226
+ # Required. The parent resource path of the QueryTemplate.
2227
+ # e.g.
2228
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2229
+ # @yield [result, operation] Access the result along with the TransportOperation object
2230
+ # @yieldparam result [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2231
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2232
+ #
2233
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2234
+ #
2235
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2236
+ #
2237
+ # @example Basic example
2238
+ # require "google/cloud/bigquery/analytics_hub/v1"
2239
+ #
2240
+ # # Create a client object. The client can be reused for multiple calls.
2241
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2242
+ #
2243
+ # # Create a request. To set request fields, pass in keyword arguments.
2244
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest.new
2245
+ #
2246
+ # # Call the get_query_template method.
2247
+ # result = client.get_query_template request
2248
+ #
2249
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2250
+ # p result
2251
+ #
2252
+ def get_query_template request, options = nil
2253
+ raise ::ArgumentError, "request must be provided" if request.nil?
2254
+
2255
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest
2256
+
2257
+ # Converts hash and nil to an options object
2258
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2259
+
2260
+ # Customize the options with defaults
2261
+ call_metadata = @config.rpcs.get_query_template.metadata.to_h
2262
+
2263
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2264
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2265
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2266
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2267
+ transports_version_send: [:rest]
2268
+
2269
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2270
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2271
+
2272
+ options.apply_defaults timeout: @config.rpcs.get_query_template.timeout,
2273
+ metadata: call_metadata,
2274
+ retry_policy: @config.rpcs.get_query_template.retry_policy
2275
+
2276
+ options.apply_defaults timeout: @config.timeout,
2277
+ metadata: @config.metadata,
2278
+ retry_policy: @config.retry_policy
2279
+
2280
+ @analytics_hub_service_stub.get_query_template request, options do |result, operation|
2281
+ yield result, operation if block_given?
2282
+ end
2283
+ rescue ::Gapic::Rest::Error => e
2284
+ raise ::Google::Cloud::Error.from_error(e)
2285
+ end
2286
+
2287
+ ##
2288
+ # Lists all QueryTemplates in a given project and location.
2289
+ #
2290
+ # @overload list_query_templates(request, options = nil)
2291
+ # Pass arguments to `list_query_templates` via a request object, either of type
2292
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest} or an equivalent Hash.
2293
+ #
2294
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest, ::Hash]
2295
+ # A request object representing the call parameters. Required. To specify no
2296
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2297
+ # @param options [::Gapic::CallOptions, ::Hash]
2298
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2299
+ #
2300
+ # @overload list_query_templates(parent: nil, page_size: nil, page_token: nil)
2301
+ # Pass arguments to `list_query_templates` via keyword arguments. Note that at
2302
+ # least one keyword argument is required. To specify no parameters, or to keep all
2303
+ # the default parameter values, pass an empty Hash as a request object (see above).
2304
+ #
2305
+ # @param parent [::String]
2306
+ # Required. The parent resource path of the QueryTemplates.
2307
+ # e.g. `projects/myproject/locations/us/dataExchanges/123`.
2308
+ # @param page_size [::Integer]
2309
+ # Optional. The maximum number of results to return in a single response
2310
+ # page. Leverage the page tokens to iterate through the entire collection.
2311
+ # @param page_token [::String]
2312
+ # Optional. Page token, returned by a previous call, to request the next page
2313
+ # of results.
2314
+ # @yield [result, operation] Access the result along with the TransportOperation object
2315
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate>]
2316
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2317
+ #
2318
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate>]
2319
+ #
2320
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2321
+ #
2322
+ # @example Basic example
2323
+ # require "google/cloud/bigquery/analytics_hub/v1"
2324
+ #
2325
+ # # Create a client object. The client can be reused for multiple calls.
2326
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2327
+ #
2328
+ # # Create a request. To set request fields, pass in keyword arguments.
2329
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest.new
2330
+ #
2331
+ # # Call the list_query_templates method.
2332
+ # result = client.list_query_templates request
2333
+ #
2334
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2335
+ # # over elements, and API calls will be issued to fetch pages as needed.
2336
+ # result.each do |item|
2337
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2338
+ # p item
2339
+ # end
2340
+ #
2341
+ def list_query_templates request, options = nil
2342
+ raise ::ArgumentError, "request must be provided" if request.nil?
2343
+
2344
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest
2345
+
2346
+ # Converts hash and nil to an options object
2347
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2348
+
2349
+ # Customize the options with defaults
2350
+ call_metadata = @config.rpcs.list_query_templates.metadata.to_h
2351
+
2352
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2353
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2354
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2355
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2356
+ transports_version_send: [:rest]
2357
+
2358
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2360
+
2361
+ options.apply_defaults timeout: @config.rpcs.list_query_templates.timeout,
2362
+ metadata: call_metadata,
2363
+ retry_policy: @config.rpcs.list_query_templates.retry_policy
2364
+
2365
+ options.apply_defaults timeout: @config.timeout,
2366
+ metadata: @config.metadata,
2367
+ retry_policy: @config.retry_policy
2368
+
2369
+ @analytics_hub_service_stub.list_query_templates request, options do |result, operation|
2370
+ result = ::Gapic::Rest::PagedEnumerable.new @analytics_hub_service_stub, :list_query_templates, "query_templates", request, result, options
2371
+ yield result, operation if block_given?
2372
+ throw :response, result
2373
+ end
2374
+ rescue ::Gapic::Rest::Error => e
2375
+ raise ::Google::Cloud::Error.from_error(e)
2376
+ end
2377
+
2378
+ ##
2379
+ # Updates an existing QueryTemplate
2380
+ #
2381
+ # @overload update_query_template(request, options = nil)
2382
+ # Pass arguments to `update_query_template` via a request object, either of type
2383
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest} or an equivalent Hash.
2384
+ #
2385
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest, ::Hash]
2386
+ # A request object representing the call parameters. Required. To specify no
2387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2388
+ # @param options [::Gapic::CallOptions, ::Hash]
2389
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2390
+ #
2391
+ # @overload update_query_template(update_mask: nil, query_template: nil)
2392
+ # Pass arguments to `update_query_template` via keyword arguments. Note that at
2393
+ # least one keyword argument is required. To specify no parameters, or to keep all
2394
+ # the default parameter values, pass an empty Hash as a request object (see above).
2395
+ #
2396
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2397
+ # Optional. Field mask specifies the fields to update in the query template
2398
+ # resource. The fields specified in the `updateMask` are relative to the
2399
+ # resource and are not a full request.
2400
+ # @param query_template [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate, ::Hash]
2401
+ # Required. The QueryTemplate to update.
2402
+ # @yield [result, operation] Access the result along with the TransportOperation object
2403
+ # @yieldparam result [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2404
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2405
+ #
2406
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2407
+ #
2408
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2409
+ #
2410
+ # @example Basic example
2411
+ # require "google/cloud/bigquery/analytics_hub/v1"
2412
+ #
2413
+ # # Create a client object. The client can be reused for multiple calls.
2414
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2415
+ #
2416
+ # # Create a request. To set request fields, pass in keyword arguments.
2417
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest.new
2418
+ #
2419
+ # # Call the update_query_template method.
2420
+ # result = client.update_query_template request
2421
+ #
2422
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2423
+ # p result
2424
+ #
2425
+ def update_query_template request, options = nil
2426
+ raise ::ArgumentError, "request must be provided" if request.nil?
2427
+
2428
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest
2429
+
2430
+ # Converts hash and nil to an options object
2431
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2432
+
2433
+ # Customize the options with defaults
2434
+ call_metadata = @config.rpcs.update_query_template.metadata.to_h
2435
+
2436
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2437
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2438
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2439
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2440
+ transports_version_send: [:rest]
2441
+
2442
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2443
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2444
+
2445
+ options.apply_defaults timeout: @config.rpcs.update_query_template.timeout,
2446
+ metadata: call_metadata,
2447
+ retry_policy: @config.rpcs.update_query_template.retry_policy
2448
+
2449
+ options.apply_defaults timeout: @config.timeout,
2450
+ metadata: @config.metadata,
2451
+ retry_policy: @config.retry_policy
2452
+
2453
+ @analytics_hub_service_stub.update_query_template request, options do |result, operation|
2454
+ yield result, operation if block_given?
2455
+ end
2456
+ rescue ::Gapic::Rest::Error => e
2457
+ raise ::Google::Cloud::Error.from_error(e)
2458
+ end
2459
+
2460
+ ##
2461
+ # Deletes a query template.
2462
+ #
2463
+ # @overload delete_query_template(request, options = nil)
2464
+ # Pass arguments to `delete_query_template` via a request object, either of type
2465
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest} or an equivalent Hash.
2466
+ #
2467
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest, ::Hash]
2468
+ # A request object representing the call parameters. Required. To specify no
2469
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2470
+ # @param options [::Gapic::CallOptions, ::Hash]
2471
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2472
+ #
2473
+ # @overload delete_query_template(name: nil)
2474
+ # Pass arguments to `delete_query_template` via keyword arguments. Note that at
2475
+ # least one keyword argument is required. To specify no parameters, or to keep all
2476
+ # the default parameter values, pass an empty Hash as a request object (see above).
2477
+ #
2478
+ # @param name [::String]
2479
+ # Required. The resource path of the QueryTemplate.
2480
+ # e.g.
2481
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2482
+ # @yield [result, operation] Access the result along with the TransportOperation object
2483
+ # @yieldparam result [::Google::Protobuf::Empty]
2484
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2485
+ #
2486
+ # @return [::Google::Protobuf::Empty]
2487
+ #
2488
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2489
+ #
2490
+ # @example Basic example
2491
+ # require "google/cloud/bigquery/analytics_hub/v1"
2492
+ #
2493
+ # # Create a client object. The client can be reused for multiple calls.
2494
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2495
+ #
2496
+ # # Create a request. To set request fields, pass in keyword arguments.
2497
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest.new
2498
+ #
2499
+ # # Call the delete_query_template method.
2500
+ # result = client.delete_query_template request
2501
+ #
2502
+ # # The returned object is of type Google::Protobuf::Empty.
2503
+ # p result
2504
+ #
2505
+ def delete_query_template request, options = nil
2506
+ raise ::ArgumentError, "request must be provided" if request.nil?
2507
+
2508
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest
2509
+
2510
+ # Converts hash and nil to an options object
2511
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2512
+
2513
+ # Customize the options with defaults
2514
+ call_metadata = @config.rpcs.delete_query_template.metadata.to_h
2515
+
2516
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2517
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2518
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2519
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2520
+ transports_version_send: [:rest]
2521
+
2522
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2523
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2524
+
2525
+ options.apply_defaults timeout: @config.rpcs.delete_query_template.timeout,
2526
+ metadata: call_metadata,
2527
+ retry_policy: @config.rpcs.delete_query_template.retry_policy
2528
+
2529
+ options.apply_defaults timeout: @config.timeout,
2530
+ metadata: @config.metadata,
2531
+ retry_policy: @config.retry_policy
2532
+
2533
+ @analytics_hub_service_stub.delete_query_template request, options do |result, operation|
2534
+ yield result, operation if block_given?
2535
+ end
2536
+ rescue ::Gapic::Rest::Error => e
2537
+ raise ::Google::Cloud::Error.from_error(e)
2538
+ end
2539
+
2540
+ ##
2541
+ # Submits a query template for approval.
2542
+ #
2543
+ # @overload submit_query_template(request, options = nil)
2544
+ # Pass arguments to `submit_query_template` via a request object, either of type
2545
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest} or an equivalent Hash.
2546
+ #
2547
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest, ::Hash]
2548
+ # A request object representing the call parameters. Required. To specify no
2549
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2550
+ # @param options [::Gapic::CallOptions, ::Hash]
2551
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2552
+ #
2553
+ # @overload submit_query_template(name: nil)
2554
+ # Pass arguments to `submit_query_template` via keyword arguments. Note that at
2555
+ # least one keyword argument is required. To specify no parameters, or to keep all
2556
+ # the default parameter values, pass an empty Hash as a request object (see above).
2557
+ #
2558
+ # @param name [::String]
2559
+ # Required. The resource path of the QueryTemplate.
2560
+ # e.g.
2561
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2562
+ # @yield [result, operation] Access the result along with the TransportOperation object
2563
+ # @yieldparam result [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2564
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2565
+ #
2566
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2567
+ #
2568
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2569
+ #
2570
+ # @example Basic example
2571
+ # require "google/cloud/bigquery/analytics_hub/v1"
2572
+ #
2573
+ # # Create a client object. The client can be reused for multiple calls.
2574
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2575
+ #
2576
+ # # Create a request. To set request fields, pass in keyword arguments.
2577
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest.new
2578
+ #
2579
+ # # Call the submit_query_template method.
2580
+ # result = client.submit_query_template request
2581
+ #
2582
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2583
+ # p result
2584
+ #
2585
+ def submit_query_template request, options = nil
2586
+ raise ::ArgumentError, "request must be provided" if request.nil?
2587
+
2588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest
2589
+
2590
+ # Converts hash and nil to an options object
2591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2592
+
2593
+ # Customize the options with defaults
2594
+ call_metadata = @config.rpcs.submit_query_template.metadata.to_h
2595
+
2596
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2597
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2599
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2600
+ transports_version_send: [:rest]
2601
+
2602
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2603
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2604
+
2605
+ options.apply_defaults timeout: @config.rpcs.submit_query_template.timeout,
2606
+ metadata: call_metadata,
2607
+ retry_policy: @config.rpcs.submit_query_template.retry_policy
2608
+
2609
+ options.apply_defaults timeout: @config.timeout,
2610
+ metadata: @config.metadata,
2611
+ retry_policy: @config.retry_policy
2612
+
2613
+ @analytics_hub_service_stub.submit_query_template request, options do |result, operation|
2614
+ yield result, operation if block_given?
2615
+ end
2616
+ rescue ::Gapic::Rest::Error => e
2617
+ raise ::Google::Cloud::Error.from_error(e)
2618
+ end
2619
+
2620
+ ##
2621
+ # Approves a query template.
2622
+ #
2623
+ # @overload approve_query_template(request, options = nil)
2624
+ # Pass arguments to `approve_query_template` via a request object, either of type
2625
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest} or an equivalent Hash.
2626
+ #
2627
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest, ::Hash]
2628
+ # A request object representing the call parameters. Required. To specify no
2629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2630
+ # @param options [::Gapic::CallOptions, ::Hash]
2631
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2632
+ #
2633
+ # @overload approve_query_template(name: nil)
2634
+ # Pass arguments to `approve_query_template` via keyword arguments. Note that at
2635
+ # least one keyword argument is required. To specify no parameters, or to keep all
2636
+ # the default parameter values, pass an empty Hash as a request object (see above).
2637
+ #
2638
+ # @param name [::String]
2639
+ # Required. The resource path of the QueryTemplate.
2640
+ # e.g.
2641
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2642
+ # @yield [result, operation] Access the result along with the TransportOperation object
2643
+ # @yieldparam result [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2644
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2645
+ #
2646
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2647
+ #
2648
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2649
+ #
2650
+ # @example Basic example
2651
+ # require "google/cloud/bigquery/analytics_hub/v1"
2652
+ #
2653
+ # # Create a client object. The client can be reused for multiple calls.
2654
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Rest::Client.new
2655
+ #
2656
+ # # Create a request. To set request fields, pass in keyword arguments.
2657
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest.new
2658
+ #
2659
+ # # Call the approve_query_template method.
2660
+ # result = client.approve_query_template request
2661
+ #
2662
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2663
+ # p result
2664
+ #
2665
+ def approve_query_template request, options = nil
2666
+ raise ::ArgumentError, "request must be provided" if request.nil?
2667
+
2668
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest
2669
+
2670
+ # Converts hash and nil to an options object
2671
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2672
+
2673
+ # Customize the options with defaults
2674
+ call_metadata = @config.rpcs.approve_query_template.metadata.to_h
2675
+
2676
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2677
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2678
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2679
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION,
2680
+ transports_version_send: [:rest]
2681
+
2682
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2683
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2684
+
2685
+ options.apply_defaults timeout: @config.rpcs.approve_query_template.timeout,
2686
+ metadata: call_metadata,
2687
+ retry_policy: @config.rpcs.approve_query_template.retry_policy
2688
+
2689
+ options.apply_defaults timeout: @config.timeout,
2690
+ metadata: @config.metadata,
2691
+ retry_policy: @config.retry_policy
2692
+
2693
+ @analytics_hub_service_stub.approve_query_template request, options do |result, operation|
2694
+ yield result, operation if block_given?
2695
+ end
2696
+ rescue ::Gapic::Rest::Error => e
2697
+ raise ::Google::Cloud::Error.from_error(e)
2698
+ end
2699
+
2121
2700
  ##
2122
2701
  # Configuration class for the AnalyticsHubService REST API.
2123
2702
  #
@@ -2374,6 +2953,41 @@ module Google
2374
2953
  # @return [::Gapic::Config::Method]
2375
2954
  #
2376
2955
  attr_reader :test_iam_permissions
2956
+ ##
2957
+ # RPC-specific configuration for `create_query_template`
2958
+ # @return [::Gapic::Config::Method]
2959
+ #
2960
+ attr_reader :create_query_template
2961
+ ##
2962
+ # RPC-specific configuration for `get_query_template`
2963
+ # @return [::Gapic::Config::Method]
2964
+ #
2965
+ attr_reader :get_query_template
2966
+ ##
2967
+ # RPC-specific configuration for `list_query_templates`
2968
+ # @return [::Gapic::Config::Method]
2969
+ #
2970
+ attr_reader :list_query_templates
2971
+ ##
2972
+ # RPC-specific configuration for `update_query_template`
2973
+ # @return [::Gapic::Config::Method]
2974
+ #
2975
+ attr_reader :update_query_template
2976
+ ##
2977
+ # RPC-specific configuration for `delete_query_template`
2978
+ # @return [::Gapic::Config::Method]
2979
+ #
2980
+ attr_reader :delete_query_template
2981
+ ##
2982
+ # RPC-specific configuration for `submit_query_template`
2983
+ # @return [::Gapic::Config::Method]
2984
+ #
2985
+ attr_reader :submit_query_template
2986
+ ##
2987
+ # RPC-specific configuration for `approve_query_template`
2988
+ # @return [::Gapic::Config::Method]
2989
+ #
2990
+ attr_reader :approve_query_template
2377
2991
 
2378
2992
  # @private
2379
2993
  def initialize parent_rpcs = nil
@@ -2421,6 +3035,20 @@ module Google
2421
3035
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
2422
3036
  test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2423
3037
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
3038
+ create_query_template_config = parent_rpcs.create_query_template if parent_rpcs.respond_to? :create_query_template
3039
+ @create_query_template = ::Gapic::Config::Method.new create_query_template_config
3040
+ get_query_template_config = parent_rpcs.get_query_template if parent_rpcs.respond_to? :get_query_template
3041
+ @get_query_template = ::Gapic::Config::Method.new get_query_template_config
3042
+ list_query_templates_config = parent_rpcs.list_query_templates if parent_rpcs.respond_to? :list_query_templates
3043
+ @list_query_templates = ::Gapic::Config::Method.new list_query_templates_config
3044
+ update_query_template_config = parent_rpcs.update_query_template if parent_rpcs.respond_to? :update_query_template
3045
+ @update_query_template = ::Gapic::Config::Method.new update_query_template_config
3046
+ delete_query_template_config = parent_rpcs.delete_query_template if parent_rpcs.respond_to? :delete_query_template
3047
+ @delete_query_template = ::Gapic::Config::Method.new delete_query_template_config
3048
+ submit_query_template_config = parent_rpcs.submit_query_template if parent_rpcs.respond_to? :submit_query_template
3049
+ @submit_query_template = ::Gapic::Config::Method.new submit_query_template_config
3050
+ approve_query_template_config = parent_rpcs.approve_query_template if parent_rpcs.respond_to? :approve_query_template
3051
+ @approve_query_template = ::Gapic::Config::Method.new approve_query_template_config
2424
3052
 
2425
3053
  yield self if block_given?
2426
3054
  end