google-cloud-metastore-v1beta 0.4.0 → 0.6.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.
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/metastore/v1beta/version"
24
+ require "google/cloud/metastore/v1beta/bindings_override"
25
+
26
+ require "google/cloud/metastore/v1beta/dataproc_metastore/credentials"
27
+ require "google/cloud/metastore/v1beta/dataproc_metastore/paths"
28
+ require "google/cloud/metastore/v1beta/dataproc_metastore/rest/operations"
29
+ require "google/cloud/metastore/v1beta/dataproc_metastore/rest/client"
30
+
31
+ module Google
32
+ module Cloud
33
+ module Metastore
34
+ module V1beta
35
+ ##
36
+ # Configures and manages metastore services.
37
+ # Metastore services are fully managed, highly available, autoscaled,
38
+ # autohealing, OSS-native deployments of technical metadata management
39
+ # software. Each metastore service exposes a network endpoint through which
40
+ # metadata queries are served. Metadata queries can originate from a variety
41
+ # of sources, including Apache Hive, Apache Presto, and Apache Spark.
42
+ #
43
+ # The Dataproc Metastore API defines the following resource model:
44
+ #
45
+ # * The service works with a collection of Google Cloud projects, named:
46
+ # `/projects/*`
47
+ # * Each project has a collection of available locations, named: `/locations/*`
48
+ # (a location must refer to a Google Cloud `region`)
49
+ # * Each location has a collection of services, named: `/services/*`
50
+ # * Dataproc Metastore services are resources with names of the form:
51
+ #
52
+ # `/projects/{project_number}/locations/{location_id}/services/{service_id}`.
53
+ #
54
+ # To load this service and instantiate a REST client:
55
+ #
56
+ # require "google/cloud/metastore/v1beta/dataproc_metastore/rest"
57
+ # client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Rest::Client.new
58
+ #
59
+ module DataprocMetastore
60
+ # Client for the REST transport
61
+ module Rest
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
70
+ require "google/cloud/metastore/v1beta/dataproc_metastore/rest/helpers" if ::File.file? helper_path
@@ -26,6 +26,7 @@ require "google/cloud/metastore/v1beta/dataproc_metastore/credentials"
26
26
  require "google/cloud/metastore/v1beta/dataproc_metastore/paths"
27
27
  require "google/cloud/metastore/v1beta/dataproc_metastore/operations"
28
28
  require "google/cloud/metastore/v1beta/dataproc_metastore/client"
29
+ require "google/cloud/metastore/v1beta/dataproc_metastore/rest"
29
30
 
30
31
  module Google
31
32
  module Cloud
@@ -55,6 +56,11 @@ module Google
55
56
  # require "google/cloud/metastore/v1beta/dataproc_metastore"
56
57
  # client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new
57
58
  #
59
+ # @example Load this service and instantiate a REST client
60
+ #
61
+ # require "google/cloud/metastore/v1beta/dataproc_metastore/rest"
62
+ # client = ::Google::Cloud::Metastore::V1beta::DataprocMetastore::Rest::Client.new
63
+ #
58
64
  module DataprocMetastore
59
65
  end
60
66
  end
@@ -18,6 +18,8 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/metastore/v1beta/metastore_federation_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
21
23
 
22
24
  module Google
23
25
  module Cloud
@@ -151,6 +153,18 @@ module Google
151
153
  config.endpoint = @config.endpoint
152
154
  end
153
155
 
156
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
157
+ config.credentials = credentials
158
+ config.quota_project = @quota_project_id
159
+ config.endpoint = @config.endpoint
160
+ end
161
+
162
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
163
+ config.credentials = credentials
164
+ config.quota_project = @quota_project_id
165
+ config.endpoint = @config.endpoint
166
+ end
167
+
154
168
  @dataproc_metastore_federation_stub = ::Gapic::ServiceStub.new(
155
169
  ::Google::Cloud::Metastore::V1beta::DataprocMetastoreFederation::Stub,
156
170
  credentials: credentials,
@@ -167,6 +181,20 @@ module Google
167
181
  #
168
182
  attr_reader :operations_client
169
183
 
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ ##
192
+ # Get the associated client for mix-in of the IAMPolicy.
193
+ #
194
+ # @return [Google::Iam::V1::IAMPolicy::Client]
195
+ #
196
+ attr_reader :iam_policy_client
197
+
170
198
  # Service calls
171
199
 
172
200
  ##
@@ -232,13 +260,11 @@ module Google
232
260
  # # Call the list_federations method.
233
261
  # result = client.list_federations request
234
262
  #
235
- # # The returned object is of type Gapic::PagedEnumerable. You can
236
- # # iterate over all elements by calling #each, and the enumerable
237
- # # will lazily make API calls to fetch subsequent pages. Other
238
- # # methods are also available for managing paging directly.
239
- # result.each do |response|
263
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
264
+ # # over elements, and API calls will be issued to fetch pages as needed.
265
+ # result.each do |item|
240
266
  # # Each element is of type ::Google::Cloud::Metastore::V1beta::Federation.
241
- # p response
267
+ # p item
242
268
  # end
243
269
  #
244
270
  def list_federations request, options = nil
@@ -439,14 +465,14 @@ module Google
439
465
  # # Call the create_federation method.
440
466
  # result = client.create_federation request
441
467
  #
442
- # # The returned object is of type Gapic::Operation. You can use this
443
- # # object to check the status of an operation, cancel it, or wait
444
- # # for results. Here is how to block until completion:
468
+ # # The returned object is of type Gapic::Operation. You can use it to
469
+ # # check the status of an operation, cancel it, or wait for results.
470
+ # # Here is how to wait for a response.
445
471
  # result.wait_until_done! timeout: 60
446
472
  # if result.response?
447
473
  # p result.response
448
474
  # else
449
- # puts "Error!"
475
+ # puts "No response received."
450
476
  # end
451
477
  #
452
478
  def create_federation request, options = nil
@@ -554,14 +580,14 @@ module Google
554
580
  # # Call the update_federation method.
555
581
  # result = client.update_federation request
556
582
  #
557
- # # The returned object is of type Gapic::Operation. You can use this
558
- # # object to check the status of an operation, cancel it, or wait
559
- # # for results. Here is how to block until completion:
583
+ # # The returned object is of type Gapic::Operation. You can use it to
584
+ # # check the status of an operation, cancel it, or wait for results.
585
+ # # Here is how to wait for a response.
560
586
  # result.wait_until_done! timeout: 60
561
587
  # if result.response?
562
588
  # p result.response
563
589
  # else
564
- # puts "Error!"
590
+ # puts "No response received."
565
591
  # end
566
592
  #
567
593
  def update_federation request, options = nil
@@ -663,14 +689,14 @@ module Google
663
689
  # # Call the delete_federation method.
664
690
  # result = client.delete_federation request
665
691
  #
666
- # # The returned object is of type Gapic::Operation. You can use this
667
- # # object to check the status of an operation, cancel it, or wait
668
- # # for results. Here is how to block until completion:
692
+ # # The returned object is of type Gapic::Operation. You can use it to
693
+ # # check the status of an operation, cancel it, or wait for results.
694
+ # # Here is how to wait for a response.
669
695
  # result.wait_until_done! timeout: 60
670
696
  # if result.response?
671
697
  # p result.response
672
698
  # else
673
- # puts "Error!"
699
+ # puts "No response received."
674
700
  # end
675
701
  #
676
702
  def delete_federation request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil