google-cloud-bigquery-analytics_hub-v1 0.13.0 → 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.
@@ -1239,12 +1239,12 @@ module Google
1239
1239
  # @param destination_dataset [::Google::Cloud::Bigquery::AnalyticsHub::V1::DestinationDataset, ::Hash]
1240
1240
  # Input only. BigQuery destination dataset to create for the subscriber.
1241
1241
  #
1242
- # Note: The following fields are mutually exclusive: `destination_dataset`, `destination_pubsub_subscription`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1242
+ # Note: The following parameters are mutually exclusive: `destination_dataset`, `destination_pubsub_subscription`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
1243
1243
  # @param destination_pubsub_subscription [::Google::Cloud::Bigquery::AnalyticsHub::V1::DestinationPubSubSubscription, ::Hash]
1244
1244
  # Input only. Destination Pub/Sub subscription to create for the
1245
1245
  # subscriber.
1246
1246
  #
1247
- # Note: The following fields are mutually exclusive: `destination_pubsub_subscription`, `destination_dataset`. If a field in that set is populated, all other fields in the set will automatically be cleared.
1247
+ # Note: The following parameters are mutually exclusive: `destination_pubsub_subscription`, `destination_dataset`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
1248
1248
  # @param name [::String]
1249
1249
  # Required. Resource name of the listing that you want to subscribe to.
1250
1250
  # e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
@@ -2279,6 +2279,634 @@ module Google
2279
2279
  raise ::Google::Cloud::Error.from_error(e)
2280
2280
  end
2281
2281
 
2282
+ ##
2283
+ # Creates a new QueryTemplate
2284
+ #
2285
+ # @overload create_query_template(request, options = nil)
2286
+ # Pass arguments to `create_query_template` via a request object, either of type
2287
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest} or an equivalent Hash.
2288
+ #
2289
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest, ::Hash]
2290
+ # A request object representing the call parameters. Required. To specify no
2291
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2292
+ # @param options [::Gapic::CallOptions, ::Hash]
2293
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2294
+ #
2295
+ # @overload create_query_template(parent: nil, query_template_id: nil, query_template: nil)
2296
+ # Pass arguments to `create_query_template` via keyword arguments. Note that at
2297
+ # least one keyword argument is required. To specify no parameters, or to keep all
2298
+ # the default parameter values, pass an empty Hash as a request object (see above).
2299
+ #
2300
+ # @param parent [::String]
2301
+ # Required. The parent resource path of the QueryTemplate.
2302
+ # e.g.
2303
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
2304
+ # @param query_template_id [::String]
2305
+ # Required. The ID of the QueryTemplate to create.
2306
+ # Must contain only Unicode letters, numbers (0-9), underscores (_).
2307
+ # Max length: 100 bytes.
2308
+ # @param query_template [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate, ::Hash]
2309
+ # Required. The QueryTemplate to create.
2310
+ #
2311
+ # @yield [response, operation] Access the result along with the RPC operation
2312
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2313
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2314
+ #
2315
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2316
+ #
2317
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2318
+ #
2319
+ # @example Basic example
2320
+ # require "google/cloud/bigquery/analytics_hub/v1"
2321
+ #
2322
+ # # Create a client object. The client can be reused for multiple calls.
2323
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2324
+ #
2325
+ # # Create a request. To set request fields, pass in keyword arguments.
2326
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest.new
2327
+ #
2328
+ # # Call the create_query_template method.
2329
+ # result = client.create_query_template request
2330
+ #
2331
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2332
+ # p result
2333
+ #
2334
+ def create_query_template request, options = nil
2335
+ raise ::ArgumentError, "request must be provided" if request.nil?
2336
+
2337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::CreateQueryTemplateRequest
2338
+
2339
+ # Converts hash and nil to an options object
2340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2341
+
2342
+ # Customize the options with defaults
2343
+ metadata = @config.rpcs.create_query_template.metadata.to_h
2344
+
2345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2346
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2348
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2349
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2350
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2351
+
2352
+ header_params = {}
2353
+ if request.parent
2354
+ header_params["parent"] = request.parent
2355
+ end
2356
+
2357
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2358
+ metadata[:"x-goog-request-params"] ||= request_params_header
2359
+
2360
+ options.apply_defaults timeout: @config.rpcs.create_query_template.timeout,
2361
+ metadata: metadata,
2362
+ retry_policy: @config.rpcs.create_query_template.retry_policy
2363
+
2364
+ options.apply_defaults timeout: @config.timeout,
2365
+ metadata: @config.metadata,
2366
+ retry_policy: @config.retry_policy
2367
+
2368
+ @analytics_hub_service_stub.call_rpc :create_query_template, request, options: options do |response, operation|
2369
+ yield response, operation if block_given?
2370
+ end
2371
+ rescue ::GRPC::BadStatus => e
2372
+ raise ::Google::Cloud::Error.from_error(e)
2373
+ end
2374
+
2375
+ ##
2376
+ # Gets a QueryTemplate
2377
+ #
2378
+ # @overload get_query_template(request, options = nil)
2379
+ # Pass arguments to `get_query_template` via a request object, either of type
2380
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest} or an equivalent Hash.
2381
+ #
2382
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest, ::Hash]
2383
+ # A request object representing the call parameters. Required. To specify no
2384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2385
+ # @param options [::Gapic::CallOptions, ::Hash]
2386
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2387
+ #
2388
+ # @overload get_query_template(name: nil)
2389
+ # Pass arguments to `get_query_template` via keyword arguments. Note that at
2390
+ # least one keyword argument is required. To specify no parameters, or to keep all
2391
+ # the default parameter values, pass an empty Hash as a request object (see above).
2392
+ #
2393
+ # @param name [::String]
2394
+ # Required. The parent resource path of the QueryTemplate.
2395
+ # e.g.
2396
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2397
+ #
2398
+ # @yield [response, operation] Access the result along with the RPC operation
2399
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2400
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2401
+ #
2402
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2403
+ #
2404
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2405
+ #
2406
+ # @example Basic example
2407
+ # require "google/cloud/bigquery/analytics_hub/v1"
2408
+ #
2409
+ # # Create a client object. The client can be reused for multiple calls.
2410
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2411
+ #
2412
+ # # Create a request. To set request fields, pass in keyword arguments.
2413
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest.new
2414
+ #
2415
+ # # Call the get_query_template method.
2416
+ # result = client.get_query_template request
2417
+ #
2418
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2419
+ # p result
2420
+ #
2421
+ def get_query_template request, options = nil
2422
+ raise ::ArgumentError, "request must be provided" if request.nil?
2423
+
2424
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::GetQueryTemplateRequest
2425
+
2426
+ # Converts hash and nil to an options object
2427
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2428
+
2429
+ # Customize the options with defaults
2430
+ metadata = @config.rpcs.get_query_template.metadata.to_h
2431
+
2432
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2433
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2434
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2435
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2436
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2437
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2438
+
2439
+ header_params = {}
2440
+ if request.name
2441
+ header_params["name"] = request.name
2442
+ end
2443
+
2444
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2445
+ metadata[:"x-goog-request-params"] ||= request_params_header
2446
+
2447
+ options.apply_defaults timeout: @config.rpcs.get_query_template.timeout,
2448
+ metadata: metadata,
2449
+ retry_policy: @config.rpcs.get_query_template.retry_policy
2450
+
2451
+ options.apply_defaults timeout: @config.timeout,
2452
+ metadata: @config.metadata,
2453
+ retry_policy: @config.retry_policy
2454
+
2455
+ @analytics_hub_service_stub.call_rpc :get_query_template, request, options: options do |response, operation|
2456
+ yield response, operation if block_given?
2457
+ end
2458
+ rescue ::GRPC::BadStatus => e
2459
+ raise ::Google::Cloud::Error.from_error(e)
2460
+ end
2461
+
2462
+ ##
2463
+ # Lists all QueryTemplates in a given project and location.
2464
+ #
2465
+ # @overload list_query_templates(request, options = nil)
2466
+ # Pass arguments to `list_query_templates` via a request object, either of type
2467
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest} or an equivalent Hash.
2468
+ #
2469
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest, ::Hash]
2470
+ # A request object representing the call parameters. Required. To specify no
2471
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2472
+ # @param options [::Gapic::CallOptions, ::Hash]
2473
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2474
+ #
2475
+ # @overload list_query_templates(parent: nil, page_size: nil, page_token: nil)
2476
+ # Pass arguments to `list_query_templates` via keyword arguments. Note that at
2477
+ # least one keyword argument is required. To specify no parameters, or to keep all
2478
+ # the default parameter values, pass an empty Hash as a request object (see above).
2479
+ #
2480
+ # @param parent [::String]
2481
+ # Required. The parent resource path of the QueryTemplates.
2482
+ # e.g. `projects/myproject/locations/us/dataExchanges/123`.
2483
+ # @param page_size [::Integer]
2484
+ # Optional. The maximum number of results to return in a single response
2485
+ # page. Leverage the page tokens to iterate through the entire collection.
2486
+ # @param page_token [::String]
2487
+ # Optional. Page token, returned by a previous call, to request the next page
2488
+ # of results.
2489
+ #
2490
+ # @yield [response, operation] Access the result along with the RPC operation
2491
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate>]
2492
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2493
+ #
2494
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate>]
2495
+ #
2496
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2497
+ #
2498
+ # @example Basic example
2499
+ # require "google/cloud/bigquery/analytics_hub/v1"
2500
+ #
2501
+ # # Create a client object. The client can be reused for multiple calls.
2502
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2503
+ #
2504
+ # # Create a request. To set request fields, pass in keyword arguments.
2505
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest.new
2506
+ #
2507
+ # # Call the list_query_templates method.
2508
+ # result = client.list_query_templates request
2509
+ #
2510
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2511
+ # # over elements, and API calls will be issued to fetch pages as needed.
2512
+ # result.each do |item|
2513
+ # # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2514
+ # p item
2515
+ # end
2516
+ #
2517
+ def list_query_templates request, options = nil
2518
+ raise ::ArgumentError, "request must be provided" if request.nil?
2519
+
2520
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ListQueryTemplatesRequest
2521
+
2522
+ # Converts hash and nil to an options object
2523
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2524
+
2525
+ # Customize the options with defaults
2526
+ metadata = @config.rpcs.list_query_templates.metadata.to_h
2527
+
2528
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2529
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2530
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2531
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2532
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2533
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2534
+
2535
+ header_params = {}
2536
+ if request.parent
2537
+ header_params["parent"] = request.parent
2538
+ end
2539
+
2540
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2541
+ metadata[:"x-goog-request-params"] ||= request_params_header
2542
+
2543
+ options.apply_defaults timeout: @config.rpcs.list_query_templates.timeout,
2544
+ metadata: metadata,
2545
+ retry_policy: @config.rpcs.list_query_templates.retry_policy
2546
+
2547
+ options.apply_defaults timeout: @config.timeout,
2548
+ metadata: @config.metadata,
2549
+ retry_policy: @config.retry_policy
2550
+
2551
+ @analytics_hub_service_stub.call_rpc :list_query_templates, request, options: options do |response, operation|
2552
+ response = ::Gapic::PagedEnumerable.new @analytics_hub_service_stub, :list_query_templates, request, response, operation, options
2553
+ yield response, operation if block_given?
2554
+ throw :response, response
2555
+ end
2556
+ rescue ::GRPC::BadStatus => e
2557
+ raise ::Google::Cloud::Error.from_error(e)
2558
+ end
2559
+
2560
+ ##
2561
+ # Updates an existing QueryTemplate
2562
+ #
2563
+ # @overload update_query_template(request, options = nil)
2564
+ # Pass arguments to `update_query_template` via a request object, either of type
2565
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest} or an equivalent Hash.
2566
+ #
2567
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest, ::Hash]
2568
+ # A request object representing the call parameters. Required. To specify no
2569
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2570
+ # @param options [::Gapic::CallOptions, ::Hash]
2571
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2572
+ #
2573
+ # @overload update_query_template(update_mask: nil, query_template: nil)
2574
+ # Pass arguments to `update_query_template` via keyword arguments. Note that at
2575
+ # least one keyword argument is required. To specify no parameters, or to keep all
2576
+ # the default parameter values, pass an empty Hash as a request object (see above).
2577
+ #
2578
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2579
+ # Optional. Field mask specifies the fields to update in the query template
2580
+ # resource. The fields specified in the `updateMask` are relative to the
2581
+ # resource and are not a full request.
2582
+ # @param query_template [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate, ::Hash]
2583
+ # Required. The QueryTemplate to update.
2584
+ #
2585
+ # @yield [response, operation] Access the result along with the RPC operation
2586
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2587
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2588
+ #
2589
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2590
+ #
2591
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2592
+ #
2593
+ # @example Basic example
2594
+ # require "google/cloud/bigquery/analytics_hub/v1"
2595
+ #
2596
+ # # Create a client object. The client can be reused for multiple calls.
2597
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2598
+ #
2599
+ # # Create a request. To set request fields, pass in keyword arguments.
2600
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest.new
2601
+ #
2602
+ # # Call the update_query_template method.
2603
+ # result = client.update_query_template request
2604
+ #
2605
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2606
+ # p result
2607
+ #
2608
+ def update_query_template request, options = nil
2609
+ raise ::ArgumentError, "request must be provided" if request.nil?
2610
+
2611
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateQueryTemplateRequest
2612
+
2613
+ # Converts hash and nil to an options object
2614
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2615
+
2616
+ # Customize the options with defaults
2617
+ metadata = @config.rpcs.update_query_template.metadata.to_h
2618
+
2619
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2620
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2621
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2622
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2623
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2624
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2625
+
2626
+ header_params = {}
2627
+ if request.query_template&.name
2628
+ header_params["query_template.name"] = request.query_template.name
2629
+ end
2630
+
2631
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2632
+ metadata[:"x-goog-request-params"] ||= request_params_header
2633
+
2634
+ options.apply_defaults timeout: @config.rpcs.update_query_template.timeout,
2635
+ metadata: metadata,
2636
+ retry_policy: @config.rpcs.update_query_template.retry_policy
2637
+
2638
+ options.apply_defaults timeout: @config.timeout,
2639
+ metadata: @config.metadata,
2640
+ retry_policy: @config.retry_policy
2641
+
2642
+ @analytics_hub_service_stub.call_rpc :update_query_template, request, options: options do |response, operation|
2643
+ yield response, operation if block_given?
2644
+ end
2645
+ rescue ::GRPC::BadStatus => e
2646
+ raise ::Google::Cloud::Error.from_error(e)
2647
+ end
2648
+
2649
+ ##
2650
+ # Deletes a query template.
2651
+ #
2652
+ # @overload delete_query_template(request, options = nil)
2653
+ # Pass arguments to `delete_query_template` via a request object, either of type
2654
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest} or an equivalent Hash.
2655
+ #
2656
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest, ::Hash]
2657
+ # A request object representing the call parameters. Required. To specify no
2658
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2659
+ # @param options [::Gapic::CallOptions, ::Hash]
2660
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2661
+ #
2662
+ # @overload delete_query_template(name: nil)
2663
+ # Pass arguments to `delete_query_template` via keyword arguments. Note that at
2664
+ # least one keyword argument is required. To specify no parameters, or to keep all
2665
+ # the default parameter values, pass an empty Hash as a request object (see above).
2666
+ #
2667
+ # @param name [::String]
2668
+ # Required. The resource path of the QueryTemplate.
2669
+ # e.g.
2670
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2671
+ #
2672
+ # @yield [response, operation] Access the result along with the RPC operation
2673
+ # @yieldparam response [::Google::Protobuf::Empty]
2674
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2675
+ #
2676
+ # @return [::Google::Protobuf::Empty]
2677
+ #
2678
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2679
+ #
2680
+ # @example Basic example
2681
+ # require "google/cloud/bigquery/analytics_hub/v1"
2682
+ #
2683
+ # # Create a client object. The client can be reused for multiple calls.
2684
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2685
+ #
2686
+ # # Create a request. To set request fields, pass in keyword arguments.
2687
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest.new
2688
+ #
2689
+ # # Call the delete_query_template method.
2690
+ # result = client.delete_query_template request
2691
+ #
2692
+ # # The returned object is of type Google::Protobuf::Empty.
2693
+ # p result
2694
+ #
2695
+ def delete_query_template request, options = nil
2696
+ raise ::ArgumentError, "request must be provided" if request.nil?
2697
+
2698
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteQueryTemplateRequest
2699
+
2700
+ # Converts hash and nil to an options object
2701
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2702
+
2703
+ # Customize the options with defaults
2704
+ metadata = @config.rpcs.delete_query_template.metadata.to_h
2705
+
2706
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2707
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2708
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2709
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2710
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2711
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2712
+
2713
+ header_params = {}
2714
+ if request.name
2715
+ header_params["name"] = request.name
2716
+ end
2717
+
2718
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2719
+ metadata[:"x-goog-request-params"] ||= request_params_header
2720
+
2721
+ options.apply_defaults timeout: @config.rpcs.delete_query_template.timeout,
2722
+ metadata: metadata,
2723
+ retry_policy: @config.rpcs.delete_query_template.retry_policy
2724
+
2725
+ options.apply_defaults timeout: @config.timeout,
2726
+ metadata: @config.metadata,
2727
+ retry_policy: @config.retry_policy
2728
+
2729
+ @analytics_hub_service_stub.call_rpc :delete_query_template, request, options: options do |response, operation|
2730
+ yield response, operation if block_given?
2731
+ end
2732
+ rescue ::GRPC::BadStatus => e
2733
+ raise ::Google::Cloud::Error.from_error(e)
2734
+ end
2735
+
2736
+ ##
2737
+ # Submits a query template for approval.
2738
+ #
2739
+ # @overload submit_query_template(request, options = nil)
2740
+ # Pass arguments to `submit_query_template` via a request object, either of type
2741
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest} or an equivalent Hash.
2742
+ #
2743
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest, ::Hash]
2744
+ # A request object representing the call parameters. Required. To specify no
2745
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2746
+ # @param options [::Gapic::CallOptions, ::Hash]
2747
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2748
+ #
2749
+ # @overload submit_query_template(name: nil)
2750
+ # Pass arguments to `submit_query_template` via keyword arguments. Note that at
2751
+ # least one keyword argument is required. To specify no parameters, or to keep all
2752
+ # the default parameter values, pass an empty Hash as a request object (see above).
2753
+ #
2754
+ # @param name [::String]
2755
+ # Required. The resource path of the QueryTemplate.
2756
+ # e.g.
2757
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2758
+ #
2759
+ # @yield [response, operation] Access the result along with the RPC operation
2760
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2761
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2762
+ #
2763
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2764
+ #
2765
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2766
+ #
2767
+ # @example Basic example
2768
+ # require "google/cloud/bigquery/analytics_hub/v1"
2769
+ #
2770
+ # # Create a client object. The client can be reused for multiple calls.
2771
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2772
+ #
2773
+ # # Create a request. To set request fields, pass in keyword arguments.
2774
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest.new
2775
+ #
2776
+ # # Call the submit_query_template method.
2777
+ # result = client.submit_query_template request
2778
+ #
2779
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2780
+ # p result
2781
+ #
2782
+ def submit_query_template request, options = nil
2783
+ raise ::ArgumentError, "request must be provided" if request.nil?
2784
+
2785
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::SubmitQueryTemplateRequest
2786
+
2787
+ # Converts hash and nil to an options object
2788
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2789
+
2790
+ # Customize the options with defaults
2791
+ metadata = @config.rpcs.submit_query_template.metadata.to_h
2792
+
2793
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2794
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2795
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2796
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2797
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2798
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2799
+
2800
+ header_params = {}
2801
+ if request.name
2802
+ header_params["name"] = request.name
2803
+ end
2804
+
2805
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2806
+ metadata[:"x-goog-request-params"] ||= request_params_header
2807
+
2808
+ options.apply_defaults timeout: @config.rpcs.submit_query_template.timeout,
2809
+ metadata: metadata,
2810
+ retry_policy: @config.rpcs.submit_query_template.retry_policy
2811
+
2812
+ options.apply_defaults timeout: @config.timeout,
2813
+ metadata: @config.metadata,
2814
+ retry_policy: @config.retry_policy
2815
+
2816
+ @analytics_hub_service_stub.call_rpc :submit_query_template, request, options: options do |response, operation|
2817
+ yield response, operation if block_given?
2818
+ end
2819
+ rescue ::GRPC::BadStatus => e
2820
+ raise ::Google::Cloud::Error.from_error(e)
2821
+ end
2822
+
2823
+ ##
2824
+ # Approves a query template.
2825
+ #
2826
+ # @overload approve_query_template(request, options = nil)
2827
+ # Pass arguments to `approve_query_template` via a request object, either of type
2828
+ # {::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest} or an equivalent Hash.
2829
+ #
2830
+ # @param request [::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest, ::Hash]
2831
+ # A request object representing the call parameters. Required. To specify no
2832
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2833
+ # @param options [::Gapic::CallOptions, ::Hash]
2834
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2835
+ #
2836
+ # @overload approve_query_template(name: nil)
2837
+ # Pass arguments to `approve_query_template` via keyword arguments. Note that at
2838
+ # least one keyword argument is required. To specify no parameters, or to keep all
2839
+ # the default parameter values, pass an empty Hash as a request object (see above).
2840
+ #
2841
+ # @param name [::String]
2842
+ # Required. The resource path of the QueryTemplate.
2843
+ # e.g.
2844
+ # `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
2845
+ #
2846
+ # @yield [response, operation] Access the result along with the RPC operation
2847
+ # @yieldparam response [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2848
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2849
+ #
2850
+ # @return [::Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate]
2851
+ #
2852
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2853
+ #
2854
+ # @example Basic example
2855
+ # require "google/cloud/bigquery/analytics_hub/v1"
2856
+ #
2857
+ # # Create a client object. The client can be reused for multiple calls.
2858
+ # client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new
2859
+ #
2860
+ # # Create a request. To set request fields, pass in keyword arguments.
2861
+ # request = Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest.new
2862
+ #
2863
+ # # Call the approve_query_template method.
2864
+ # result = client.approve_query_template request
2865
+ #
2866
+ # # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::QueryTemplate.
2867
+ # p result
2868
+ #
2869
+ def approve_query_template request, options = nil
2870
+ raise ::ArgumentError, "request must be provided" if request.nil?
2871
+
2872
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigquery::AnalyticsHub::V1::ApproveQueryTemplateRequest
2873
+
2874
+ # Converts hash and nil to an options object
2875
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2876
+
2877
+ # Customize the options with defaults
2878
+ metadata = @config.rpcs.approve_query_template.metadata.to_h
2879
+
2880
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2881
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2882
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2883
+ gapic_version: ::Google::Cloud::Bigquery::AnalyticsHub::V1::VERSION
2884
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2885
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2886
+
2887
+ header_params = {}
2888
+ if request.name
2889
+ header_params["name"] = request.name
2890
+ end
2891
+
2892
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2893
+ metadata[:"x-goog-request-params"] ||= request_params_header
2894
+
2895
+ options.apply_defaults timeout: @config.rpcs.approve_query_template.timeout,
2896
+ metadata: metadata,
2897
+ retry_policy: @config.rpcs.approve_query_template.retry_policy
2898
+
2899
+ options.apply_defaults timeout: @config.timeout,
2900
+ metadata: @config.metadata,
2901
+ retry_policy: @config.retry_policy
2902
+
2903
+ @analytics_hub_service_stub.call_rpc :approve_query_template, request, options: options do |response, operation|
2904
+ yield response, operation if block_given?
2905
+ end
2906
+ rescue ::GRPC::BadStatus => e
2907
+ raise ::Google::Cloud::Error.from_error(e)
2908
+ end
2909
+
2282
2910
  ##
2283
2911
  # Configuration class for the AnalyticsHubService API.
2284
2912
  #
@@ -2555,6 +3183,41 @@ module Google
2555
3183
  # @return [::Gapic::Config::Method]
2556
3184
  #
2557
3185
  attr_reader :test_iam_permissions
3186
+ ##
3187
+ # RPC-specific configuration for `create_query_template`
3188
+ # @return [::Gapic::Config::Method]
3189
+ #
3190
+ attr_reader :create_query_template
3191
+ ##
3192
+ # RPC-specific configuration for `get_query_template`
3193
+ # @return [::Gapic::Config::Method]
3194
+ #
3195
+ attr_reader :get_query_template
3196
+ ##
3197
+ # RPC-specific configuration for `list_query_templates`
3198
+ # @return [::Gapic::Config::Method]
3199
+ #
3200
+ attr_reader :list_query_templates
3201
+ ##
3202
+ # RPC-specific configuration for `update_query_template`
3203
+ # @return [::Gapic::Config::Method]
3204
+ #
3205
+ attr_reader :update_query_template
3206
+ ##
3207
+ # RPC-specific configuration for `delete_query_template`
3208
+ # @return [::Gapic::Config::Method]
3209
+ #
3210
+ attr_reader :delete_query_template
3211
+ ##
3212
+ # RPC-specific configuration for `submit_query_template`
3213
+ # @return [::Gapic::Config::Method]
3214
+ #
3215
+ attr_reader :submit_query_template
3216
+ ##
3217
+ # RPC-specific configuration for `approve_query_template`
3218
+ # @return [::Gapic::Config::Method]
3219
+ #
3220
+ attr_reader :approve_query_template
2558
3221
 
2559
3222
  # @private
2560
3223
  def initialize parent_rpcs = nil
@@ -2602,6 +3265,20 @@ module Google
2602
3265
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
2603
3266
  test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2604
3267
  @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
3268
+ create_query_template_config = parent_rpcs.create_query_template if parent_rpcs.respond_to? :create_query_template
3269
+ @create_query_template = ::Gapic::Config::Method.new create_query_template_config
3270
+ get_query_template_config = parent_rpcs.get_query_template if parent_rpcs.respond_to? :get_query_template
3271
+ @get_query_template = ::Gapic::Config::Method.new get_query_template_config
3272
+ list_query_templates_config = parent_rpcs.list_query_templates if parent_rpcs.respond_to? :list_query_templates
3273
+ @list_query_templates = ::Gapic::Config::Method.new list_query_templates_config
3274
+ update_query_template_config = parent_rpcs.update_query_template if parent_rpcs.respond_to? :update_query_template
3275
+ @update_query_template = ::Gapic::Config::Method.new update_query_template_config
3276
+ delete_query_template_config = parent_rpcs.delete_query_template if parent_rpcs.respond_to? :delete_query_template
3277
+ @delete_query_template = ::Gapic::Config::Method.new delete_query_template_config
3278
+ submit_query_template_config = parent_rpcs.submit_query_template if parent_rpcs.respond_to? :submit_query_template
3279
+ @submit_query_template = ::Gapic::Config::Method.new submit_query_template_config
3280
+ approve_query_template_config = parent_rpcs.approve_query_template if parent_rpcs.respond_to? :approve_query_template
3281
+ @approve_query_template = ::Gapic::Config::Method.new approve_query_template_config
2605
3282
 
2606
3283
  yield self if block_given?
2607
3284
  end