google-cloud-monitoring 0.25.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 05bb95e98dc3f0c69cdbf51c258ae2ac0e8bc46d
4
- data.tar.gz: 9eefc90e8d84691e7e2a2f78fba442d8d99235a7
2
+ SHA256:
3
+ metadata.gz: 2fc728f5655949b2cb01436fbffb1645e3410f80516e28c4c6ac737a444baf04
4
+ data.tar.gz: dd11745defa0ad42c0e3a0ae031480114714ebd17ee0da3f8a41690fe4eb55f1
5
5
  SHA512:
6
- metadata.gz: 70ac93cc06d5993bc2cc45f0f69cc24cde1bb59e2e317f3b4eb32bfa3ea5ef0c43eb63a664701dd62aa178d66b5e8a8159c2274f0a7993e2648273399e01c4e8
7
- data.tar.gz: d1abae8219dff92e473240d77aa32e9b9fd13d2a920bec110950004d201aa8094de54d3c6a3c29ea470f22eb7aa7916a323f12c97f458ebc85c9e31554fe051e
6
+ metadata.gz: 3803f01f65283231049136ed9bcb0560b9e194bb3f4ec99a386fd14ec0638a2041f16e817bdd8867f43e23efac2efdd035eb9d1bbf53d6cd50265cb26d6f41a6
7
+ data.tar.gz: d0b8d27ddf88c29cf6f5bb94641adab74400ec5b625356e5dd8e4979e236826a0553c3263c2e54928114ed40f61dd8afd0ec6cb0f353d8c696cc5236a532917b
data/.yardopts CHANGED
@@ -1,6 +1,6 @@
1
1
  --no-private
2
- --title=Stackdriver Monitoring
3
- --exclude lib/google/monitoring/v3
2
+ --title=Stackdriver Monitoring API
3
+ --exclude _pb\.rb$
4
4
  --markup markdown
5
5
 
6
6
  ./lib/**/*.rb
data/README.md CHANGED
@@ -1,15 +1,18 @@
1
- # Ruby Client for Stackdriver Monitoring API (Alpha)
2
-
3
- Idiomatic Ruby client for [Stackdriver Monitoring API][Product Documentation]
1
+ # Ruby Client for Stackdriver Monitoring API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
4
2
 
3
+ [Stackdriver Monitoring API][Product Documentation]:
4
+ Manages your Stackdriver Monitoring data and configurations. Most projects must
5
+ be associated with a Stackdriver account, with a few exceptions as noted on the
6
+ individual method pages.
5
7
  - [Client Library Documentation][]
6
8
  - [Product Documentation][]
7
9
 
8
10
  ## Quick Start
9
- In order to use this library, you first need to go through the following steps:
11
+ In order to use this library, you first need to go through the following
12
+ steps:
10
13
 
11
14
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
12
- 2. [Enable the monitoring api.](https://console.cloud.google.com/apis/api/monitoring)
15
+ 2. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/api/monitoring)
13
16
  3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
14
17
 
15
18
  ### Installation
@@ -20,31 +23,32 @@ $ gem install google-cloud-monitoring
20
23
  ### Preview
21
24
  #### MetricServiceClient
22
25
  ```rb
23
- require "google/cloud/monitoring/v3"
24
-
25
- MetricServiceClient = Google::Cloud::Monitoring::V3::MetricServiceClient
26
-
27
- metric_service_client = MetricServiceClient.new
28
- formatted_name = MetricServiceClient.project_path(project_id)
29
-
30
- # Iterate over all results.
31
- metric_service_client.list_monitored_resource_descriptors(formatted_name).each do |element|
32
- # Process element.
33
- end
34
-
35
- # Or iterate over results one page at a time.
36
- metric_service_client.list_monitored_resource_descriptors(formatted_name).each_page do |page|
37
- # Process each page at a time.
38
- page.each do |element|
39
- # Process element.
40
- end
41
- end
26
+ require "google/cloud/monitoring"
27
+
28
+ metric_service_client = Google::Cloud::Monitoring::Metric.new
29
+ formatted_name = Google::Cloud::Monitoring::V3::MetricServiceClient.project_path(project_id)
30
+
31
+ # Iterate over all results.
32
+ metric_service_client.list_monitored_resource_descriptors(formatted_name).each do |element|
33
+ # Process element.
34
+ end
35
+
36
+ # Or iterate over results one page at a time.
37
+ metric_service_client.list_monitored_resource_descriptors(formatted_name).each_page do |page|
38
+ # Process each page at a time.
39
+ page.each do |element|
40
+ # Process element.
41
+ end
42
+ end
42
43
  ```
43
44
 
44
45
  ### Next Steps
45
- - Read the [Client Library Documentation][] for Stackdriver Monitoring API to see other available methods on the client.
46
- - Read the [Stackdriver Monitoring API Product documentation][Product Documentation] to learn more about the product and see How-to Guides.
47
- - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md) to see the full list of Cloud APIs that we cover.
46
+ - Read the [Client Library Documentation][] for Stackdriver Monitoring API
47
+ to see other available methods on the client.
48
+ - Read the [Stackdriver Monitoring API Product documentation][Product Documentation]
49
+ to learn more about the product and see How-to Guides.
50
+ - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
51
+ to see the full list of Cloud APIs that we cover.
48
52
 
49
53
  [Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-monitoring/latest/google/monitoring/v3
50
- [Product Documentation]: https://cloud.google.com/monitoring
54
+ [Product Documentation]: https://cloud.google.com/monitoring
@@ -13,8 +13,6 @@
13
13
  # limitations under the License.
14
14
 
15
15
  ##
16
- # This file is here to be autorequired by bundler, so that the .logging and
17
- # #logging methods can be available, but the library and all dependencies won't
18
- # be loaded until required and used.
16
+ # This file is here to be autorequired by bundler.
19
17
 
20
18
  # There is no Google::Cloud integration to add.
@@ -0,0 +1,188 @@
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/gax"
16
+ require "pathname"
17
+
18
+ module Google
19
+ module Cloud
20
+ # rubocop:disable LineLength
21
+
22
+ ##
23
+ # # Ruby Client for Stackdriver Monitoring API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
24
+ #
25
+ # [Stackdriver Monitoring API][Product Documentation]:
26
+ # Manages your Stackdriver Monitoring data and configurations. Most projects must
27
+ # be associated with a Stackdriver account, with a few exceptions as noted on the
28
+ # individual method pages.
29
+ # - [Product Documentation][]
30
+ #
31
+ # ## Quick Start
32
+ # In order to use this library, you first need to go through the following
33
+ # steps:
34
+ #
35
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
+ # 2. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/api/monitoring)
37
+ # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
38
+ #
39
+ # ### Preview
40
+ # #### MetricServiceClient
41
+ # ```rb
42
+ # require "google/cloud/monitoring"
43
+ #
44
+ # metric_service_client = Google::Cloud::Monitoring::Metric.new
45
+ # formatted_name = Google::Cloud::Monitoring::V3::MetricServiceClient.project_path(project_id)
46
+ #
47
+ # # Iterate over all results.
48
+ # metric_service_client.list_monitored_resource_descriptors(formatted_name).each do |element|
49
+ # # Process element.
50
+ # end
51
+ #
52
+ # # Or iterate over results one page at a time.
53
+ # metric_service_client.list_monitored_resource_descriptors(formatted_name).each_page do |page|
54
+ # # Process each page at a time.
55
+ # page.each do |element|
56
+ # # Process element.
57
+ # end
58
+ # end
59
+ # ```
60
+ #
61
+ # ### Next Steps
62
+ # - Read the [Stackdriver Monitoring API Product documentation][Product Documentation]
63
+ # to learn more about the product and see How-to Guides.
64
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
65
+ # to see the full list of Cloud APIs that we cover.
66
+ #
67
+ # [Product Documentation]: https://cloud.google.com/monitoring
68
+ #
69
+ #
70
+ module Monitoring
71
+ # rubocop:enable LineLength
72
+
73
+ FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("monitoring"))
74
+
75
+ AVAILABLE_VERSIONS = Dir["#{FILE_DIR}/*"]
76
+ .select { |file| File.directory?(file) }
77
+ .select { |dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }
78
+ .select { |dir| File.exist?(dir + ".rb") }
79
+ .map { |dir| File.basename(dir) }
80
+
81
+ module Group
82
+ ##
83
+ # The Group API lets you inspect and manage your
84
+ # [groups](https://cloud.google.comgoogle.monitoring.v3.Group).
85
+ #
86
+ # A group is a named filter that is used to identify
87
+ # a collection of monitored resources. Groups are typically used to
88
+ # mirror the physical and/or logical topology of the environment.
89
+ # Because group membership is computed dynamically, monitored
90
+ # resources that are started in the future are automatically placed
91
+ # in matching groups. By using a group to name monitored resources in,
92
+ # for example, an alert policy, the target of that alert policy is
93
+ # updated automatically as monitored resources are added and removed
94
+ # from the infrastructure.
95
+ #
96
+ # @param version [Symbol, String]
97
+ # The major version of the service to be used. By default :v3
98
+ # is used.
99
+ # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
100
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
101
+ # Provides the means for authenticating requests made by the client. This parameter can
102
+ # be many types.
103
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
104
+ # authenticating requests made by this client.
105
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
106
+ # credentials for this client.
107
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
108
+ # credentials for this client.
109
+ # A `GRPC::Core::Channel` will be used to make calls through.
110
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
111
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
112
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
113
+ # metadata for requests, generally, to give OAuth credentials.
114
+ # @param scopes [Array<String>]
115
+ # The OAuth scopes for this service. This parameter is ignored if
116
+ # an updater_proc is supplied.
117
+ # @param client_config [Hash]
118
+ # A Hash for call options for each method. See
119
+ # Google::Gax#construct_settings for the structure of
120
+ # this data. Falls back to the default config if not specified
121
+ # or the specified config is missing data points.
122
+ # @param timeout [Numeric]
123
+ # The default timeout, in seconds, for calls made through this client.
124
+ def self.new(*args, version: :v3, **kwargs)
125
+ unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
126
+ raise "The version: #{version} is not available. The available versions " \
127
+ "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
128
+ end
129
+
130
+ require "#{FILE_DIR}/#{version.to_s.downcase}"
131
+ version_module = Google::Cloud::Monitoring
132
+ .constants
133
+ .select {|sym| sym.to_s.downcase == version.to_s.downcase}
134
+ .first
135
+ Google::Cloud::Monitoring.const_get(version_module)::Group.new(*args, **kwargs)
136
+ end
137
+ end
138
+
139
+ module Metric
140
+ ##
141
+ # Manages metric descriptors, monitored resource descriptors, and
142
+ # time series data.
143
+ #
144
+ # @param version [Symbol, String]
145
+ # The major version of the service to be used. By default :v3
146
+ # is used.
147
+ # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
148
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
149
+ # Provides the means for authenticating requests made by the client. This parameter can
150
+ # be many types.
151
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
152
+ # authenticating requests made by this client.
153
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
154
+ # credentials for this client.
155
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
156
+ # credentials for this client.
157
+ # A `GRPC::Core::Channel` will be used to make calls through.
158
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
159
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
160
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
161
+ # metadata for requests, generally, to give OAuth credentials.
162
+ # @param scopes [Array<String>]
163
+ # The OAuth scopes for this service. This parameter is ignored if
164
+ # an updater_proc is supplied.
165
+ # @param client_config [Hash]
166
+ # A Hash for call options for each method. See
167
+ # Google::Gax#construct_settings for the structure of
168
+ # this data. Falls back to the default config if not specified
169
+ # or the specified config is missing data points.
170
+ # @param timeout [Numeric]
171
+ # The default timeout, in seconds, for calls made through this client.
172
+ def self.new(*args, version: :v3, **kwargs)
173
+ unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
174
+ raise "The version: #{version} is not available. The available versions " \
175
+ "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
176
+ end
177
+
178
+ require "#{FILE_DIR}/#{version.to_s.downcase}"
179
+ version_module = Google::Cloud::Monitoring
180
+ .constants
181
+ .select {|sym| sym.to_s.downcase == version.to_s.downcase}
182
+ .first
183
+ Google::Cloud::Monitoring.const_get(version_module)::Metric.new(*args, **kwargs)
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,33 @@
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "googleauth"
16
+
17
+ module Google
18
+ module Cloud
19
+ module Monitoring
20
+ class Credentials < Google::Auth::Credentials
21
+ SCOPE = [
22
+ "https://www.googleapis.com/auth/cloud-platform",
23
+ "https://www.googleapis.com/auth/monitoring",
24
+ "https://www.googleapis.com/auth/monitoring.read",
25
+ "https://www.googleapis.com/auth/monitoring.write"
26
+ ].freeze
27
+ PATH_ENV_VARS = %w(MONITORING_KEYFILE, GOOGLE_CLOUD_KEYFILE, GCLOUD_KEYFILE)
28
+ JSON_ENV_VARS = %w(MONITORING_KEYFILE_JSON, GOOGLE_CLOUD_KEYFILE_JSON, GCLOUD_KEYFILE_JSON)
29
+ DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,4 @@
1
-
2
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
5
4
  # you may not use this file except in compliance with the License.
@@ -13,6 +12,191 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
16
-
17
15
  require "google/cloud/monitoring/v3/group_service_client"
18
16
  require "google/cloud/monitoring/v3/metric_service_client"
17
+
18
+ module Google
19
+ module Cloud
20
+ # rubocop:disable LineLength
21
+
22
+ ##
23
+ # # Ruby Client for Stackdriver Monitoring API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
24
+ #
25
+ # [Stackdriver Monitoring API][Product Documentation]:
26
+ # Manages your Stackdriver Monitoring data and configurations. Most projects must
27
+ # be associated with a Stackdriver account, with a few exceptions as noted on the
28
+ # individual method pages.
29
+ # - [Product Documentation][]
30
+ #
31
+ # ## Quick Start
32
+ # In order to use this library, you first need to go through the following
33
+ # steps:
34
+ #
35
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
+ # 2. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/api/monitoring)
37
+ # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
38
+ #
39
+ # ### Preview
40
+ # #### MetricServiceClient
41
+ # ```rb
42
+ # require "google/cloud/monitoring/v3"
43
+ #
44
+ # metric_service_client = Google::Cloud::Monitoring::V3::Metric.new
45
+ # formatted_name = Google::Cloud::Monitoring::V3::MetricServiceClient.project_path(project_id)
46
+ #
47
+ # # Iterate over all results.
48
+ # metric_service_client.list_monitored_resource_descriptors(formatted_name).each do |element|
49
+ # # Process element.
50
+ # end
51
+ #
52
+ # # Or iterate over results one page at a time.
53
+ # metric_service_client.list_monitored_resource_descriptors(formatted_name).each_page do |page|
54
+ # # Process each page at a time.
55
+ # page.each do |element|
56
+ # # Process element.
57
+ # end
58
+ # end
59
+ # ```
60
+ #
61
+ # ### Next Steps
62
+ # - Read the [Stackdriver Monitoring API Product documentation][Product Documentation]
63
+ # to learn more about the product and see How-to Guides.
64
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
65
+ # to see the full list of Cloud APIs that we cover.
66
+ #
67
+ # [Product Documentation]: https://cloud.google.com/monitoring
68
+ #
69
+ #
70
+ module Monitoring
71
+ module V3
72
+ # rubocop:enable LineLength
73
+
74
+ module Group
75
+ ##
76
+ # The Group API lets you inspect and manage your
77
+ # [groups](https://cloud.google.comgoogle.monitoring.v3.Group).
78
+ #
79
+ # A group is a named filter that is used to identify
80
+ # a collection of monitored resources. Groups are typically used to
81
+ # mirror the physical and/or logical topology of the environment.
82
+ # Because group membership is computed dynamically, monitored
83
+ # resources that are started in the future are automatically placed
84
+ # in matching groups. By using a group to name monitored resources in,
85
+ # for example, an alert policy, the target of that alert policy is
86
+ # updated automatically as monitored resources are added and removed
87
+ # from the infrastructure.
88
+ #
89
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
90
+ # Provides the means for authenticating requests made by the client. This parameter can
91
+ # be many types.
92
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
93
+ # authenticating requests made by this client.
94
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
95
+ # credentials for this client.
96
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
97
+ # credentials for this client.
98
+ # A `GRPC::Core::Channel` will be used to make calls through.
99
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
100
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
101
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
102
+ # metadata for requests, generally, to give OAuth credentials.
103
+ # @param scopes [Array<String>]
104
+ # The OAuth scopes for this service. This parameter is ignored if
105
+ # an updater_proc is supplied.
106
+ # @param client_config [Hash]
107
+ # A Hash for call options for each method. See
108
+ # Google::Gax#construct_settings for the structure of
109
+ # this data. Falls back to the default config if not specified
110
+ # or the specified config is missing data points.
111
+ # @param timeout [Numeric]
112
+ # The default timeout, in seconds, for calls made through this client.
113
+ def self.new \
114
+ service_path: nil,
115
+ port: nil,
116
+ channel: nil,
117
+ chan_creds: nil,
118
+ updater_proc: nil,
119
+ credentials: nil,
120
+ scopes: nil,
121
+ client_config: nil,
122
+ timeout: nil,
123
+ lib_name: nil,
124
+ lib_version: nil
125
+ kwargs = {
126
+ service_path: service_path,
127
+ port: port,
128
+ channel: channel,
129
+ chan_creds: chan_creds,
130
+ updater_proc: updater_proc,
131
+ credentials: credentials,
132
+ scopes: scopes,
133
+ client_config: client_config,
134
+ timeout: timeout,
135
+ lib_name: lib_name,
136
+ lib_version: lib_version
137
+ }.select { |_, v| v != nil }
138
+ Google::Cloud::Monitoring::V3::GroupServiceClient.new(**kwargs)
139
+ end
140
+ end
141
+
142
+ module Metric
143
+ ##
144
+ # Manages metric descriptors, monitored resource descriptors, and
145
+ # time series data.
146
+ #
147
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
148
+ # Provides the means for authenticating requests made by the client. This parameter can
149
+ # be many types.
150
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
151
+ # authenticating requests made by this client.
152
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
153
+ # credentials for this client.
154
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
155
+ # credentials for this client.
156
+ # A `GRPC::Core::Channel` will be used to make calls through.
157
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
158
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
159
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
160
+ # metadata for requests, generally, to give OAuth credentials.
161
+ # @param scopes [Array<String>]
162
+ # The OAuth scopes for this service. This parameter is ignored if
163
+ # an updater_proc is supplied.
164
+ # @param client_config [Hash]
165
+ # A Hash for call options for each method. See
166
+ # Google::Gax#construct_settings for the structure of
167
+ # this data. Falls back to the default config if not specified
168
+ # or the specified config is missing data points.
169
+ # @param timeout [Numeric]
170
+ # The default timeout, in seconds, for calls made through this client.
171
+ def self.new \
172
+ service_path: nil,
173
+ port: nil,
174
+ channel: nil,
175
+ chan_creds: nil,
176
+ updater_proc: nil,
177
+ credentials: nil,
178
+ scopes: nil,
179
+ client_config: nil,
180
+ timeout: nil,
181
+ lib_name: nil,
182
+ lib_version: nil
183
+ kwargs = {
184
+ service_path: service_path,
185
+ port: port,
186
+ channel: channel,
187
+ chan_creds: chan_creds,
188
+ updater_proc: updater_proc,
189
+ credentials: credentials,
190
+ scopes: scopes,
191
+ client_config: client_config,
192
+ timeout: timeout,
193
+ lib_name: lib_name,
194
+ lib_version: lib_version
195
+ }.select { |_, v| v != nil }
196
+ Google::Cloud::Monitoring::V3::MetricServiceClient.new(**kwargs)
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
202
+ end