Module: Google::Cloud::ApiHub
- Defined in:
- lib/google/cloud/api_hub.rb,
lib/google/cloud/api_hub/version.rb
Constant Summary collapse
- VERSION =
"0.6.0"
Class Method Summary collapse
-
.api_hub(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHub.
-
.api_hub_available?(version: :v1) ⇒ boolean
Determines whether the ApiHub service is supported by the current client.
-
.api_hub_collect(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubCollect.
-
.api_hub_collect_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubCollect service is supported by the current client.
-
.api_hub_curate(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubCurate.
-
.api_hub_curate_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubCurate service is supported by the current client.
-
.api_hub_dependencies(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubDependencies.
-
.api_hub_dependencies_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubDependencies service is supported by the current client.
-
.api_hub_discovery(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubDiscovery.
-
.api_hub_discovery_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubDiscovery service is supported by the current client.
-
.api_hub_plugin(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubPlugin.
-
.api_hub_plugin_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubPlugin service is supported by the current client.
-
.configure {|::Google::Cloud.configure.api_hub| ... } ⇒ ::Google::Cloud::Config
Configure the google-cloud-api_hub library.
-
.host_project_registration_service(version: :v1, &block) ⇒ ::Object
Create a new client object for HostProjectRegistrationService.
-
.host_project_registration_service_available?(version: :v1) ⇒ boolean
Determines whether the HostProjectRegistrationService service is supported by the current client.
-
.linting_service(version: :v1, &block) ⇒ ::Object
Create a new client object for LintingService.
-
.linting_service_available?(version: :v1) ⇒ boolean
Determines whether the LintingService service is supported by the current client.
-
.provisioning(version: :v1, &block) ⇒ ::Object
Create a new client object for Provisioning.
-
.provisioning_available?(version: :v1) ⇒ boolean
Determines whether the Provisioning service is supported by the current client.
-
.runtime_project_attachment_service(version: :v1, &block) ⇒ ::Object
Create a new client object for RuntimeProjectAttachmentService.
-
.runtime_project_attachment_service_available?(version: :v1) ⇒ boolean
Determines whether the RuntimeProjectAttachmentService service is supported by the current client.
Class Method Details
.api_hub(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHub.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHub::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHub service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHub service. You can determine whether the method will succeed by calling api_hub_available?.
About ApiHub
This service provides all methods related to the API hub.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/google/cloud/api_hub.rb', line 71 def self.api_hub version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHub) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_available?(version: :v1) ⇒ boolean
Determines whether the ApiHub service is supported by the current client. If true, you can retrieve a client object by calling api_hub. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHub service, or if the versioned client gem needs an update to support the ApiHub service.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/google/cloud/api_hub.rb', line 93 def self.api_hub_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHub service_module = service_module.const_get :ApiHub return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.api_hub_collect(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubCollect.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHubCollect::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHubCollect service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHubCollect service. You can determine whether the method will succeed by calling api_hub_collect_available?.
About ApiHubCollect
This service exposes methods used for collecting various types of data from different first party and third party sources and push it to Hub's collect layer.
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/google/cloud/api_hub.rb', line 200 def self.api_hub_collect version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubCollect) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_collect_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubCollect service is supported by the current client. If true, you can retrieve a client object by calling api_hub_collect. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHubCollect service, or if the versioned client gem needs an update to support the ApiHubCollect service.
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/google/cloud/api_hub.rb', line 222 def self.api_hub_collect_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHubCollect service_module = service_module.const_get :ApiHubCollect return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.api_hub_curate(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubCurate.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHubCurate::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHubCurate service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHubCurate service. You can determine whether the method will succeed by calling api_hub_curate_available?.
About ApiHubCurate
This service is used for managing curations for processing API data consumed from collect layer.
264 265 266 267 268 269 270 271 272 273 |
# File 'lib/google/cloud/api_hub.rb', line 264 def self.api_hub_curate version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubCurate) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_curate_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubCurate service is supported by the current client. If true, you can retrieve a client object by calling api_hub_curate. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHubCurate service, or if the versioned client gem needs an update to support the ApiHubCurate service.
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/google/cloud/api_hub.rb', line 286 def self.api_hub_curate_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHubCurate service_module = service_module.const_get :ApiHubCurate return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.api_hub_dependencies(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubDependencies.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHubDependencies::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHubDependencies service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHubDependencies service. You can determine whether the method will succeed by calling api_hub_dependencies_available?.
About ApiHubDependencies
This service provides methods for various operations related to a Dependency in the API hub.
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/google/cloud/api_hub.rb', line 135 def self.api_hub_dependencies version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubDependencies) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_dependencies_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubDependencies service is supported by the current client. If true, you can retrieve a client object by calling api_hub_dependencies. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHubDependencies service, or if the versioned client gem needs an update to support the ApiHubDependencies service.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/google/cloud/api_hub.rb', line 157 def self.api_hub_dependencies_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHubDependencies service_module = service_module.const_get :ApiHubDependencies return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.api_hub_discovery(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubDiscovery.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHubDiscovery::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHubDiscovery service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHubDiscovery service. You can determine whether the method will succeed by calling api_hub_discovery_available?.
About ApiHubDiscovery
This service exposes methods used to manage DiscoveredApiObservations and DiscoveredApiOperations.
328 329 330 331 332 333 334 335 336 337 |
# File 'lib/google/cloud/api_hub.rb', line 328 def self.api_hub_discovery version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubDiscovery) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_discovery_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubDiscovery service is supported by the current client. If true, you can retrieve a client object by calling api_hub_discovery. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHubDiscovery service, or if the versioned client gem needs an update to support the ApiHubDiscovery service.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/google/cloud/api_hub.rb', line 350 def self.api_hub_discovery_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHubDiscovery service_module = service_module.const_get :ApiHubDiscovery return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.api_hub_plugin(version: :v1, &block) ⇒ ::Object
Create a new client object for ApiHubPlugin.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the ApiHubPlugin service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the ApiHubPlugin service. You can determine whether the method will succeed by calling api_hub_plugin_available?.
About ApiHubPlugin
This service is used for managing plugins inside the API Hub.
517 518 519 520 521 522 523 524 525 526 |
# File 'lib/google/cloud/api_hub.rb', line 517 def self.api_hub_plugin version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:ApiHubPlugin) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.api_hub_plugin_available?(version: :v1) ⇒ boolean
Determines whether the ApiHubPlugin service is supported by the current client. If true, you can retrieve a client object by calling api_hub_plugin. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the ApiHubPlugin service, or if the versioned client gem needs an update to support the ApiHubPlugin service.
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/google/cloud/api_hub.rb', line 539 def self.api_hub_plugin_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :ApiHubPlugin service_module = service_module.const_get :ApiHubPlugin return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.configure {|::Google::Cloud.configure.api_hub| ... } ⇒ ::Google::Cloud::Config
Configure the google-cloud-api_hub library.
The following configuration parameters are supported:
credentials(type:String, Hash, Google::Auth::Credentials) - The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object.lib_name(type:String) - The library name as recorded in instrumentation and logging.lib_version(type:String) - The library version as recorded in instrumentation and logging.timeout(type:Numeric) - Default timeout in seconds.metadata(type:Hash{Symbol=>String}) - Additional headers to be sent with the call.retry_policy(type:Hash) - The retry policy. The value is a hash with the following keys::initial_delay(type:Numeric) - The initial delay in seconds.:max_delay(type:Numeric) - The max delay in seconds.:multiplier(type:Numeric) - The incremental backoff multiplier.:jitter(type:Numeric) - The jitter in seconds. Default: 1.0.:retry_codes(type:Array<String>) - The error codes that should trigger a retry.
709 710 711 712 713 |
# File 'lib/google/cloud/api_hub.rb', line 709 def self.configure yield ::Google::Cloud.configure.api_hub if block_given? ::Google::Cloud.configure.api_hub end |
.host_project_registration_service(version: :v1, &block) ⇒ ::Object
Create a new client object for HostProjectRegistrationService.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::HostProjectRegistrationService::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the HostProjectRegistrationService service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the HostProjectRegistrationService service. You can determine whether the method will succeed by calling host_project_registration_service_available?.
About HostProjectRegistrationService
This service is used for managing the host project registrations.
391 392 393 394 395 396 397 398 399 400 |
# File 'lib/google/cloud/api_hub.rb', line 391 def self.host_project_registration_service version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:HostProjectRegistrationService) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.host_project_registration_service_available?(version: :v1) ⇒ boolean
Determines whether the HostProjectRegistrationService service is supported by the current client. If true, you can retrieve a client object by calling host_project_registration_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the HostProjectRegistrationService service, or if the versioned client gem needs an update to support the HostProjectRegistrationService service.
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/google/cloud/api_hub.rb', line 413 def self.host_project_registration_service_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :HostProjectRegistrationService service_module = service_module.const_get :HostProjectRegistrationService return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.linting_service(version: :v1, &block) ⇒ ::Object
Create a new client object for LintingService.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::LintingService::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the LintingService service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the LintingService service. You can determine whether the method will succeed by calling linting_service_available?.
About LintingService
This service provides all methods related to the 1p Linter.
454 455 456 457 458 459 460 461 462 463 |
# File 'lib/google/cloud/api_hub.rb', line 454 def self.linting_service version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:LintingService) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.linting_service_available?(version: :v1) ⇒ boolean
Determines whether the LintingService service is supported by the current client. If true, you can retrieve a client object by calling linting_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the LintingService service, or if the versioned client gem needs an update to support the LintingService service.
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/google/cloud/api_hub.rb', line 476 def self.linting_service_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :LintingService service_module = service_module.const_get :LintingService return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.provisioning(version: :v1, &block) ⇒ ::Object
Create a new client object for Provisioning.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::Provisioning::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the Provisioning service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the Provisioning service. You can determine whether the method will succeed by calling provisioning_available?.
About Provisioning
This service is used for managing the data plane provisioning of the API hub.
580 581 582 583 584 585 586 587 588 589 |
# File 'lib/google/cloud/api_hub.rb', line 580 def self.provisioning version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:Provisioning) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.provisioning_available?(version: :v1) ⇒ boolean
Determines whether the Provisioning service is supported by the current client. If true, you can retrieve a client object by calling provisioning. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the Provisioning service, or if the versioned client gem needs an update to support the Provisioning service.
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
# File 'lib/google/cloud/api_hub.rb', line 602 def self.provisioning_available? version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :Provisioning service_module = service_module.const_get :Provisioning return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |
.runtime_project_attachment_service(version: :v1, &block) ⇒ ::Object
Create a new client object for RuntimeProjectAttachmentService.
By default, this returns an instance of
Google::Cloud::ApiHub::V1::RuntimeProjectAttachmentService::Rest::Client
for a REST client for version V1 of the API.
However, you can specify a different API version by passing it in the
version parameter. If the RuntimeProjectAttachmentService service is
supported by that API version, and the corresponding gem is available, the
appropriate versioned client will be returned.
Raises an exception if the currently installed versioned client gem for the given API version does not support the RuntimeProjectAttachmentService service. You can determine whether the method will succeed by calling runtime_project_attachment_service_available?.
About RuntimeProjectAttachmentService
This service is used for managing the runtime project attachments.
643 644 645 646 647 648 649 650 651 652 |
# File 'lib/google/cloud/api_hub.rb', line 643 def self. version: :v1, &block require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first service_module = Google::Cloud::ApiHub.const_get(package_name).const_get(:RuntimeProjectAttachmentService) service_module.const_get(:Rest).const_get(:Client).new(&block) end |
.runtime_project_attachment_service_available?(version: :v1) ⇒ boolean
Determines whether the RuntimeProjectAttachmentService service is supported by the current client. If true, you can retrieve a client object by calling runtime_project_attachment_service. If false, that method will raise an exception. This could happen if the given API version does not exist or does not support the RuntimeProjectAttachmentService service, or if the versioned client gem needs an update to support the RuntimeProjectAttachmentService service.
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/google/cloud/api_hub.rb', line 665 def self. version: :v1 require "google/cloud/api_hub/#{version.to_s.downcase}" package_name = Google::Cloud::ApiHub .constants .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } .first return false unless package_name service_module = Google::Cloud::ApiHub.const_get package_name return false unless service_module.const_defined? :RuntimeProjectAttachmentService service_module = service_module.const_get :RuntimeProjectAttachmentService return false unless service_module.const_defined? :Rest service_module = service_module.const_get :Rest service_module.const_defined? :Client rescue ::LoadError false end |