google-cloud-channel 1.1.0 → 1.3.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 +4 -4
- data/AUTHENTICATION.md +6 -6
- data/README.md +0 -26
- data/lib/google/cloud/channel/version.rb +1 -1
- data/lib/google/cloud/channel.rb +56 -14
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bf1e03ac4e18a64b54dfaaf6490b4b3b06f5da933cd9cea34ce3017f99876f2
|
4
|
+
data.tar.gz: 73b671a07910592f30c77ccda520e00cfcbd43466a2960404a7194de5379d629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594b8979f5b68460faae440b0866c12bffad3ae94ee9a6e00904f8f72c00b783d47d00b142d397cba15f203985aef3bcb6c8ad6033100e1e46d0c8277a8da7a0
|
7
|
+
data.tar.gz: 075b542ac44bd62279838042dc147b81bde7c04e6644832e6082f9aad558b3533e5372a880a5b33a269aad77ec1669b59bef0a7c4de82eaf3229365b8543cd8c
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export CHANNEL_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/channel"
|
29
29
|
|
30
|
-
client = Google::Cloud::Channel.
|
30
|
+
client = Google::Cloud::Channel.cloud_channel_reports_service
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-channel
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
`::Google::Cloud::Channel::V1::
|
67
|
+
`::Google::Cloud::Channel::V1::CloudChannelReportsService::Credentials`):
|
68
68
|
|
69
69
|
* `CHANNEL_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
* `CHANNEL_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -77,7 +77,7 @@ require "google/cloud/channel"
|
|
77
77
|
|
78
78
|
ENV["CHANNEL_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::Channel.
|
80
|
+
client = Google::Cloud::Channel.cloud_channel_reports_service
|
81
81
|
```
|
82
82
|
|
83
83
|
### Configuration
|
@@ -88,7 +88,7 @@ it in an environment variable. Either on an individual client initialization:
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/channel"
|
90
90
|
|
91
|
-
client = Google::Cloud::Channel.
|
91
|
+
client = Google::Cloud::Channel.cloud_channel_reports_service do |config|
|
92
92
|
config.credentials = "path/to/keyfile.json"
|
93
93
|
end
|
94
94
|
```
|
@@ -102,7 +102,7 @@ Google::Cloud::Channel.configure do |config|
|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::Channel.
|
105
|
+
client = Google::Cloud::Channel.cloud_channel_reports_service
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -34,32 +34,6 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudchannel.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
-
## Enabling Logging
|
38
|
-
|
39
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
40
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
41
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
42
|
-
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
43
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
44
|
-
|
45
|
-
Configuring a Ruby stdlib logger:
|
46
|
-
|
47
|
-
```ruby
|
48
|
-
require "logger"
|
49
|
-
|
50
|
-
module MyLogger
|
51
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
52
|
-
def logger
|
53
|
-
LOGGER
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
58
|
-
module GRPC
|
59
|
-
extend MyLogger
|
60
|
-
end
|
61
|
-
```
|
62
|
-
|
63
37
|
## Supported Ruby Versions
|
64
38
|
|
65
39
|
This library is supported on Ruby 2.6+.
|
data/lib/google/cloud/channel.rb
CHANGED
@@ -44,16 +44,55 @@ end
|
|
44
44
|
module Google
|
45
45
|
module Cloud
|
46
46
|
module Channel
|
47
|
+
##
|
48
|
+
# Create a new client object for CloudChannelReportsService.
|
49
|
+
#
|
50
|
+
# By default, this returns an instance of
|
51
|
+
# [Google::Cloud::Channel::V1::CloudChannelReportsService::Client](https://googleapis.dev/ruby/google-cloud-channel-v1/latest/Google/Cloud/Channel/V1/CloudChannelReportsService/Client.html)
|
52
|
+
# for a gRPC client for version V1 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
|
+
# `version` parameter. If the CloudChannelReportsService service is
|
55
|
+
# supported by that API version, and the corresponding gem is available, the
|
56
|
+
# appropriate versioned client will be returned.
|
57
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
58
|
+
# the `transport` parameter.
|
59
|
+
#
|
60
|
+
# ## About CloudChannelReportsService
|
61
|
+
#
|
62
|
+
# CloudChannelReportsService lets Google Cloud resellers and
|
63
|
+
# distributors retrieve and combine a variety of data in Cloud Channel for
|
64
|
+
# multiple products (Google Cloud Platform (GCP), Google Voice, and
|
65
|
+
# Google Workspace.)
|
66
|
+
#
|
67
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
68
|
+
# Defaults to `:v1`.
|
69
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
70
|
+
# @return [::Object] A client object for the specified version.
|
71
|
+
#
|
72
|
+
def self.cloud_channel_reports_service version: :v1, transport: :grpc, &block
|
73
|
+
require "google/cloud/channel/#{version.to_s.downcase}"
|
74
|
+
|
75
|
+
package_name = Google::Cloud::Channel
|
76
|
+
.constants
|
77
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
78
|
+
.first
|
79
|
+
service_module = Google::Cloud::Channel.const_get(package_name).const_get(:CloudChannelReportsService)
|
80
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
81
|
+
service_module.const_get(:Client).new(&block)
|
82
|
+
end
|
83
|
+
|
47
84
|
##
|
48
85
|
# Create a new client object for CloudChannelService.
|
49
86
|
#
|
50
87
|
# By default, this returns an instance of
|
51
88
|
# [Google::Cloud::Channel::V1::CloudChannelService::Client](https://googleapis.dev/ruby/google-cloud-channel-v1/latest/Google/Cloud/Channel/V1/CloudChannelService/Client.html)
|
52
|
-
# for version V1 of the API.
|
53
|
-
# However, you can specify
|
89
|
+
# for a gRPC client for version V1 of the API.
|
90
|
+
# However, you can specify a different API version by passing it in the
|
54
91
|
# `version` parameter. If the CloudChannelService service is
|
55
92
|
# supported by that API version, and the corresponding gem is available, the
|
56
93
|
# appropriate versioned client will be returned.
|
94
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
95
|
+
# the `transport` parameter.
|
57
96
|
#
|
58
97
|
# ## About CloudChannelService
|
59
98
|
#
|
@@ -67,29 +106,32 @@ module Google
|
|
67
106
|
# 3. Resellers and distributors can manage customer entitlements.
|
68
107
|
#
|
69
108
|
# CloudChannelService exposes the following resources:
|
70
|
-
# - Customers: An entity
|
71
|
-
# distributor.
|
109
|
+
# - Customers: An entity-usually an
|
110
|
+
# enterprise-managed by a reseller or distributor.
|
72
111
|
#
|
73
|
-
# - Entitlements: An entity that
|
74
|
-
# a
|
75
|
-
# fulfillment.
|
112
|
+
# - Entitlements: An entity that
|
113
|
+
# provides a customer with the means to use a service. Entitlements are created
|
114
|
+
# or updated as a result of a successful fulfillment.
|
76
115
|
#
|
77
|
-
# - ChannelPartnerLinks: An
|
78
|
-
# distributors and their indirect
|
116
|
+
# - ChannelPartnerLinks: An
|
117
|
+
# entity that identifies links between distributors and their indirect
|
118
|
+
# resellers in a channel.
|
79
119
|
#
|
80
120
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
81
121
|
# Defaults to `:v1`.
|
82
|
-
# @
|
122
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
123
|
+
# @return [::Object] A client object for the specified version.
|
83
124
|
#
|
84
|
-
def self.cloud_channel_service version: :v1, &block
|
125
|
+
def self.cloud_channel_service version: :v1, transport: :grpc, &block
|
85
126
|
require "google/cloud/channel/#{version.to_s.downcase}"
|
86
127
|
|
87
128
|
package_name = Google::Cloud::Channel
|
88
129
|
.constants
|
89
130
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
90
131
|
.first
|
91
|
-
|
92
|
-
|
132
|
+
service_module = Google::Cloud::Channel.const_get(package_name).const_get(:CloudChannelService)
|
133
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
134
|
+
service_module.const_get(:Client).new(&block)
|
93
135
|
end
|
94
136
|
|
95
137
|
##
|
@@ -109,7 +151,7 @@ module Google
|
|
109
151
|
# * `timeout` (*type:* `Numeric`) -
|
110
152
|
# Default timeout in seconds.
|
111
153
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
112
|
-
# Additional
|
154
|
+
# Additional headers to be sent with the call.
|
113
155
|
# * `retry_policy` (*type:* `Hash`) -
|
114
156
|
# The retry policy. The value is a hash with the following keys:
|
115
157
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-channel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-channel-v1
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.16'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.16'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
rubygems_version: 3.
|
193
|
+
rubygems_version: 3.4.2
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: API Client library for the Cloud Channel API
|