google-cloud-commerce-consumer-procurement 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +3 -3
- data/README.md +31 -1
- data/lib/google/cloud/commerce/consumer/procurement/version.rb +1 -1
- data/lib/google/cloud/commerce/consumer/procurement.rb +106 -0
- metadata +8 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42fb610e1811260641429df7c7ac9ce2a190ea5ca64d59e497e44b2452c515e8
|
4
|
+
data.tar.gz: 9f576798dea0c7f51169294fb1554944e2166ab6721ad8388518bf94370a0bec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc763182804b53cc3f02032a700ef37da23da566a9480c0e1532d6eb77dcf5810438cdf097d2bdc368a3fd53189e2e42c4fc4e9d8dd74e64b611184f4cdb85b
|
7
|
+
data.tar.gz: 1fff4674060a61b49a6fe8be7e7524373ad35e954ef94f06bc839e1fbbb61316fbadadf694940d057a17058e33ed14b47ae98076b131084ef0092e926d0ae488
|
data/AUTHENTICATION.md
CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
56
56
|
```ruby
|
57
57
|
require "google/cloud/commerce/consumer/procurement"
|
58
58
|
|
59
|
-
client = Google::Cloud::Commerce::Consumer::Procurement.
|
59
|
+
client = Google::Cloud::Commerce::Consumer::Procurement.license_management_service do |config|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
61
61
|
end
|
62
62
|
```
|
@@ -70,7 +70,7 @@ Google::Cloud::Commerce::Consumer::Procurement.configure do |config|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
71
71
|
end
|
72
72
|
|
73
|
-
client = Google::Cloud::Commerce::Consumer::Procurement.
|
73
|
+
client = Google::Cloud::Commerce::Consumer::Procurement.license_management_service
|
74
74
|
```
|
75
75
|
|
76
76
|
### Environment Variables
|
@@ -100,7 +100,7 @@ require "google/cloud/commerce/consumer/procurement"
|
|
100
100
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
102
102
|
|
103
|
-
client = Google::Cloud::Commerce::Consumer::Procurement.
|
103
|
+
client = Google::Cloud::Commerce::Consumer::Procurement.license_management_service
|
104
104
|
```
|
105
105
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
@@ -33,9 +33,39 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudcommerceconsumerprocurement.googleapis.com)
|
34
34
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
35
35
|
|
36
|
+
## Debug Logging
|
37
|
+
|
38
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
39
|
+
your application's integration with the API. When logging is activated, key
|
40
|
+
events such as requests and responses, along with data payloads and metadata
|
41
|
+
such as headers and client configuration, are logged to the standard error
|
42
|
+
stream.
|
43
|
+
|
44
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
45
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
46
|
+
customers, private keys, or other security data that could be compromising if
|
47
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
48
|
+
the principle of least access. Google also recommends that Client Library Debug
|
49
|
+
Logging be enabled only temporarily during active debugging, and not used
|
50
|
+
permanently in production.
|
51
|
+
|
52
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
53
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
54
|
+
list of client library gem names. This will select the default logging behavior,
|
55
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
56
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
57
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
58
|
+
results in logs appearing alongside your application logs in the
|
59
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
60
|
+
|
61
|
+
Debug logging also requires that the versioned clients for this service be
|
62
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
63
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
64
|
+
[google-cloud-commerce-consumer-procurement-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest).
|
65
|
+
|
36
66
|
## Supported Ruby Versions
|
37
67
|
|
38
|
-
This library is supported on Ruby
|
68
|
+
This library is supported on Ruby 3.0+.
|
39
69
|
|
40
70
|
Google provides official support for Ruby versions that are actively supported
|
41
71
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -47,6 +47,76 @@ module Google
|
|
47
47
|
module Commerce
|
48
48
|
module Consumer
|
49
49
|
module Procurement
|
50
|
+
##
|
51
|
+
# Create a new client object for LicenseManagementService.
|
52
|
+
#
|
53
|
+
# By default, this returns an instance of
|
54
|
+
# [Google::Cloud::Commerce::Consumer::Procurement::V1::LicenseManagementService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-commerce-consumer-procurement-v1/latest/Google-Cloud-Commerce-Consumer-Procurement-V1-LicenseManagementService-Client)
|
55
|
+
# for a gRPC client for version V1 of the API.
|
56
|
+
# However, you can specify a different API version by passing it in the
|
57
|
+
# `version` parameter. If the LicenseManagementService service is
|
58
|
+
# supported by that API version, and the corresponding gem is available, the
|
59
|
+
# appropriate versioned client will be returned.
|
60
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
61
|
+
# the `transport` parameter.
|
62
|
+
#
|
63
|
+
# Raises an exception if the currently installed versioned client gem for the
|
64
|
+
# given API version does not support the given transport of the LicenseManagementService service.
|
65
|
+
# You can determine whether the method will succeed by calling
|
66
|
+
# {Google::Cloud::Commerce::Consumer::Procurement.license_management_service_available?}.
|
67
|
+
#
|
68
|
+
# ## About LicenseManagementService
|
69
|
+
#
|
70
|
+
# Service for managing licenses.
|
71
|
+
#
|
72
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
73
|
+
# Defaults to `:v1`.
|
74
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
75
|
+
# @return [::Object] A client object for the specified version.
|
76
|
+
#
|
77
|
+
def self.license_management_service version: :v1, transport: :grpc, &block
|
78
|
+
require "google/cloud/commerce/consumer/procurement/#{version.to_s.downcase}"
|
79
|
+
|
80
|
+
package_name = Google::Cloud::Commerce::Consumer::Procurement
|
81
|
+
.constants
|
82
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
83
|
+
.first
|
84
|
+
service_module = Google::Cloud::Commerce::Consumer::Procurement.const_get(package_name).const_get(:LicenseManagementService)
|
85
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
86
|
+
service_module.const_get(:Client).new(&block)
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Determines whether the LicenseManagementService service is supported by the current client.
|
91
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Commerce::Consumer::Procurement.license_management_service}.
|
92
|
+
# If false, that method will raise an exception. This could happen if the given
|
93
|
+
# API version does not exist or does not support the LicenseManagementService service,
|
94
|
+
# or if the versioned client gem needs an update to support the LicenseManagementService service.
|
95
|
+
#
|
96
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
97
|
+
# Defaults to `:v1`.
|
98
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
99
|
+
# @return [boolean] Whether the service is available.
|
100
|
+
#
|
101
|
+
def self.license_management_service_available? version: :v1, transport: :grpc
|
102
|
+
require "google/cloud/commerce/consumer/procurement/#{version.to_s.downcase}"
|
103
|
+
package_name = Google::Cloud::Commerce::Consumer::Procurement
|
104
|
+
.constants
|
105
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
106
|
+
.first
|
107
|
+
return false unless package_name
|
108
|
+
service_module = Google::Cloud::Commerce::Consumer::Procurement.const_get package_name
|
109
|
+
return false unless service_module.const_defined? :LicenseManagementService
|
110
|
+
service_module = service_module.const_get :LicenseManagementService
|
111
|
+
if transport == :rest
|
112
|
+
return false unless service_module.const_defined? :Rest
|
113
|
+
service_module = service_module.const_get :Rest
|
114
|
+
end
|
115
|
+
service_module.const_defined? :Client
|
116
|
+
rescue ::LoadError
|
117
|
+
false
|
118
|
+
end
|
119
|
+
|
50
120
|
##
|
51
121
|
# Create a new client object for ConsumerProcurementService.
|
52
122
|
#
|
@@ -60,6 +130,11 @@ module Google
|
|
60
130
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
61
131
|
# the `transport` parameter.
|
62
132
|
#
|
133
|
+
# Raises an exception if the currently installed versioned client gem for the
|
134
|
+
# given API version does not support the given transport of the ConsumerProcurementService service.
|
135
|
+
# You can determine whether the method will succeed by calling
|
136
|
+
# {Google::Cloud::Commerce::Consumer::Procurement.consumer_procurement_service_available?}.
|
137
|
+
#
|
63
138
|
# ## About ConsumerProcurementService
|
64
139
|
#
|
65
140
|
# ConsumerProcurementService allows customers to make purchases of products
|
@@ -89,6 +164,37 @@ module Google
|
|
89
164
|
service_module.const_get(:Client).new(&block)
|
90
165
|
end
|
91
166
|
|
167
|
+
##
|
168
|
+
# Determines whether the ConsumerProcurementService service is supported by the current client.
|
169
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Commerce::Consumer::Procurement.consumer_procurement_service}.
|
170
|
+
# If false, that method will raise an exception. This could happen if the given
|
171
|
+
# API version does not exist or does not support the ConsumerProcurementService service,
|
172
|
+
# or if the versioned client gem needs an update to support the ConsumerProcurementService service.
|
173
|
+
#
|
174
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
175
|
+
# Defaults to `:v1`.
|
176
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
177
|
+
# @return [boolean] Whether the service is available.
|
178
|
+
#
|
179
|
+
def self.consumer_procurement_service_available? version: :v1, transport: :grpc
|
180
|
+
require "google/cloud/commerce/consumer/procurement/#{version.to_s.downcase}"
|
181
|
+
package_name = Google::Cloud::Commerce::Consumer::Procurement
|
182
|
+
.constants
|
183
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
184
|
+
.first
|
185
|
+
return false unless package_name
|
186
|
+
service_module = Google::Cloud::Commerce::Consumer::Procurement.const_get package_name
|
187
|
+
return false unless service_module.const_defined? :ConsumerProcurementService
|
188
|
+
service_module = service_module.const_get :ConsumerProcurementService
|
189
|
+
if transport == :rest
|
190
|
+
return false unless service_module.const_defined? :Rest
|
191
|
+
service_module = service_module.const_get :Rest
|
192
|
+
end
|
193
|
+
service_module.const_defined? :Client
|
194
|
+
rescue ::LoadError
|
195
|
+
false
|
196
|
+
end
|
197
|
+
|
92
198
|
##
|
93
199
|
# Configure the google-cloud-commerce-consumer-procurement library.
|
94
200
|
#
|
metadata
CHANGED
@@ -1,35 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-commerce-consumer-procurement
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-commerce-consumer-procurement-v1
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.3'
|
20
|
-
- - "<"
|
16
|
+
- - "~>"
|
21
17
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
18
|
+
version: '1.1'
|
23
19
|
type: :runtime
|
24
20
|
prerelease: false
|
25
21
|
version_requirements: !ruby/object:Gem::Requirement
|
26
22
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0.3'
|
30
|
-
- - "<"
|
23
|
+
- - "~>"
|
31
24
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
25
|
+
version: '1.1'
|
33
26
|
- !ruby/object:Gem::Dependency
|
34
27
|
name: google-cloud-core
|
35
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +54,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
61
54
|
licenses:
|
62
55
|
- Apache-2.0
|
63
56
|
metadata: {}
|
64
|
-
post_install_message:
|
65
57
|
rdoc_options: []
|
66
58
|
require_paths:
|
67
59
|
- lib
|
@@ -69,15 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
61
|
requirements:
|
70
62
|
- - ">="
|
71
63
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
64
|
+
version: '3.0'
|
73
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
66
|
requirements:
|
75
67
|
- - ">="
|
76
68
|
- !ruby/object:Gem::Version
|
77
69
|
version: '0'
|
78
70
|
requirements: []
|
79
|
-
rubygems_version: 3.
|
80
|
-
signing_key:
|
71
|
+
rubygems_version: 3.6.2
|
81
72
|
specification_version: 4
|
82
73
|
summary: Enables consumers to procure products served by Cloud Marketplace platform.
|
83
74
|
test_files: []
|