google-cloud-service_usage 1.6.1 → 1.6.2
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 +4 -4
- data/README.md +1 -5
- data/lib/google/cloud/service_usage/version.rb +1 -1
- data/lib/google/cloud/service_usage.rb +12 -3
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96172ff844b4a8a413acf2ce537ea6513889117c6c9e5508f0a4fab879d25cd9
|
|
4
|
+
data.tar.gz: 45977de9382941b3c9d9c331c4c73e8566d196066835ea2ed78419c7a7fb906f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e83d6b6754e15776874091146f5bea788bc403d157b2f836434a634b8a3ea398ea09f39f53590ff71a2307bc887aabf15ec64e1a3ea8adef266ded4cd4b9772
|
|
7
|
+
data.tar.gz: 5e614d7e24408c0c5d5cb9af62c5327a180a62a29a89c40bb854bd4754aafafd39971fbc0fc420c4c39aae6df2267f5afc198f4c2d827ee4fa076297dd4b8614
|
data/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Ruby Client for the Service Usage API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Enables services that service consumers want to use on Google Cloud Platform, lists the available or enabled services, or disables services that service consumers no longer use.
|
|
4
4
|
|
|
5
|
-
Service Usage is an infrastructure service of Google Cloud that lets you list and manage other APIs and services in your Cloud projects. You can list and manage Google Cloud services and their APIs, as well as services created using Cloud Endpoints.
|
|
6
5
|
|
|
7
6
|
Actual client classes for the various versions of this API are defined in
|
|
8
7
|
_versioned_ client gems, with names of the form `google-cloud-service_usage-v*`.
|
|
@@ -18,9 +17,6 @@ themselves can be found in the client library documentation for the versioned
|
|
|
18
17
|
client gems:
|
|
19
18
|
[google-cloud-service_usage-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-service_usage-v1/latest).
|
|
20
19
|
|
|
21
|
-
See also the [Product Documentation](https://cloud.google.com/service-usage/)
|
|
22
|
-
for more usage information.
|
|
23
|
-
|
|
24
20
|
## Quick Start
|
|
25
21
|
|
|
26
22
|
```
|
|
@@ -55,9 +55,11 @@ module Google
|
|
|
55
55
|
# `version` parameter. If the ServiceUsage service is
|
|
56
56
|
# supported by that API version, and the corresponding gem is available, the
|
|
57
57
|
# appropriate versioned client will be returned.
|
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
|
59
|
+
# the `transport` parameter.
|
|
58
60
|
#
|
|
59
61
|
# Raises an exception if the currently installed versioned client gem for the
|
|
60
|
-
# given API version does not support the ServiceUsage service.
|
|
62
|
+
# given API version does not support the given transport of the ServiceUsage service.
|
|
61
63
|
# You can determine whether the method will succeed by calling
|
|
62
64
|
# {Google::Cloud::ServiceUsage.service_usage_available?}.
|
|
63
65
|
#
|
|
@@ -71,9 +73,10 @@ module Google
|
|
|
71
73
|
#
|
|
72
74
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
73
75
|
# Defaults to `:v1`.
|
|
76
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
74
77
|
# @return [::Object] A client object for the specified version.
|
|
75
78
|
#
|
|
76
|
-
def self.service_usage version: :v1, &block
|
|
79
|
+
def self.service_usage version: :v1, transport: :grpc, &block
|
|
77
80
|
require "google/cloud/service_usage/#{version.to_s.downcase}"
|
|
78
81
|
|
|
79
82
|
package_name = Google::Cloud::ServiceUsage
|
|
@@ -81,6 +84,7 @@ module Google
|
|
|
81
84
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
82
85
|
.first
|
|
83
86
|
service_module = Google::Cloud::ServiceUsage.const_get(package_name).const_get(:ServiceUsage)
|
|
87
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
|
84
88
|
service_module.const_get(:Client).new(&block)
|
|
85
89
|
end
|
|
86
90
|
|
|
@@ -93,9 +97,10 @@ module Google
|
|
|
93
97
|
#
|
|
94
98
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
95
99
|
# Defaults to `:v1`.
|
|
100
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
96
101
|
# @return [boolean] Whether the service is available.
|
|
97
102
|
#
|
|
98
|
-
def self.service_usage_available? version: :v1
|
|
103
|
+
def self.service_usage_available? version: :v1, transport: :grpc
|
|
99
104
|
require "google/cloud/service_usage/#{version.to_s.downcase}"
|
|
100
105
|
package_name = Google::Cloud::ServiceUsage
|
|
101
106
|
.constants
|
|
@@ -105,6 +110,10 @@ module Google
|
|
|
105
110
|
service_module = Google::Cloud::ServiceUsage.const_get package_name
|
|
106
111
|
return false unless service_module.const_defined? :ServiceUsage
|
|
107
112
|
service_module = service_module.const_get :ServiceUsage
|
|
113
|
+
if transport == :rest
|
|
114
|
+
return false unless service_module.const_defined? :Rest
|
|
115
|
+
service_module = service_module.const_get :Rest
|
|
116
|
+
end
|
|
108
117
|
service_module.const_defined? :Client
|
|
109
118
|
rescue ::LoadError
|
|
110
119
|
false
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-service_usage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -43,10 +43,9 @@ dependencies:
|
|
|
43
43
|
- - "<"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: 2.a
|
|
46
|
-
description:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Cloud Endpoints.
|
|
46
|
+
description: Enables services that service consumers want to use on Google Cloud Platform,
|
|
47
|
+
lists the available or enabled services, or disables services that service consumers
|
|
48
|
+
no longer use.
|
|
50
49
|
email: googleapis-packages@google.com
|
|
51
50
|
executables: []
|
|
52
51
|
extensions: []
|
|
@@ -79,5 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
78
|
requirements: []
|
|
80
79
|
rubygems_version: 3.6.9
|
|
81
80
|
specification_version: 4
|
|
82
|
-
summary:
|
|
81
|
+
summary: Enables services that service consumers want to use on Google Cloud Platform,
|
|
82
|
+
lists the available or enabled services, or disables services that service consumers
|
|
83
|
+
no longer use.
|
|
83
84
|
test_files: []
|