google-cloud-managed_kafka 2.0.0 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25cabe291e1cfb6ae3f499cf732d3930c94c6cc6822393bc5de20f00ec2aae67
4
- data.tar.gz: b399fed5d507cd007b0d33f3ba984bb7302b5c6a1c5e4a0f46df9757942e27ac
3
+ metadata.gz: e512ab4e749e2f5c874052888d884dba5a92c173f8c02788f013e2980ef873d0
4
+ data.tar.gz: 514c805b4f61e014754674a3838ee95cbede5c3d45a9f3bbedabb7aa4d758459
5
5
  SHA512:
6
- metadata.gz: 93a74a16db5cf90d9a9821651f53d7c13dd552efa77d835f3757980251fa67dc087cb083c0460ca713aa81691123a7a8ef4880a00b3ec6d4b91dd284cf000d01
7
- data.tar.gz: b867bb14e144e480b08308d425de8636495644e5e7d5ceb2ee7956af6770537b9c182af87fc0fcddd343b608195e00326bda2494766ceee42cd9e7bc72aa7e74
6
+ metadata.gz: bc0f7040ed128d697b123eab4442dbfffdb4a09f04e0e84aafd596a8dafaf718c6ced4c881c3c4335c88392454c24f4c8a3b0060fa3b650b632e2c6496a229f8
7
+ data.tar.gz: f8c7e5374f9bd7a2f38405f644746b44baeba56557e72defac037dcaffdb05f3d3f7014519f1465f8da6ef69f9999a1221bf0baf2e3eb46acc8199846a621a78
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module ManagedKafka
23
- VERSION = "2.0.0"
23
+ VERSION = "2.1.0"
24
24
  end
25
25
  end
26
26
  end
@@ -116,6 +116,77 @@ module Google
116
116
  false
117
117
  end
118
118
 
119
+ ##
120
+ # Create a new client object for ManagedKafkaConnect.
121
+ #
122
+ # By default, this returns an instance of
123
+ # [Google::Cloud::ManagedKafka::V1::ManagedKafkaConnect::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-managed_kafka-v1/latest/Google-Cloud-ManagedKafka-V1-ManagedKafkaConnect-Client)
124
+ # for a gRPC client for version V1 of the API.
125
+ # However, you can specify a different API version by passing it in the
126
+ # `version` parameter. If the ManagedKafkaConnect service is
127
+ # supported by that API version, and the corresponding gem is available, the
128
+ # appropriate versioned client will be returned.
129
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
130
+ # the `transport` parameter.
131
+ #
132
+ # Raises an exception if the currently installed versioned client gem for the
133
+ # given API version does not support the given transport of the ManagedKafkaConnect service.
134
+ # You can determine whether the method will succeed by calling
135
+ # {Google::Cloud::ManagedKafka.managed_kafka_connect_available?}.
136
+ #
137
+ # ## About ManagedKafkaConnect
138
+ #
139
+ # The service that a client application uses to manage Apache Kafka Connect
140
+ # clusters and connectors.
141
+ #
142
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
143
+ # Defaults to `:v1`.
144
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
145
+ # @return [::Object] A client object for the specified version.
146
+ #
147
+ def self.managed_kafka_connect version: :v1, transport: :grpc, &block
148
+ require "google/cloud/managed_kafka/#{version.to_s.downcase}"
149
+
150
+ package_name = Google::Cloud::ManagedKafka
151
+ .constants
152
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
153
+ .first
154
+ service_module = Google::Cloud::ManagedKafka.const_get(package_name).const_get(:ManagedKafkaConnect)
155
+ service_module = service_module.const_get(:Rest) if transport == :rest
156
+ service_module.const_get(:Client).new(&block)
157
+ end
158
+
159
+ ##
160
+ # Determines whether the ManagedKafkaConnect service is supported by the current client.
161
+ # If true, you can retrieve a client object by calling {Google::Cloud::ManagedKafka.managed_kafka_connect}.
162
+ # If false, that method will raise an exception. This could happen if the given
163
+ # API version does not exist or does not support the ManagedKafkaConnect service,
164
+ # or if the versioned client gem needs an update to support the ManagedKafkaConnect service.
165
+ #
166
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
167
+ # Defaults to `:v1`.
168
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
169
+ # @return [boolean] Whether the service is available.
170
+ #
171
+ def self.managed_kafka_connect_available? version: :v1, transport: :grpc
172
+ require "google/cloud/managed_kafka/#{version.to_s.downcase}"
173
+ package_name = Google::Cloud::ManagedKafka
174
+ .constants
175
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
176
+ .first
177
+ return false unless package_name
178
+ service_module = Google::Cloud::ManagedKafka.const_get package_name
179
+ return false unless service_module.const_defined? :ManagedKafkaConnect
180
+ service_module = service_module.const_get :ManagedKafkaConnect
181
+ if transport == :rest
182
+ return false unless service_module.const_defined? :Rest
183
+ service_module = service_module.const_get :Rest
184
+ end
185
+ service_module.const_defined? :Client
186
+ rescue ::LoadError
187
+ false
188
+ end
189
+
119
190
  ##
120
191
  # Configure the google-cloud-managed_kafka library.
121
192
  #
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-managed_kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-13 00:00:00.000000000 Z
10
+ date: 2025-03-19 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: google-cloud-core
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  requirements: []
71
- rubygems_version: 3.6.3
71
+ rubygems_version: 3.6.5
72
72
  specification_version: 4
73
73
  summary: Manage Apache Kafka clusters and resources.
74
74
  test_files: []