google-cloud-monitoring-v3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-monitoring-v3.rb +21 -0
  7. data/lib/google/cloud/monitoring/v3.rb +40 -0
  8. data/lib/google/cloud/monitoring/v3/alert_policy_service.rb +57 -0
  9. data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +772 -0
  10. data/lib/google/cloud/monitoring/v3/alert_policy_service/credentials.rb +53 -0
  11. data/lib/google/cloud/monitoring/v3/alert_policy_service/paths.rb +185 -0
  12. data/lib/google/cloud/monitoring/v3/group_service.rb +60 -0
  13. data/lib/google/cloud/monitoring/v3/group_service/client.rb +862 -0
  14. data/lib/google/cloud/monitoring/v3/group_service/credentials.rb +53 -0
  15. data/lib/google/cloud/monitoring/v3/group_service/paths.rb +127 -0
  16. data/lib/google/cloud/monitoring/v3/metric_service.rb +50 -0
  17. data/lib/google/cloud/monitoring/v3/metric_service/client.rb +1040 -0
  18. data/lib/google/cloud/monitoring/v3/metric_service/credentials.rb +54 -0
  19. data/lib/google/cloud/monitoring/v3/metric_service/paths.rb +179 -0
  20. data/lib/google/cloud/monitoring/v3/notification_channel_service.rb +50 -0
  21. data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +1213 -0
  22. data/lib/google/cloud/monitoring/v3/notification_channel_service/credentials.rb +53 -0
  23. data/lib/google/cloud/monitoring/v3/notification_channel_service/paths.rb +179 -0
  24. data/lib/google/cloud/monitoring/v3/service_monitoring_service.rb +52 -0
  25. data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +1168 -0
  26. data/lib/google/cloud/monitoring/v3/service_monitoring_service/credentials.rb +53 -0
  27. data/lib/google/cloud/monitoring/v3/service_monitoring_service/paths.rb +185 -0
  28. data/lib/google/cloud/monitoring/v3/uptime_check_service.rb +56 -0
  29. data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +822 -0
  30. data/lib/google/cloud/monitoring/v3/uptime_check_service/credentials.rb +53 -0
  31. data/lib/google/cloud/monitoring/v3/uptime_check_service/paths.rb +127 -0
  32. data/lib/google/cloud/monitoring/v3/version.rb +28 -0
  33. data/lib/google/monitoring/v3/alert_pb.rb +84 -0
  34. data/lib/google/monitoring/v3/alert_service_pb.rb +56 -0
  35. data/lib/google/monitoring/v3/alert_service_services_pb.rb +64 -0
  36. data/lib/google/monitoring/v3/common_pb.rb +98 -0
  37. data/lib/google/monitoring/v3/dropped_labels_pb.rb +22 -0
  38. data/lib/google/monitoring/v3/group_pb.rb +27 -0
  39. data/lib/google/monitoring/v3/group_service_pb.rb +76 -0
  40. data/lib/google/monitoring/v3/group_service_services_pb.rb +67 -0
  41. data/lib/google/monitoring/v3/metric_pb.rb +85 -0
  42. data/lib/google/monitoring/v3/metric_service_pb.rb +133 -0
  43. data/lib/google/monitoring/v3/metric_service_services_pb.rb +67 -0
  44. data/lib/google/monitoring/v3/mutation_record_pb.rb +24 -0
  45. data/lib/google/monitoring/v3/notification_pb.rb +50 -0
  46. data/lib/google/monitoring/v3/notification_service_pb.rb +93 -0
  47. data/lib/google/monitoring/v3/notification_service_services_pb.rb +95 -0
  48. data/lib/google/monitoring/v3/service_pb.rb +152 -0
  49. data/lib/google/monitoring/v3/service_service_pb.rb +89 -0
  50. data/lib/google/monitoring/v3/service_service_services_pb.rb +66 -0
  51. data/lib/google/monitoring/v3/span_context_pb.rb +22 -0
  52. data/lib/google/monitoring/v3/uptime_pb.rb +126 -0
  53. data/lib/google/monitoring/v3/uptime_service_pb.rb +66 -0
  54. data/lib/google/monitoring/v3/uptime_service_services_pb.rb +68 -0
  55. data/proto_docs/README.md +4 -0
  56. data/proto_docs/google/api/distribution.rb +225 -0
  57. data/proto_docs/google/api/field_behavior.rb +59 -0
  58. data/proto_docs/google/api/label.rb +49 -0
  59. data/proto_docs/google/api/launch_stage.rb +65 -0
  60. data/proto_docs/google/api/metric.rb +203 -0
  61. data/proto_docs/google/api/monitored_resource.rb +137 -0
  62. data/proto_docs/google/api/resource.rb +247 -0
  63. data/proto_docs/google/monitoring/v3/alert.rb +359 -0
  64. data/proto_docs/google/monitoring/v3/alert_service.rb +162 -0
  65. data/proto_docs/google/monitoring/v3/common.rb +464 -0
  66. data/proto_docs/google/monitoring/v3/dropped_labels.rb +58 -0
  67. data/proto_docs/google/monitoring/v3/group.rb +84 -0
  68. data/proto_docs/google/monitoring/v3/group_service.rb +197 -0
  69. data/proto_docs/google/monitoring/v3/metric.rb +249 -0
  70. data/proto_docs/google/monitoring/v3/metric_service.rb +366 -0
  71. data/proto_docs/google/monitoring/v3/mutation_record.rb +38 -0
  72. data/proto_docs/google/monitoring/v3/notification.rb +186 -0
  73. data/proto_docs/google/monitoring/v3/notification_service.rb +266 -0
  74. data/proto_docs/google/monitoring/v3/service.rb +424 -0
  75. data/proto_docs/google/monitoring/v3/service_service.rb +239 -0
  76. data/proto_docs/google/monitoring/v3/span_context.rb +49 -0
  77. data/proto_docs/google/monitoring/v3/uptime.rb +403 -0
  78. data/proto_docs/google/monitoring/v3/uptime_service.rb +166 -0
  79. data/proto_docs/google/protobuf/any.rb +138 -0
  80. data/proto_docs/google/protobuf/duration.rb +98 -0
  81. data/proto_docs/google/protobuf/empty.rb +36 -0
  82. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  83. data/proto_docs/google/protobuf/struct.rb +96 -0
  84. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  85. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  86. data/proto_docs/google/rpc/status.rb +46 -0
  87. data/proto_docs/google/type/calendar_period.rb +55 -0
  88. metadata +269 -0
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Monitoring
24
+ module V3
25
+ module MetricService
26
+ # Credentials for the MetricService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/monitoring",
31
+ "https://www.googleapis.com/auth/monitoring.read",
32
+ "https://www.googleapis.com/auth/monitoring.write"
33
+ ]
34
+ self.env_vars = [
35
+ "MONITORING_CREDENTIALS",
36
+ "MONITORING_KEYFILE",
37
+ "GOOGLE_CLOUD_CREDENTIALS",
38
+ "GOOGLE_CLOUD_KEYFILE",
39
+ "GCLOUD_KEYFILE",
40
+ "MONITORING_CREDENTIALS_JSON",
41
+ "MONITORING_KEYFILE_JSON",
42
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
43
+ "GOOGLE_CLOUD_KEYFILE_JSON",
44
+ "GCLOUD_KEYFILE_JSON"
45
+ ]
46
+ self.paths = [
47
+ "~/.config/google_cloud/application_default_credentials.json"
48
+ ]
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Monitoring
23
+ module V3
24
+ module MetricService
25
+ # Path helper methods for the MetricService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Folder resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `folders/{folder}`
33
+ #
34
+ # @param folder [String]
35
+ #
36
+ # @return [::String]
37
+ def folder_path folder:
38
+ "folders/#{folder}"
39
+ end
40
+
41
+ ##
42
+ # Create a fully-qualified MetricDescriptor resource string.
43
+ #
44
+ # @overload metric_descriptor_path(project:, metric_descriptor:)
45
+ # The resource will be in the following format:
46
+ #
47
+ # `projects/{project}/metricDescriptors/{metric_descriptor=**}`
48
+ #
49
+ # @param project [String]
50
+ # @param metric_descriptor [String]
51
+ #
52
+ # @overload metric_descriptor_path(organization:, metric_descriptor:)
53
+ # The resource will be in the following format:
54
+ #
55
+ # `organizations/{organization}/metricDescriptors/{metric_descriptor=**}`
56
+ #
57
+ # @param organization [String]
58
+ # @param metric_descriptor [String]
59
+ #
60
+ # @overload metric_descriptor_path(folder:, metric_descriptor:)
61
+ # The resource will be in the following format:
62
+ #
63
+ # `folders/{folder}/metricDescriptors/{metric_descriptor=**}`
64
+ #
65
+ # @param folder [String]
66
+ # @param metric_descriptor [String]
67
+ #
68
+ # @return [::String]
69
+ def metric_descriptor_path **args
70
+ resources = {
71
+ "metric_descriptor:project" => (proc do |project:, metric_descriptor:|
72
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
73
+
74
+ "projects/#{project}/metricDescriptors/#{metric_descriptor}"
75
+ end),
76
+ "metric_descriptor:organization" => (proc do |organization:, metric_descriptor:|
77
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
78
+
79
+ "organizations/#{organization}/metricDescriptors/#{metric_descriptor}"
80
+ end),
81
+ "folder:metric_descriptor" => (proc do |folder:, metric_descriptor:|
82
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
83
+
84
+ "folders/#{folder}/metricDescriptors/#{metric_descriptor}"
85
+ end)
86
+ }
87
+
88
+ resource = resources[args.keys.sort.join(":")]
89
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
90
+ resource.call(**args)
91
+ end
92
+
93
+ ##
94
+ # Create a fully-qualified MonitoredResourceDescriptor resource string.
95
+ #
96
+ # @overload monitored_resource_descriptor_path(project:, monitored_resource_descriptor:)
97
+ # The resource will be in the following format:
98
+ #
99
+ # `projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}`
100
+ #
101
+ # @param project [String]
102
+ # @param monitored_resource_descriptor [String]
103
+ #
104
+ # @overload monitored_resource_descriptor_path(organization:, monitored_resource_descriptor:)
105
+ # The resource will be in the following format:
106
+ #
107
+ # `organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}`
108
+ #
109
+ # @param organization [String]
110
+ # @param monitored_resource_descriptor [String]
111
+ #
112
+ # @overload monitored_resource_descriptor_path(folder:, monitored_resource_descriptor:)
113
+ # The resource will be in the following format:
114
+ #
115
+ # `folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}`
116
+ #
117
+ # @param folder [String]
118
+ # @param monitored_resource_descriptor [String]
119
+ #
120
+ # @return [::String]
121
+ def monitored_resource_descriptor_path **args
122
+ resources = {
123
+ "monitored_resource_descriptor:project" => (proc do |project:, monitored_resource_descriptor:|
124
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
125
+
126
+ "projects/#{project}/monitoredResourceDescriptors/#{monitored_resource_descriptor}"
127
+ end),
128
+ "monitored_resource_descriptor:organization" => (proc do |organization:, monitored_resource_descriptor:|
129
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
130
+
131
+ "organizations/#{organization}/monitoredResourceDescriptors/#{monitored_resource_descriptor}"
132
+ end),
133
+ "folder:monitored_resource_descriptor" => (proc do |folder:, monitored_resource_descriptor:|
134
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
135
+
136
+ "folders/#{folder}/monitoredResourceDescriptors/#{monitored_resource_descriptor}"
137
+ end)
138
+ }
139
+
140
+ resource = resources[args.keys.sort.join(":")]
141
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
142
+ resource.call(**args)
143
+ end
144
+
145
+ ##
146
+ # Create a fully-qualified Organization resource string.
147
+ #
148
+ # The resource will be in the following format:
149
+ #
150
+ # `organizations/{organization}`
151
+ #
152
+ # @param organization [String]
153
+ #
154
+ # @return [::String]
155
+ def organization_path organization:
156
+ "organizations/#{organization}"
157
+ end
158
+
159
+ ##
160
+ # Create a fully-qualified Project resource string.
161
+ #
162
+ # The resource will be in the following format:
163
+ #
164
+ # `projects/{project}`
165
+ #
166
+ # @param project [String]
167
+ #
168
+ # @return [::String]
169
+ def project_path project:
170
+ "projects/#{project}"
171
+ end
172
+
173
+ extend self
174
+ end
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/monitoring/v3/version"
24
+
25
+ require "google/cloud/monitoring/v3/notification_channel_service/credentials"
26
+ require "google/cloud/monitoring/v3/notification_channel_service/paths"
27
+ require "google/cloud/monitoring/v3/notification_channel_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Monitoring
32
+ module V3
33
+ ##
34
+ # The Notification Channel API provides access to configuration that
35
+ # controls how messages related to incidents are sent.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/monitoring/v3/notification_channel_service"
40
+ # client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
41
+ #
42
+ module NotificationChannelService
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ helper_path = ::File.join __dir__, "notification_channel_service", "helpers.rb"
50
+ require "google/cloud/monitoring/v3/notification_channel_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1213 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/monitoring/v3/notification_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Monitoring
25
+ module V3
26
+ module NotificationChannelService
27
+ ##
28
+ # Client for the NotificationChannelService service.
29
+ #
30
+ # The Notification Channel API provides access to configuration that
31
+ # controls how messages related to incidents are sent.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :notification_channel_service_stub
38
+
39
+ ##
40
+ # Configure the NotificationChannelService Client class.
41
+ #
42
+ # See {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all NotificationChannelService clients:
48
+ #
49
+ # ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Monitoring", "V3"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const&.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.list_notification_channel_descriptors.timeout = 30.0
70
+ default_config.rpcs.list_notification_channel_descriptors.retry_policy = {
71
+ initial_delay: 0.1,
72
+ max_delay: 30.0,
73
+ multiplier: 1.3,
74
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
75
+ }
76
+
77
+ default_config.rpcs.get_notification_channel_descriptor.timeout = 30.0
78
+ default_config.rpcs.get_notification_channel_descriptor.retry_policy = {
79
+ initial_delay: 0.1,
80
+ max_delay: 30.0,
81
+ multiplier: 1.3,
82
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
83
+ }
84
+
85
+ default_config.rpcs.list_notification_channels.timeout = 30.0
86
+ default_config.rpcs.list_notification_channels.retry_policy = {
87
+ initial_delay: 0.1,
88
+ max_delay: 30.0,
89
+ multiplier: 1.3,
90
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
91
+ }
92
+
93
+ default_config.rpcs.get_notification_channel.timeout = 30.0
94
+ default_config.rpcs.get_notification_channel.retry_policy = {
95
+ initial_delay: 0.1,
96
+ max_delay: 30.0,
97
+ multiplier: 1.3,
98
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
99
+ }
100
+
101
+ default_config.rpcs.create_notification_channel.timeout = 30.0
102
+
103
+ default_config.rpcs.update_notification_channel.timeout = 30.0
104
+
105
+ default_config.rpcs.delete_notification_channel.timeout = 30.0
106
+ default_config.rpcs.delete_notification_channel.retry_policy = {
107
+ initial_delay: 0.1,
108
+ max_delay: 30.0,
109
+ multiplier: 1.3,
110
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
111
+ }
112
+
113
+ default_config.rpcs.send_notification_channel_verification_code.timeout = 30.0
114
+
115
+ default_config.rpcs.get_notification_channel_verification_code.timeout = 30.0
116
+ default_config.rpcs.get_notification_channel_verification_code.retry_policy = {
117
+ initial_delay: 0.1,
118
+ max_delay: 30.0,
119
+ multiplier: 1.3,
120
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
121
+ }
122
+
123
+ default_config.rpcs.verify_notification_channel.timeout = 30.0
124
+ default_config.rpcs.verify_notification_channel.retry_policy = {
125
+ initial_delay: 0.1,
126
+ max_delay: 30.0,
127
+ multiplier: 1.3,
128
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
129
+ }
130
+
131
+ default_config
132
+ end
133
+ yield @configure if block_given?
134
+ @configure
135
+ end
136
+
137
+ ##
138
+ # Configure the NotificationChannelService Client instance.
139
+ #
140
+ # The configuration is set to the derived mode, meaning that values can be changed,
141
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
142
+ # should be made on {Client.configure}.
143
+ #
144
+ # See {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client::Configuration}
145
+ # for a description of the configuration fields.
146
+ #
147
+ # @yield [config] Configure the Client client.
148
+ # @yieldparam config [Client::Configuration]
149
+ #
150
+ # @return [Client::Configuration]
151
+ #
152
+ def configure
153
+ yield @config if block_given?
154
+ @config
155
+ end
156
+
157
+ ##
158
+ # Create a new NotificationChannelService client object.
159
+ #
160
+ # ## Examples
161
+ #
162
+ # To create a new NotificationChannelService client with the default
163
+ # configuration:
164
+ #
165
+ # client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new
166
+ #
167
+ # To create a new NotificationChannelService client with a custom
168
+ # configuration:
169
+ #
170
+ # client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config|
171
+ # config.timeout = 10.0
172
+ # end
173
+ #
174
+ # @yield [config] Configure the NotificationChannelService client.
175
+ # @yieldparam config [Client::Configuration]
176
+ #
177
+ def initialize
178
+ # These require statements are intentionally placed here to initialize
179
+ # the gRPC module only when it's required.
180
+ # See https://github.com/googleapis/toolkit/issues/446
181
+ require "gapic/grpc"
182
+ require "google/monitoring/v3/notification_service_services_pb"
183
+
184
+ # Create the configuration object
185
+ @config = Configuration.new Client.configure
186
+
187
+ # Yield the configuration if needed
188
+ yield @config if block_given?
189
+
190
+ # Create credentials
191
+ credentials = @config.credentials
192
+ credentials ||= Credentials.default scope: @config.scope
193
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
194
+ credentials = Credentials.new credentials, scope: @config.scope
195
+ end
196
+ @quota_project_id = @config.quota_project
197
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
198
+
199
+ @notification_channel_service_stub = ::Gapic::ServiceStub.new(
200
+ ::Google::Cloud::Monitoring::V3::NotificationChannelService::Stub,
201
+ credentials: credentials,
202
+ endpoint: @config.endpoint,
203
+ channel_args: @config.channel_args,
204
+ interceptors: @config.interceptors
205
+ )
206
+ end
207
+
208
+ # Service calls
209
+
210
+ ##
211
+ # Lists the descriptors for supported channel types. The use of descriptors
212
+ # makes it possible for new channel types to be dynamically added.
213
+ #
214
+ # @overload list_notification_channel_descriptors(request, options = nil)
215
+ # Pass arguments to `list_notification_channel_descriptors` via a request object, either of type
216
+ # {::Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest} or an equivalent Hash.
217
+ #
218
+ # @param request [::Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest, ::Hash]
219
+ # A request object representing the call parameters. Required. To specify no
220
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
221
+ # @param options [::Gapic::CallOptions, ::Hash]
222
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
223
+ #
224
+ # @overload list_notification_channel_descriptors(name: nil, page_size: nil, page_token: nil)
225
+ # Pass arguments to `list_notification_channel_descriptors` via keyword arguments. Note that at
226
+ # least one keyword argument is required. To specify no parameters, or to keep all
227
+ # the default parameter values, pass an empty Hash as a request object (see above).
228
+ #
229
+ # @param name [::String]
230
+ # Required. The REST resource name of the parent from which to retrieve
231
+ # the notification channel descriptors. The expected syntax is:
232
+ #
233
+ # projects/[PROJECT_ID_OR_NUMBER]
234
+ #
235
+ # Note that this names the parent container in which to look for the
236
+ # descriptors; to retrieve a single descriptor by name, use the
237
+ # {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel_descriptor GetNotificationChannelDescriptor}
238
+ # operation, instead.
239
+ # @param page_size [::Integer]
240
+ # The maximum number of results to return in a single response. If
241
+ # not set to a positive number, a reasonable value will be chosen by the
242
+ # service.
243
+ # @param page_token [::String]
244
+ # If non-empty, `page_token` must contain a value returned as the
245
+ # `next_page_token` in a previous response to request the next set
246
+ # of results.
247
+ #
248
+ # @yield [response, operation] Access the result along with the RPC operation
249
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor>]
250
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
251
+ #
252
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor>]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
255
+ #
256
+ def list_notification_channel_descriptors request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ metadata = @config.rpcs.list_notification_channel_descriptors.metadata.to_h
266
+
267
+ # Set x-goog-api-client and x-goog-user-project headers
268
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
271
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
272
+
273
+ header_params = {
274
+ "name" => request.name
275
+ }
276
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
277
+ metadata[:"x-goog-request-params"] ||= request_params_header
278
+
279
+ options.apply_defaults timeout: @config.rpcs.list_notification_channel_descriptors.timeout,
280
+ metadata: metadata,
281
+ retry_policy: @config.rpcs.list_notification_channel_descriptors.retry_policy
282
+ options.apply_defaults metadata: @config.metadata,
283
+ retry_policy: @config.retry_policy
284
+
285
+ @notification_channel_service_stub.call_rpc :list_notification_channel_descriptors, request, options: options do |response, operation|
286
+ response = ::Gapic::PagedEnumerable.new @notification_channel_service_stub, :list_notification_channel_descriptors, request, response, operation, options
287
+ yield response, operation if block_given?
288
+ return response
289
+ end
290
+ rescue ::GRPC::BadStatus => e
291
+ raise ::Google::Cloud::Error.from_error(e)
292
+ end
293
+
294
+ ##
295
+ # Gets a single channel descriptor. The descriptor indicates which fields
296
+ # are expected / permitted for a notification channel of the given type.
297
+ #
298
+ # @overload get_notification_channel_descriptor(request, options = nil)
299
+ # Pass arguments to `get_notification_channel_descriptor` via a request object, either of type
300
+ # {::Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest} or an equivalent Hash.
301
+ #
302
+ # @param request [::Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest, ::Hash]
303
+ # A request object representing the call parameters. Required. To specify no
304
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
305
+ # @param options [::Gapic::CallOptions, ::Hash]
306
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
307
+ #
308
+ # @overload get_notification_channel_descriptor(name: nil)
309
+ # Pass arguments to `get_notification_channel_descriptor` via keyword arguments. Note that at
310
+ # least one keyword argument is required. To specify no parameters, or to keep all
311
+ # the default parameter values, pass an empty Hash as a request object (see above).
312
+ #
313
+ # @param name [::String]
314
+ # Required. The channel type for which to execute the request. The format is:
315
+ #
316
+ # projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
317
+ #
318
+ # @yield [response, operation] Access the result along with the RPC operation
319
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor]
320
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
321
+ #
322
+ # @return [::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor]
323
+ #
324
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
325
+ #
326
+ def get_notification_channel_descriptor request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ metadata = @config.rpcs.get_notification_channel_descriptor.metadata.to_h
336
+
337
+ # Set x-goog-api-client and x-goog-user-project headers
338
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
341
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ header_params = {
344
+ "name" => request.name
345
+ }
346
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
347
+ metadata[:"x-goog-request-params"] ||= request_params_header
348
+
349
+ options.apply_defaults timeout: @config.rpcs.get_notification_channel_descriptor.timeout,
350
+ metadata: metadata,
351
+ retry_policy: @config.rpcs.get_notification_channel_descriptor.retry_policy
352
+ options.apply_defaults metadata: @config.metadata,
353
+ retry_policy: @config.retry_policy
354
+
355
+ @notification_channel_service_stub.call_rpc :get_notification_channel_descriptor, request, options: options do |response, operation|
356
+ yield response, operation if block_given?
357
+ return response
358
+ end
359
+ rescue ::GRPC::BadStatus => e
360
+ raise ::Google::Cloud::Error.from_error(e)
361
+ end
362
+
363
+ ##
364
+ # Lists the notification channels that have been created for the project.
365
+ #
366
+ # @overload list_notification_channels(request, options = nil)
367
+ # Pass arguments to `list_notification_channels` via a request object, either of type
368
+ # {::Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest} or an equivalent Hash.
369
+ #
370
+ # @param request [::Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest, ::Hash]
371
+ # A request object representing the call parameters. Required. To specify no
372
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
373
+ # @param options [::Gapic::CallOptions, ::Hash]
374
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
375
+ #
376
+ # @overload list_notification_channels(name: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil)
377
+ # Pass arguments to `list_notification_channels` via keyword arguments. Note that at
378
+ # least one keyword argument is required. To specify no parameters, or to keep all
379
+ # the default parameter values, pass an empty Hash as a request object (see above).
380
+ #
381
+ # @param name [::String]
382
+ # Required. The project on which to execute the request. The format is:
383
+ #
384
+ # projects/[PROJECT_ID_OR_NUMBER]
385
+ #
386
+ # This names the container
387
+ # in which to look for the notification channels; it does not name a
388
+ # specific channel. To query a specific channel by REST resource name, use
389
+ # the
390
+ # {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel `GetNotificationChannel`}
391
+ # operation.
392
+ # @param filter [::String]
393
+ # If provided, this field specifies the criteria that must be met by
394
+ # notification channels to be included in the response.
395
+ #
396
+ # For more details, see [sorting and
397
+ # filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
398
+ # @param order_by [::String]
399
+ # A comma-separated list of fields by which to sort the result. Supports
400
+ # the same set of fields as in `filter`. Entries can be prefixed with
401
+ # a minus sign to sort in descending rather than ascending order.
402
+ #
403
+ # For more details, see [sorting and
404
+ # filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
405
+ # @param page_size [::Integer]
406
+ # The maximum number of results to return in a single response. If
407
+ # not set to a positive number, a reasonable value will be chosen by the
408
+ # service.
409
+ # @param page_token [::String]
410
+ # If non-empty, `page_token` must contain a value returned as the
411
+ # `next_page_token` in a previous response to request the next set
412
+ # of results.
413
+ #
414
+ # @yield [response, operation] Access the result along with the RPC operation
415
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::NotificationChannel>]
416
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
417
+ #
418
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::NotificationChannel>]
419
+ #
420
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
421
+ #
422
+ def list_notification_channels request, options = nil
423
+ raise ::ArgumentError, "request must be provided" if request.nil?
424
+
425
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest
426
+
427
+ # Converts hash and nil to an options object
428
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
429
+
430
+ # Customize the options with defaults
431
+ metadata = @config.rpcs.list_notification_channels.metadata.to_h
432
+
433
+ # Set x-goog-api-client and x-goog-user-project headers
434
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
435
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
436
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
437
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ header_params = {
440
+ "name" => request.name
441
+ }
442
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
443
+ metadata[:"x-goog-request-params"] ||= request_params_header
444
+
445
+ options.apply_defaults timeout: @config.rpcs.list_notification_channels.timeout,
446
+ metadata: metadata,
447
+ retry_policy: @config.rpcs.list_notification_channels.retry_policy
448
+ options.apply_defaults metadata: @config.metadata,
449
+ retry_policy: @config.retry_policy
450
+
451
+ @notification_channel_service_stub.call_rpc :list_notification_channels, request, options: options do |response, operation|
452
+ response = ::Gapic::PagedEnumerable.new @notification_channel_service_stub, :list_notification_channels, request, response, operation, options
453
+ yield response, operation if block_given?
454
+ return response
455
+ end
456
+ rescue ::GRPC::BadStatus => e
457
+ raise ::Google::Cloud::Error.from_error(e)
458
+ end
459
+
460
+ ##
461
+ # Gets a single notification channel. The channel includes the relevant
462
+ # configuration details with which the channel was created. However, the
463
+ # response may truncate or omit passwords, API keys, or other private key
464
+ # matter and thus the response may not be 100% identical to the information
465
+ # that was supplied in the call to the create method.
466
+ #
467
+ # @overload get_notification_channel(request, options = nil)
468
+ # Pass arguments to `get_notification_channel` via a request object, either of type
469
+ # {::Google::Cloud::Monitoring::V3::GetNotificationChannelRequest} or an equivalent Hash.
470
+ #
471
+ # @param request [::Google::Cloud::Monitoring::V3::GetNotificationChannelRequest, ::Hash]
472
+ # A request object representing the call parameters. Required. To specify no
473
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
474
+ # @param options [::Gapic::CallOptions, ::Hash]
475
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
476
+ #
477
+ # @overload get_notification_channel(name: nil)
478
+ # Pass arguments to `get_notification_channel` via keyword arguments. Note that at
479
+ # least one keyword argument is required. To specify no parameters, or to keep all
480
+ # the default parameter values, pass an empty Hash as a request object (see above).
481
+ #
482
+ # @param name [::String]
483
+ # Required. The channel for which to execute the request. The format is:
484
+ #
485
+ # projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
486
+ #
487
+ # @yield [response, operation] Access the result along with the RPC operation
488
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::NotificationChannel]
489
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
490
+ #
491
+ # @return [::Google::Cloud::Monitoring::V3::NotificationChannel]
492
+ #
493
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
494
+ #
495
+ def get_notification_channel request, options = nil
496
+ raise ::ArgumentError, "request must be provided" if request.nil?
497
+
498
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetNotificationChannelRequest
499
+
500
+ # Converts hash and nil to an options object
501
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
502
+
503
+ # Customize the options with defaults
504
+ metadata = @config.rpcs.get_notification_channel.metadata.to_h
505
+
506
+ # Set x-goog-api-client and x-goog-user-project headers
507
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
508
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
509
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
510
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
+
512
+ header_params = {
513
+ "name" => request.name
514
+ }
515
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
516
+ metadata[:"x-goog-request-params"] ||= request_params_header
517
+
518
+ options.apply_defaults timeout: @config.rpcs.get_notification_channel.timeout,
519
+ metadata: metadata,
520
+ retry_policy: @config.rpcs.get_notification_channel.retry_policy
521
+ options.apply_defaults metadata: @config.metadata,
522
+ retry_policy: @config.retry_policy
523
+
524
+ @notification_channel_service_stub.call_rpc :get_notification_channel, request, options: options do |response, operation|
525
+ yield response, operation if block_given?
526
+ return response
527
+ end
528
+ rescue ::GRPC::BadStatus => e
529
+ raise ::Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Creates a new notification channel, representing a single notification
534
+ # endpoint such as an email address, SMS number, or PagerDuty service.
535
+ #
536
+ # @overload create_notification_channel(request, options = nil)
537
+ # Pass arguments to `create_notification_channel` via a request object, either of type
538
+ # {::Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest} or an equivalent Hash.
539
+ #
540
+ # @param request [::Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest, ::Hash]
541
+ # A request object representing the call parameters. Required. To specify no
542
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
543
+ # @param options [::Gapic::CallOptions, ::Hash]
544
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
545
+ #
546
+ # @overload create_notification_channel(name: nil, notification_channel: nil)
547
+ # Pass arguments to `create_notification_channel` via keyword arguments. Note that at
548
+ # least one keyword argument is required. To specify no parameters, or to keep all
549
+ # the default parameter values, pass an empty Hash as a request object (see above).
550
+ #
551
+ # @param name [::String]
552
+ # Required. The project on which to execute the request. The format is:
553
+ #
554
+ # projects/[PROJECT_ID_OR_NUMBER]
555
+ #
556
+ # This names the container into which the channel will be
557
+ # written, this does not name the newly created channel. The resulting
558
+ # channel's name will have a normalized version of this field as a prefix,
559
+ # but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel.
560
+ # @param notification_channel [::Google::Cloud::Monitoring::V3::NotificationChannel, ::Hash]
561
+ # Required. The definition of the `NotificationChannel` to create.
562
+ #
563
+ # @yield [response, operation] Access the result along with the RPC operation
564
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::NotificationChannel]
565
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
566
+ #
567
+ # @return [::Google::Cloud::Monitoring::V3::NotificationChannel]
568
+ #
569
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
570
+ #
571
+ def create_notification_channel request, options = nil
572
+ raise ::ArgumentError, "request must be provided" if request.nil?
573
+
574
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest
575
+
576
+ # Converts hash and nil to an options object
577
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
578
+
579
+ # Customize the options with defaults
580
+ metadata = @config.rpcs.create_notification_channel.metadata.to_h
581
+
582
+ # Set x-goog-api-client and x-goog-user-project headers
583
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
584
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
585
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
586
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
587
+
588
+ header_params = {
589
+ "name" => request.name
590
+ }
591
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
592
+ metadata[:"x-goog-request-params"] ||= request_params_header
593
+
594
+ options.apply_defaults timeout: @config.rpcs.create_notification_channel.timeout,
595
+ metadata: metadata,
596
+ retry_policy: @config.rpcs.create_notification_channel.retry_policy
597
+ options.apply_defaults metadata: @config.metadata,
598
+ retry_policy: @config.retry_policy
599
+
600
+ @notification_channel_service_stub.call_rpc :create_notification_channel, request, options: options do |response, operation|
601
+ yield response, operation if block_given?
602
+ return response
603
+ end
604
+ rescue ::GRPC::BadStatus => e
605
+ raise ::Google::Cloud::Error.from_error(e)
606
+ end
607
+
608
+ ##
609
+ # Updates a notification channel. Fields not specified in the field mask
610
+ # remain unchanged.
611
+ #
612
+ # @overload update_notification_channel(request, options = nil)
613
+ # Pass arguments to `update_notification_channel` via a request object, either of type
614
+ # {::Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest} or an equivalent Hash.
615
+ #
616
+ # @param request [::Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest, ::Hash]
617
+ # A request object representing the call parameters. Required. To specify no
618
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
619
+ # @param options [::Gapic::CallOptions, ::Hash]
620
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
621
+ #
622
+ # @overload update_notification_channel(update_mask: nil, notification_channel: nil)
623
+ # Pass arguments to `update_notification_channel` via keyword arguments. Note that at
624
+ # least one keyword argument is required. To specify no parameters, or to keep all
625
+ # the default parameter values, pass an empty Hash as a request object (see above).
626
+ #
627
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
628
+ # The fields to update.
629
+ # @param notification_channel [::Google::Cloud::Monitoring::V3::NotificationChannel, ::Hash]
630
+ # Required. A description of the changes to be applied to the specified
631
+ # notification channel. The description must provide a definition for
632
+ # fields to be updated; the names of these fields should also be
633
+ # included in the `update_mask`.
634
+ #
635
+ # @yield [response, operation] Access the result along with the RPC operation
636
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::NotificationChannel]
637
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
638
+ #
639
+ # @return [::Google::Cloud::Monitoring::V3::NotificationChannel]
640
+ #
641
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
642
+ #
643
+ def update_notification_channel request, options = nil
644
+ raise ::ArgumentError, "request must be provided" if request.nil?
645
+
646
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest
647
+
648
+ # Converts hash and nil to an options object
649
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
650
+
651
+ # Customize the options with defaults
652
+ metadata = @config.rpcs.update_notification_channel.metadata.to_h
653
+
654
+ # Set x-goog-api-client and x-goog-user-project headers
655
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
656
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
657
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
658
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
659
+
660
+ header_params = {
661
+ "notification_channel.name" => request.notification_channel.name
662
+ }
663
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
664
+ metadata[:"x-goog-request-params"] ||= request_params_header
665
+
666
+ options.apply_defaults timeout: @config.rpcs.update_notification_channel.timeout,
667
+ metadata: metadata,
668
+ retry_policy: @config.rpcs.update_notification_channel.retry_policy
669
+ options.apply_defaults metadata: @config.metadata,
670
+ retry_policy: @config.retry_policy
671
+
672
+ @notification_channel_service_stub.call_rpc :update_notification_channel, request, options: options do |response, operation|
673
+ yield response, operation if block_given?
674
+ return response
675
+ end
676
+ rescue ::GRPC::BadStatus => e
677
+ raise ::Google::Cloud::Error.from_error(e)
678
+ end
679
+
680
+ ##
681
+ # Deletes a notification channel.
682
+ #
683
+ # @overload delete_notification_channel(request, options = nil)
684
+ # Pass arguments to `delete_notification_channel` via a request object, either of type
685
+ # {::Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest} or an equivalent Hash.
686
+ #
687
+ # @param request [::Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest, ::Hash]
688
+ # A request object representing the call parameters. Required. To specify no
689
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
690
+ # @param options [::Gapic::CallOptions, ::Hash]
691
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
692
+ #
693
+ # @overload delete_notification_channel(name: nil, force: nil)
694
+ # Pass arguments to `delete_notification_channel` via keyword arguments. Note that at
695
+ # least one keyword argument is required. To specify no parameters, or to keep all
696
+ # the default parameter values, pass an empty Hash as a request object (see above).
697
+ #
698
+ # @param name [::String]
699
+ # Required. The channel for which to execute the request. The format is:
700
+ #
701
+ # projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
702
+ # @param force [::Boolean]
703
+ # If true, the notification channel will be deleted regardless of its
704
+ # use in alert policies (the policies will be updated to remove the
705
+ # channel). If false, channels that are still referenced by an existing
706
+ # alerting policy will fail to be deleted in a delete operation.
707
+ #
708
+ # @yield [response, operation] Access the result along with the RPC operation
709
+ # @yieldparam response [::Google::Protobuf::Empty]
710
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
711
+ #
712
+ # @return [::Google::Protobuf::Empty]
713
+ #
714
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
715
+ #
716
+ def delete_notification_channel request, options = nil
717
+ raise ::ArgumentError, "request must be provided" if request.nil?
718
+
719
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest
720
+
721
+ # Converts hash and nil to an options object
722
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
723
+
724
+ # Customize the options with defaults
725
+ metadata = @config.rpcs.delete_notification_channel.metadata.to_h
726
+
727
+ # Set x-goog-api-client and x-goog-user-project headers
728
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
729
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
730
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
731
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
732
+
733
+ header_params = {
734
+ "name" => request.name
735
+ }
736
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
737
+ metadata[:"x-goog-request-params"] ||= request_params_header
738
+
739
+ options.apply_defaults timeout: @config.rpcs.delete_notification_channel.timeout,
740
+ metadata: metadata,
741
+ retry_policy: @config.rpcs.delete_notification_channel.retry_policy
742
+ options.apply_defaults metadata: @config.metadata,
743
+ retry_policy: @config.retry_policy
744
+
745
+ @notification_channel_service_stub.call_rpc :delete_notification_channel, request, options: options do |response, operation|
746
+ yield response, operation if block_given?
747
+ return response
748
+ end
749
+ rescue ::GRPC::BadStatus => e
750
+ raise ::Google::Cloud::Error.from_error(e)
751
+ end
752
+
753
+ ##
754
+ # Causes a verification code to be delivered to the channel. The code
755
+ # can then be supplied in `VerifyNotificationChannel` to verify the channel.
756
+ #
757
+ # @overload send_notification_channel_verification_code(request, options = nil)
758
+ # Pass arguments to `send_notification_channel_verification_code` via a request object, either of type
759
+ # {::Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest} or an equivalent Hash.
760
+ #
761
+ # @param request [::Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest, ::Hash]
762
+ # A request object representing the call parameters. Required. To specify no
763
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
764
+ # @param options [::Gapic::CallOptions, ::Hash]
765
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
766
+ #
767
+ # @overload send_notification_channel_verification_code(name: nil)
768
+ # Pass arguments to `send_notification_channel_verification_code` via keyword arguments. Note that at
769
+ # least one keyword argument is required. To specify no parameters, or to keep all
770
+ # the default parameter values, pass an empty Hash as a request object (see above).
771
+ #
772
+ # @param name [::String]
773
+ # Required. The notification channel to which to send a verification code.
774
+ #
775
+ # @yield [response, operation] Access the result along with the RPC operation
776
+ # @yieldparam response [::Google::Protobuf::Empty]
777
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
778
+ #
779
+ # @return [::Google::Protobuf::Empty]
780
+ #
781
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
782
+ #
783
+ def send_notification_channel_verification_code request, options = nil
784
+ raise ::ArgumentError, "request must be provided" if request.nil?
785
+
786
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest
787
+
788
+ # Converts hash and nil to an options object
789
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
790
+
791
+ # Customize the options with defaults
792
+ metadata = @config.rpcs.send_notification_channel_verification_code.metadata.to_h
793
+
794
+ # Set x-goog-api-client and x-goog-user-project headers
795
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
796
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
797
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
798
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
799
+
800
+ header_params = {
801
+ "name" => request.name
802
+ }
803
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
804
+ metadata[:"x-goog-request-params"] ||= request_params_header
805
+
806
+ options.apply_defaults timeout: @config.rpcs.send_notification_channel_verification_code.timeout,
807
+ metadata: metadata,
808
+ retry_policy: @config.rpcs.send_notification_channel_verification_code.retry_policy
809
+ options.apply_defaults metadata: @config.metadata,
810
+ retry_policy: @config.retry_policy
811
+
812
+ @notification_channel_service_stub.call_rpc :send_notification_channel_verification_code, request, options: options do |response, operation|
813
+ yield response, operation if block_given?
814
+ return response
815
+ end
816
+ rescue ::GRPC::BadStatus => e
817
+ raise ::Google::Cloud::Error.from_error(e)
818
+ end
819
+
820
+ ##
821
+ # Requests a verification code for an already verified channel that can then
822
+ # be used in a call to VerifyNotificationChannel() on a different channel
823
+ # with an equivalent identity in the same or in a different project. This
824
+ # makes it possible to copy a channel between projects without requiring
825
+ # manual reverification of the channel. If the channel is not in the
826
+ # verified state, this method will fail (in other words, this may only be
827
+ # used if the SendNotificationChannelVerificationCode and
828
+ # VerifyNotificationChannel paths have already been used to put the given
829
+ # channel into the verified state).
830
+ #
831
+ # There is no guarantee that the verification codes returned by this method
832
+ # will be of a similar structure or form as the ones that are delivered
833
+ # to the channel via SendNotificationChannelVerificationCode; while
834
+ # VerifyNotificationChannel() will recognize both the codes delivered via
835
+ # SendNotificationChannelVerificationCode() and returned from
836
+ # GetNotificationChannelVerificationCode(), it is typically the case that
837
+ # the verification codes delivered via
838
+ # SendNotificationChannelVerificationCode() will be shorter and also
839
+ # have a shorter expiration (e.g. codes such as "G-123456") whereas
840
+ # GetVerificationCode() will typically return a much longer, websafe base
841
+ # 64 encoded string that has a longer expiration time.
842
+ #
843
+ # @overload get_notification_channel_verification_code(request, options = nil)
844
+ # Pass arguments to `get_notification_channel_verification_code` via a request object, either of type
845
+ # {::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest} or an equivalent Hash.
846
+ #
847
+ # @param request [::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest, ::Hash]
848
+ # A request object representing the call parameters. Required. To specify no
849
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
850
+ # @param options [::Gapic::CallOptions, ::Hash]
851
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
852
+ #
853
+ # @overload get_notification_channel_verification_code(name: nil, expire_time: nil)
854
+ # Pass arguments to `get_notification_channel_verification_code` via keyword arguments. Note that at
855
+ # least one keyword argument is required. To specify no parameters, or to keep all
856
+ # the default parameter values, pass an empty Hash as a request object (see above).
857
+ #
858
+ # @param name [::String]
859
+ # Required. The notification channel for which a verification code is to be generated
860
+ # and retrieved. This must name a channel that is already verified; if
861
+ # the specified channel is not verified, the request will fail.
862
+ # @param expire_time [::Google::Protobuf::Timestamp, ::Hash]
863
+ # The desired expiration time. If specified, the API will guarantee that
864
+ # the returned code will not be valid after the specified timestamp;
865
+ # however, the API cannot guarantee that the returned code will be
866
+ # valid for at least as long as the requested time (the API puts an upper
867
+ # bound on the amount of time for which a code may be valid). If omitted,
868
+ # a default expiration will be used, which may be less than the max
869
+ # permissible expiration (so specifying an expiration may extend the
870
+ # code's lifetime over omitting an expiration, even though the API does
871
+ # impose an upper limit on the maximum expiration that is permitted).
872
+ #
873
+ # @yield [response, operation] Access the result along with the RPC operation
874
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse]
875
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
876
+ #
877
+ # @return [::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse]
878
+ #
879
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
880
+ #
881
+ def get_notification_channel_verification_code request, options = nil
882
+ raise ::ArgumentError, "request must be provided" if request.nil?
883
+
884
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest
885
+
886
+ # Converts hash and nil to an options object
887
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
888
+
889
+ # Customize the options with defaults
890
+ metadata = @config.rpcs.get_notification_channel_verification_code.metadata.to_h
891
+
892
+ # Set x-goog-api-client and x-goog-user-project headers
893
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
894
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
895
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
896
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
897
+
898
+ header_params = {
899
+ "name" => request.name
900
+ }
901
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
902
+ metadata[:"x-goog-request-params"] ||= request_params_header
903
+
904
+ options.apply_defaults timeout: @config.rpcs.get_notification_channel_verification_code.timeout,
905
+ metadata: metadata,
906
+ retry_policy: @config.rpcs.get_notification_channel_verification_code.retry_policy
907
+ options.apply_defaults metadata: @config.metadata,
908
+ retry_policy: @config.retry_policy
909
+
910
+ @notification_channel_service_stub.call_rpc :get_notification_channel_verification_code, request, options: options do |response, operation|
911
+ yield response, operation if block_given?
912
+ return response
913
+ end
914
+ rescue ::GRPC::BadStatus => e
915
+ raise ::Google::Cloud::Error.from_error(e)
916
+ end
917
+
918
+ ##
919
+ # Verifies a `NotificationChannel` by proving receipt of the code
920
+ # delivered to the channel as a result of calling
921
+ # `SendNotificationChannelVerificationCode`.
922
+ #
923
+ # @overload verify_notification_channel(request, options = nil)
924
+ # Pass arguments to `verify_notification_channel` via a request object, either of type
925
+ # {::Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest} or an equivalent Hash.
926
+ #
927
+ # @param request [::Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest, ::Hash]
928
+ # A request object representing the call parameters. Required. To specify no
929
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
930
+ # @param options [::Gapic::CallOptions, ::Hash]
931
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
932
+ #
933
+ # @overload verify_notification_channel(name: nil, code: nil)
934
+ # Pass arguments to `verify_notification_channel` via keyword arguments. Note that at
935
+ # least one keyword argument is required. To specify no parameters, or to keep all
936
+ # the default parameter values, pass an empty Hash as a request object (see above).
937
+ #
938
+ # @param name [::String]
939
+ # Required. The notification channel to verify.
940
+ # @param code [::String]
941
+ # Required. The verification code that was delivered to the channel as
942
+ # a result of invoking the `SendNotificationChannelVerificationCode` API
943
+ # method or that was retrieved from a verified channel via
944
+ # `GetNotificationChannelVerificationCode`. For example, one might have
945
+ # "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only
946
+ # guaranteed that the code is valid UTF-8; one should not
947
+ # make any assumptions regarding the structure or format of the code).
948
+ #
949
+ # @yield [response, operation] Access the result along with the RPC operation
950
+ # @yieldparam response [::Google::Cloud::Monitoring::V3::NotificationChannel]
951
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
952
+ #
953
+ # @return [::Google::Cloud::Monitoring::V3::NotificationChannel]
954
+ #
955
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
956
+ #
957
+ def verify_notification_channel request, options = nil
958
+ raise ::ArgumentError, "request must be provided" if request.nil?
959
+
960
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest
961
+
962
+ # Converts hash and nil to an options object
963
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
964
+
965
+ # Customize the options with defaults
966
+ metadata = @config.rpcs.verify_notification_channel.metadata.to_h
967
+
968
+ # Set x-goog-api-client and x-goog-user-project headers
969
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
970
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
971
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
972
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
973
+
974
+ header_params = {
975
+ "name" => request.name
976
+ }
977
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
978
+ metadata[:"x-goog-request-params"] ||= request_params_header
979
+
980
+ options.apply_defaults timeout: @config.rpcs.verify_notification_channel.timeout,
981
+ metadata: metadata,
982
+ retry_policy: @config.rpcs.verify_notification_channel.retry_policy
983
+ options.apply_defaults metadata: @config.metadata,
984
+ retry_policy: @config.retry_policy
985
+
986
+ @notification_channel_service_stub.call_rpc :verify_notification_channel, request, options: options do |response, operation|
987
+ yield response, operation if block_given?
988
+ return response
989
+ end
990
+ rescue ::GRPC::BadStatus => e
991
+ raise ::Google::Cloud::Error.from_error(e)
992
+ end
993
+
994
+ ##
995
+ # Configuration class for the NotificationChannelService API.
996
+ #
997
+ # This class represents the configuration for NotificationChannelService,
998
+ # providing control over timeouts, retry behavior, logging, transport
999
+ # parameters, and other low-level controls. Certain parameters can also be
1000
+ # applied individually to specific RPCs. See
1001
+ # {::Google::Cloud::Monitoring::V3::NotificationChannelService::Client::Configuration::Rpcs}
1002
+ # for a list of RPCs that can be configured independently.
1003
+ #
1004
+ # Configuration can be applied globally to all clients, or to a single client
1005
+ # on construction.
1006
+ #
1007
+ # # Examples
1008
+ #
1009
+ # To modify the global config, setting the timeout for list_notification_channel_descriptors
1010
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
1011
+ #
1012
+ # ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.configure do |config|
1013
+ # config.timeout = 10.0
1014
+ # config.rpcs.list_notification_channel_descriptors.timeout = 20.0
1015
+ # end
1016
+ #
1017
+ # To apply the above configuration only to a new client:
1018
+ #
1019
+ # client = ::Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new do |config|
1020
+ # config.timeout = 10.0
1021
+ # config.rpcs.list_notification_channel_descriptors.timeout = 20.0
1022
+ # end
1023
+ #
1024
+ # @!attribute [rw] endpoint
1025
+ # The hostname or hostname:port of the service endpoint.
1026
+ # Defaults to `"monitoring.googleapis.com"`.
1027
+ # @return [::String]
1028
+ # @!attribute [rw] credentials
1029
+ # Credentials to send with calls. You may provide any of the following types:
1030
+ # * (`String`) The path to a service account key file in JSON format
1031
+ # * (`Hash`) A service account key as a Hash
1032
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1033
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1034
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1035
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1036
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1037
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1038
+ # * (`nil`) indicating no credentials
1039
+ # @return [::Object]
1040
+ # @!attribute [rw] scope
1041
+ # The OAuth scopes
1042
+ # @return [::Array<::String>]
1043
+ # @!attribute [rw] lib_name
1044
+ # The library name as recorded in instrumentation and logging
1045
+ # @return [::String]
1046
+ # @!attribute [rw] lib_version
1047
+ # The library version as recorded in instrumentation and logging
1048
+ # @return [::String]
1049
+ # @!attribute [rw] channel_args
1050
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1051
+ # `GRPC::Core::Channel` object is provided as the credential.
1052
+ # @return [::Hash]
1053
+ # @!attribute [rw] interceptors
1054
+ # An array of interceptors that are run before calls are executed.
1055
+ # @return [::Array<::GRPC::ClientInterceptor>]
1056
+ # @!attribute [rw] timeout
1057
+ # The call timeout in seconds.
1058
+ # @return [::Numeric]
1059
+ # @!attribute [rw] metadata
1060
+ # Additional gRPC headers to be sent with the call.
1061
+ # @return [::Hash{::Symbol=>::String}]
1062
+ # @!attribute [rw] retry_policy
1063
+ # The retry policy. The value is a hash with the following keys:
1064
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1065
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1066
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1067
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1068
+ # trigger a retry.
1069
+ # @return [::Hash]
1070
+ # @!attribute [rw] quota_project
1071
+ # A separate project against which to charge quota.
1072
+ # @return [::String]
1073
+ #
1074
+ class Configuration
1075
+ extend ::Gapic::Config
1076
+
1077
+ config_attr :endpoint, "monitoring.googleapis.com", ::String
1078
+ config_attr :credentials, nil do |value|
1079
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1080
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1081
+ allowed.any? { |klass| klass === value }
1082
+ end
1083
+ config_attr :scope, nil, ::String, ::Array, nil
1084
+ config_attr :lib_name, nil, ::String, nil
1085
+ config_attr :lib_version, nil, ::String, nil
1086
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1087
+ config_attr :interceptors, nil, ::Array, nil
1088
+ config_attr :timeout, nil, ::Numeric, nil
1089
+ config_attr :metadata, nil, ::Hash, nil
1090
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1091
+ config_attr :quota_project, nil, ::String, nil
1092
+
1093
+ # @private
1094
+ def initialize parent_config = nil
1095
+ @parent_config = parent_config unless parent_config.nil?
1096
+
1097
+ yield self if block_given?
1098
+ end
1099
+
1100
+ ##
1101
+ # Configurations for individual RPCs
1102
+ # @return [Rpcs]
1103
+ #
1104
+ def rpcs
1105
+ @rpcs ||= begin
1106
+ parent_rpcs = nil
1107
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1108
+ Rpcs.new parent_rpcs
1109
+ end
1110
+ end
1111
+
1112
+ ##
1113
+ # Configuration RPC class for the NotificationChannelService API.
1114
+ #
1115
+ # Includes fields providing the configuration for each RPC in this service.
1116
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1117
+ # the following configuration fields:
1118
+ #
1119
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1120
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1121
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1122
+ # include the following keys:
1123
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1124
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1125
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1126
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1127
+ # trigger a retry.
1128
+ #
1129
+ class Rpcs
1130
+ ##
1131
+ # RPC-specific configuration for `list_notification_channel_descriptors`
1132
+ # @return [::Gapic::Config::Method]
1133
+ #
1134
+ attr_reader :list_notification_channel_descriptors
1135
+ ##
1136
+ # RPC-specific configuration for `get_notification_channel_descriptor`
1137
+ # @return [::Gapic::Config::Method]
1138
+ #
1139
+ attr_reader :get_notification_channel_descriptor
1140
+ ##
1141
+ # RPC-specific configuration for `list_notification_channels`
1142
+ # @return [::Gapic::Config::Method]
1143
+ #
1144
+ attr_reader :list_notification_channels
1145
+ ##
1146
+ # RPC-specific configuration for `get_notification_channel`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :get_notification_channel
1150
+ ##
1151
+ # RPC-specific configuration for `create_notification_channel`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :create_notification_channel
1155
+ ##
1156
+ # RPC-specific configuration for `update_notification_channel`
1157
+ # @return [::Gapic::Config::Method]
1158
+ #
1159
+ attr_reader :update_notification_channel
1160
+ ##
1161
+ # RPC-specific configuration for `delete_notification_channel`
1162
+ # @return [::Gapic::Config::Method]
1163
+ #
1164
+ attr_reader :delete_notification_channel
1165
+ ##
1166
+ # RPC-specific configuration for `send_notification_channel_verification_code`
1167
+ # @return [::Gapic::Config::Method]
1168
+ #
1169
+ attr_reader :send_notification_channel_verification_code
1170
+ ##
1171
+ # RPC-specific configuration for `get_notification_channel_verification_code`
1172
+ # @return [::Gapic::Config::Method]
1173
+ #
1174
+ attr_reader :get_notification_channel_verification_code
1175
+ ##
1176
+ # RPC-specific configuration for `verify_notification_channel`
1177
+ # @return [::Gapic::Config::Method]
1178
+ #
1179
+ attr_reader :verify_notification_channel
1180
+
1181
+ # @private
1182
+ def initialize parent_rpcs = nil
1183
+ list_notification_channel_descriptors_config = parent_rpcs&.list_notification_channel_descriptors if parent_rpcs&.respond_to? :list_notification_channel_descriptors
1184
+ @list_notification_channel_descriptors = ::Gapic::Config::Method.new list_notification_channel_descriptors_config
1185
+ get_notification_channel_descriptor_config = parent_rpcs&.get_notification_channel_descriptor if parent_rpcs&.respond_to? :get_notification_channel_descriptor
1186
+ @get_notification_channel_descriptor = ::Gapic::Config::Method.new get_notification_channel_descriptor_config
1187
+ list_notification_channels_config = parent_rpcs&.list_notification_channels if parent_rpcs&.respond_to? :list_notification_channels
1188
+ @list_notification_channels = ::Gapic::Config::Method.new list_notification_channels_config
1189
+ get_notification_channel_config = parent_rpcs&.get_notification_channel if parent_rpcs&.respond_to? :get_notification_channel
1190
+ @get_notification_channel = ::Gapic::Config::Method.new get_notification_channel_config
1191
+ create_notification_channel_config = parent_rpcs&.create_notification_channel if parent_rpcs&.respond_to? :create_notification_channel
1192
+ @create_notification_channel = ::Gapic::Config::Method.new create_notification_channel_config
1193
+ update_notification_channel_config = parent_rpcs&.update_notification_channel if parent_rpcs&.respond_to? :update_notification_channel
1194
+ @update_notification_channel = ::Gapic::Config::Method.new update_notification_channel_config
1195
+ delete_notification_channel_config = parent_rpcs&.delete_notification_channel if parent_rpcs&.respond_to? :delete_notification_channel
1196
+ @delete_notification_channel = ::Gapic::Config::Method.new delete_notification_channel_config
1197
+ send_notification_channel_verification_code_config = parent_rpcs&.send_notification_channel_verification_code if parent_rpcs&.respond_to? :send_notification_channel_verification_code
1198
+ @send_notification_channel_verification_code = ::Gapic::Config::Method.new send_notification_channel_verification_code_config
1199
+ get_notification_channel_verification_code_config = parent_rpcs&.get_notification_channel_verification_code if parent_rpcs&.respond_to? :get_notification_channel_verification_code
1200
+ @get_notification_channel_verification_code = ::Gapic::Config::Method.new get_notification_channel_verification_code_config
1201
+ verify_notification_channel_config = parent_rpcs&.verify_notification_channel if parent_rpcs&.respond_to? :verify_notification_channel
1202
+ @verify_notification_channel = ::Gapic::Config::Method.new verify_notification_channel_config
1203
+
1204
+ yield self if block_given?
1205
+ end
1206
+ end
1207
+ end
1208
+ end
1209
+ end
1210
+ end
1211
+ end
1212
+ end
1213
+ end