aws-sdk-codestarnotifications 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 993314329d7ebb611b0b6d86f0d537256662a9e4
4
+ data.tar.gz: d27caf1f580241fd59cf5b04d03b2ef4af84ced2
5
+ SHA512:
6
+ metadata.gz: 398e0d3042d04ed81b719b6563cf08af94dd4a08ae490272b677eef71522193edc5fb489f294df6ad5d42c15ab4539b71bca239fa4a87229df1612ef1956b61a
7
+ data.tar.gz: 0a28d1474c6a65492c9160e73ed4b281e3c3c2d0b27f28d5f18bb2ab6a671098ff4d75dc357ad22d46bb149716a9f4825982b0e4226f9fd4e0b91cf399c06937
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-codestarnotifications/types'
12
+ require_relative 'aws-sdk-codestarnotifications/client_api'
13
+ require_relative 'aws-sdk-codestarnotifications/client'
14
+ require_relative 'aws-sdk-codestarnotifications/errors'
15
+ require_relative 'aws-sdk-codestarnotifications/resource'
16
+ require_relative 'aws-sdk-codestarnotifications/customizations'
17
+
18
+ # This module provides support for AWS CodeStar Notifications. This module is available in the
19
+ # `aws-sdk-codestarnotifications` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS CodeStar Notifications all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::CodeStarNotifications::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::CodeStarNotifications
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,886 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/endpoint_discovery.rb'
19
+ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
20
+ require 'aws-sdk-core/plugins/response_paging.rb'
21
+ require 'aws-sdk-core/plugins/stub_responses.rb'
22
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
23
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
24
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
25
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
26
+ require 'aws-sdk-core/plugins/transfer_encoding.rb'
27
+ require 'aws-sdk-core/plugins/signature_v4.rb'
28
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
29
+
30
+ Aws::Plugins::GlobalConfiguration.add_identifier(:codestarnotifications)
31
+
32
+ module Aws::CodeStarNotifications
33
+ class Client < Seahorse::Client::Base
34
+
35
+ include Aws::ClientStubs
36
+
37
+ @identifier = :codestarnotifications
38
+
39
+ set_api(ClientApi::API)
40
+
41
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
42
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
43
+ add_plugin(Aws::Plugins::Logging)
44
+ add_plugin(Aws::Plugins::ParamConverter)
45
+ add_plugin(Aws::Plugins::ParamValidator)
46
+ add_plugin(Aws::Plugins::UserAgent)
47
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
48
+ add_plugin(Aws::Plugins::RetryErrors)
49
+ add_plugin(Aws::Plugins::GlobalConfiguration)
50
+ add_plugin(Aws::Plugins::RegionalEndpoint)
51
+ add_plugin(Aws::Plugins::EndpointDiscovery)
52
+ add_plugin(Aws::Plugins::EndpointPattern)
53
+ add_plugin(Aws::Plugins::ResponsePaging)
54
+ add_plugin(Aws::Plugins::StubResponses)
55
+ add_plugin(Aws::Plugins::IdempotencyToken)
56
+ add_plugin(Aws::Plugins::JsonvalueConverter)
57
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
58
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
59
+ add_plugin(Aws::Plugins::TransferEncoding)
60
+ add_plugin(Aws::Plugins::SignatureV4)
61
+ add_plugin(Aws::Plugins::Protocols::RestJson)
62
+
63
+ # @overload initialize(options)
64
+ # @param [Hash] options
65
+ # @option options [required, Aws::CredentialProvider] :credentials
66
+ # Your AWS credentials. This can be an instance of any one of the
67
+ # following classes:
68
+ #
69
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
70
+ # credentials.
71
+ #
72
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
73
+ # from an EC2 IMDS on an EC2 instance.
74
+ #
75
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
76
+ # shared file, such as `~/.aws/config`.
77
+ #
78
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
79
+ #
80
+ # When `:credentials` are not configured directly, the following
81
+ # locations will be searched for credentials:
82
+ #
83
+ # * `Aws.config[:credentials]`
84
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
85
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
86
+ # * `~/.aws/credentials`
87
+ # * `~/.aws/config`
88
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
89
+ # very aggressive. Construct and pass an instance of
90
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
91
+ # timeouts.
92
+ #
93
+ # @option options [required, String] :region
94
+ # The AWS region to connect to. The configured `:region` is
95
+ # used to determine the service `:endpoint`. When not passed,
96
+ # a default `:region` is search for in the following locations:
97
+ #
98
+ # * `Aws.config[:region]`
99
+ # * `ENV['AWS_REGION']`
100
+ # * `ENV['AMAZON_REGION']`
101
+ # * `ENV['AWS_DEFAULT_REGION']`
102
+ # * `~/.aws/credentials`
103
+ # * `~/.aws/config`
104
+ #
105
+ # @option options [String] :access_key_id
106
+ #
107
+ # @option options [Boolean] :active_endpoint_cache (false)
108
+ # When set to `true`, a thread polling for endpoints will be running in
109
+ # the background every 60 secs (default). Defaults to `false`.
110
+ #
111
+ # @option options [Boolean] :client_side_monitoring (false)
112
+ # When `true`, client-side metrics will be collected for all API requests from
113
+ # this client.
114
+ #
115
+ # @option options [String] :client_side_monitoring_client_id ("")
116
+ # Allows you to provide an identifier for this client which will be attached to
117
+ # all generated client side metrics. Defaults to an empty string.
118
+ #
119
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
120
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
121
+ # side monitoring agent is running on, where client metrics will be published via UDP.
122
+ #
123
+ # @option options [Integer] :client_side_monitoring_port (31000)
124
+ # Required for publishing client metrics. The port that the client side monitoring
125
+ # agent is running on, where client metrics will be published via UDP.
126
+ #
127
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
128
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
129
+ # will use the Client Side Monitoring Agent Publisher.
130
+ #
131
+ # @option options [Boolean] :convert_params (true)
132
+ # When `true`, an attempt is made to coerce request parameters into
133
+ # the required types.
134
+ #
135
+ # @option options [Boolean] :disable_host_prefix_injection (false)
136
+ # Set to true to disable SDK automatically adding host prefix
137
+ # to default service endpoint when available.
138
+ #
139
+ # @option options [String] :endpoint
140
+ # The client endpoint is normally constructed from the `:region`
141
+ # option. You should only configure an `:endpoint` when connecting
142
+ # to test endpoints. This should be avalid HTTP(S) URI.
143
+ #
144
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
145
+ # Used for the maximum size limit of the LRU cache storing endpoints data
146
+ # for endpoint discovery enabled operations. Defaults to 1000.
147
+ #
148
+ # @option options [Integer] :endpoint_cache_max_threads (10)
149
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
150
+ #
151
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
152
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
153
+ # Use this option to config the time interval in seconds for making
154
+ # requests fetching endpoints information. Defaults to 60 sec.
155
+ #
156
+ # @option options [Boolean] :endpoint_discovery (false)
157
+ # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
158
+ #
159
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
160
+ # The log formatter.
161
+ #
162
+ # @option options [Symbol] :log_level (:info)
163
+ # The log level to send messages to the `:logger` at.
164
+ #
165
+ # @option options [Logger] :logger
166
+ # The Logger instance to send log messages to. If this option
167
+ # is not set, logging will be disabled.
168
+ #
169
+ # @option options [String] :profile ("default")
170
+ # Used when loading credentials from the shared credentials file
171
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
172
+ #
173
+ # @option options [Float] :retry_base_delay (0.3)
174
+ # The base delay in seconds used by the default backoff function.
175
+ #
176
+ # @option options [Symbol] :retry_jitter (:none)
177
+ # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
178
+ #
179
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
180
+ #
181
+ # @option options [Integer] :retry_limit (3)
182
+ # The maximum number of times to retry failed requests. Only
183
+ # ~ 500 level server errors and certain ~ 400 level client errors
184
+ # are retried. Generally, these are throttling errors, data
185
+ # checksum errors, networking errors, timeout errors and auth
186
+ # errors from expired credentials.
187
+ #
188
+ # @option options [Integer] :retry_max_delay (0)
189
+ # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
190
+ #
191
+ # @option options [String] :secret_access_key
192
+ #
193
+ # @option options [String] :session_token
194
+ #
195
+ # @option options [Boolean] :stub_responses (false)
196
+ # Causes the client to return stubbed responses. By default
197
+ # fake responses are generated and returned. You can specify
198
+ # the response data to return or errors to raise by calling
199
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
200
+ #
201
+ # ** Please note ** When response stubbing is enabled, no HTTP
202
+ # requests are made, and retries are disabled.
203
+ #
204
+ # @option options [Boolean] :validate_params (true)
205
+ # When `true`, request parameters are validated before
206
+ # sending the request.
207
+ #
208
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
209
+ # requests through. Formatted like 'http://proxy.com:123'.
210
+ #
211
+ # @option options [Float] :http_open_timeout (15) The number of
212
+ # seconds to wait when opening a HTTP session before rasing a
213
+ # `Timeout::Error`.
214
+ #
215
+ # @option options [Integer] :http_read_timeout (60) The default
216
+ # number of seconds to wait for response data. This value can
217
+ # safely be set
218
+ # per-request on the session yeidled by {#session_for}.
219
+ #
220
+ # @option options [Float] :http_idle_timeout (5) The number of
221
+ # seconds a connection is allowed to sit idble before it is
222
+ # considered stale. Stale connections are closed and removed
223
+ # from the pool before making a request.
224
+ #
225
+ # @option options [Float] :http_continue_timeout (1) The number of
226
+ # seconds to wait for a 100-continue response before sending the
227
+ # request body. This option has no effect unless the request has
228
+ # "Expect" header set to "100-continue". Defaults to `nil` which
229
+ # disables this behaviour. This value can safely be set per
230
+ # request on the session yeidled by {#session_for}.
231
+ #
232
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
233
+ # HTTP debug output will be sent to the `:logger`.
234
+ #
235
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
236
+ # SSL peer certificates are verified when establishing a
237
+ # connection.
238
+ #
239
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
240
+ # certificate authority bundle file that should be used when
241
+ # verifying peer certificates. If you do not pass
242
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
243
+ # will be used if available.
244
+ #
245
+ # @option options [String] :ssl_ca_directory Full path of the
246
+ # directory that contains the unbundled SSL certificate
247
+ # authority files for verifying peer certificates. If you do
248
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
249
+ # system default will be used if available.
250
+ #
251
+ def initialize(*args)
252
+ super
253
+ end
254
+
255
+ # @!group API Operations
256
+
257
+ # Creates a notification rule for a resource. The rule specifies the
258
+ # events you want notifications about and the targets (such as SNS
259
+ # topics) where you want to receive them.
260
+ #
261
+ # @option params [required, String] :name
262
+ # The name for the notification rule. Notifictaion rule names must be
263
+ # unique in your AWS account.
264
+ #
265
+ # @option params [required, Array<String>] :event_type_ids
266
+ # A list of event types associated with this notification rule. For a
267
+ # list of allowed events, see EventTypeSummary.
268
+ #
269
+ # @option params [required, String] :resource
270
+ # The Amazon Resource Name (ARN) of the resource to associate with the
271
+ # notification rule. Supported resources include pipelines in AWS
272
+ # CodePipeline, repositories in AWS CodeCommit, and build projects in
273
+ # AWS CodeBuild.
274
+ #
275
+ # @option params [required, Array<Types::Target>] :targets
276
+ # A list of Amazon Resource Names (ARNs) of SNS topics to associate with
277
+ # the notification rule.
278
+ #
279
+ # @option params [required, String] :detail_type
280
+ # The level of detail to include in the notifications for this resource.
281
+ # BASIC will include only the contents of the event as it would appear
282
+ # in AWS CloudWatch. FULL will include any supplemental information
283
+ # provided by AWS CodeStar Notifications and/or the service for the
284
+ # resource for which the notification is created.
285
+ #
286
+ # @option params [String] :client_request_token
287
+ # A unique, client-generated idempotency token that, when provided in a
288
+ # request, ensures the request cannot be repeated with a changed
289
+ # parameter. If a request with the same parameters is received and a
290
+ # token is included, the request returns information about the initial
291
+ # request that used that token.
292
+ #
293
+ # <note markdown="1"> The AWS SDKs prepopulate client request tokens. If you are using an
294
+ # AWS SDK, an idempotency token is created for you.
295
+ #
296
+ # </note>
297
+ #
298
+ # **A suitable default value is auto-generated.** You should normally
299
+ # not need to pass this option.**
300
+ #
301
+ # @option params [Hash<String,String>] :tags
302
+ # A list of tags to apply to this notification rule. Key names cannot
303
+ # start with "aws".
304
+ #
305
+ # @option params [String] :status
306
+ # The status of the notification rule. The default value is ENABLED. If
307
+ # the status is set to DISABLED, notifications aren't sent for the
308
+ # notification rule.
309
+ #
310
+ # @return [Types::CreateNotificationRuleResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
311
+ #
312
+ # * {Types::CreateNotificationRuleResult#arn #arn} => String
313
+ #
314
+ # @example Request syntax with placeholder values
315
+ #
316
+ # resp = client.create_notification_rule({
317
+ # name: "NotificationRuleName", # required
318
+ # event_type_ids: ["EventTypeId"], # required
319
+ # resource: "NotificationRuleResource", # required
320
+ # targets: [ # required
321
+ # {
322
+ # target_type: "TargetType",
323
+ # target_address: "TargetAddress",
324
+ # },
325
+ # ],
326
+ # detail_type: "BASIC", # required, accepts BASIC, FULL
327
+ # client_request_token: "ClientRequestToken",
328
+ # tags: {
329
+ # "TagKey" => "TagValue",
330
+ # },
331
+ # status: "ENABLED", # accepts ENABLED, DISABLED
332
+ # })
333
+ #
334
+ # @example Response structure
335
+ #
336
+ # resp.arn #=> String
337
+ #
338
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/CreateNotificationRule AWS API Documentation
339
+ #
340
+ # @overload create_notification_rule(params = {})
341
+ # @param [Hash] params ({})
342
+ def create_notification_rule(params = {}, options = {})
343
+ req = build_request(:create_notification_rule, params)
344
+ req.send_request(options)
345
+ end
346
+
347
+ # Deletes a notification rule for a resource.
348
+ #
349
+ # @option params [required, String] :arn
350
+ # The Amazon Resource Name (ARN) of the notification rule you want to
351
+ # delete.
352
+ #
353
+ # @return [Types::DeleteNotificationRuleResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
354
+ #
355
+ # * {Types::DeleteNotificationRuleResult#arn #arn} => String
356
+ #
357
+ # @example Request syntax with placeholder values
358
+ #
359
+ # resp = client.delete_notification_rule({
360
+ # arn: "NotificationRuleArn", # required
361
+ # })
362
+ #
363
+ # @example Response structure
364
+ #
365
+ # resp.arn #=> String
366
+ #
367
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteNotificationRule AWS API Documentation
368
+ #
369
+ # @overload delete_notification_rule(params = {})
370
+ # @param [Hash] params ({})
371
+ def delete_notification_rule(params = {}, options = {})
372
+ req = build_request(:delete_notification_rule, params)
373
+ req.send_request(options)
374
+ end
375
+
376
+ # Deletes a specified target for notifications.
377
+ #
378
+ # @option params [required, String] :target_address
379
+ # The Amazon Resource Name (ARN) of the SNS topic to delete.
380
+ #
381
+ # @option params [Boolean] :force_unsubscribe_all
382
+ # A Boolean value that can be used to delete all associations with this
383
+ # SNS topic. The default value is FALSE. If set to TRUE, all
384
+ # associations between that target and every notification rule in your
385
+ # AWS account are deleted.
386
+ #
387
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
388
+ #
389
+ # @example Request syntax with placeholder values
390
+ #
391
+ # resp = client.delete_target({
392
+ # target_address: "TargetAddress", # required
393
+ # force_unsubscribe_all: false,
394
+ # })
395
+ #
396
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteTarget AWS API Documentation
397
+ #
398
+ # @overload delete_target(params = {})
399
+ # @param [Hash] params ({})
400
+ def delete_target(params = {}, options = {})
401
+ req = build_request(:delete_target, params)
402
+ req.send_request(options)
403
+ end
404
+
405
+ # Returns information about a specified notification rule.
406
+ #
407
+ # @option params [required, String] :arn
408
+ # The Amazon Resource Name (ARN) of the notification rule.
409
+ #
410
+ # @return [Types::DescribeNotificationRuleResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
411
+ #
412
+ # * {Types::DescribeNotificationRuleResult#arn #arn} => String
413
+ # * {Types::DescribeNotificationRuleResult#name #name} => String
414
+ # * {Types::DescribeNotificationRuleResult#event_types #event_types} => Array&lt;Types::EventTypeSummary&gt;
415
+ # * {Types::DescribeNotificationRuleResult#resource #resource} => String
416
+ # * {Types::DescribeNotificationRuleResult#targets #targets} => Array&lt;Types::TargetSummary&gt;
417
+ # * {Types::DescribeNotificationRuleResult#detail_type #detail_type} => String
418
+ # * {Types::DescribeNotificationRuleResult#created_by #created_by} => String
419
+ # * {Types::DescribeNotificationRuleResult#status #status} => String
420
+ # * {Types::DescribeNotificationRuleResult#created_timestamp #created_timestamp} => Time
421
+ # * {Types::DescribeNotificationRuleResult#last_modified_timestamp #last_modified_timestamp} => Time
422
+ # * {Types::DescribeNotificationRuleResult#tags #tags} => Hash&lt;String,String&gt;
423
+ #
424
+ # @example Request syntax with placeholder values
425
+ #
426
+ # resp = client.describe_notification_rule({
427
+ # arn: "NotificationRuleArn", # required
428
+ # })
429
+ #
430
+ # @example Response structure
431
+ #
432
+ # resp.arn #=> String
433
+ # resp.name #=> String
434
+ # resp.event_types #=> Array
435
+ # resp.event_types[0].event_type_id #=> String
436
+ # resp.event_types[0].service_name #=> String
437
+ # resp.event_types[0].event_type_name #=> String
438
+ # resp.event_types[0].resource_type #=> String
439
+ # resp.resource #=> String
440
+ # resp.targets #=> Array
441
+ # resp.targets[0].target_address #=> String
442
+ # resp.targets[0].target_type #=> String
443
+ # resp.targets[0].target_status #=> String, one of "PENDING", "ACTIVE", "UNREACHABLE", "INACTIVE", "DEACTIVATED"
444
+ # resp.detail_type #=> String, one of "BASIC", "FULL"
445
+ # resp.created_by #=> String
446
+ # resp.status #=> String, one of "ENABLED", "DISABLED"
447
+ # resp.created_timestamp #=> Time
448
+ # resp.last_modified_timestamp #=> Time
449
+ # resp.tags #=> Hash
450
+ # resp.tags["TagKey"] #=> String
451
+ #
452
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DescribeNotificationRule AWS API Documentation
453
+ #
454
+ # @overload describe_notification_rule(params = {})
455
+ # @param [Hash] params ({})
456
+ def describe_notification_rule(params = {}, options = {})
457
+ req = build_request(:describe_notification_rule, params)
458
+ req.send_request(options)
459
+ end
460
+
461
+ # Returns information about the event types available for configuring
462
+ # notifications.
463
+ #
464
+ # @option params [Array<Types::ListEventTypesFilter>] :filters
465
+ # The filters to use to return information by service or resource type.
466
+ #
467
+ # @option params [String] :next_token
468
+ # An enumeration token that, when provided in a request, returns the
469
+ # next batch of the results.
470
+ #
471
+ # @option params [Integer] :max_results
472
+ # A non-negative integer used to limit the number of returned results.
473
+ # The default number is 50. The maximum number of results that can be
474
+ # returned is 100.
475
+ #
476
+ # @return [Types::ListEventTypesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
477
+ #
478
+ # * {Types::ListEventTypesResult#event_types #event_types} => Array&lt;Types::EventTypeSummary&gt;
479
+ # * {Types::ListEventTypesResult#next_token #next_token} => String
480
+ #
481
+ # @example Request syntax with placeholder values
482
+ #
483
+ # resp = client.list_event_types({
484
+ # filters: [
485
+ # {
486
+ # name: "RESOURCE_TYPE", # required, accepts RESOURCE_TYPE, SERVICE_NAME
487
+ # value: "ListEventTypesFilterValue", # required
488
+ # },
489
+ # ],
490
+ # next_token: "NextToken",
491
+ # max_results: 1,
492
+ # })
493
+ #
494
+ # @example Response structure
495
+ #
496
+ # resp.event_types #=> Array
497
+ # resp.event_types[0].event_type_id #=> String
498
+ # resp.event_types[0].service_name #=> String
499
+ # resp.event_types[0].event_type_name #=> String
500
+ # resp.event_types[0].resource_type #=> String
501
+ # resp.next_token #=> String
502
+ #
503
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListEventTypes AWS API Documentation
504
+ #
505
+ # @overload list_event_types(params = {})
506
+ # @param [Hash] params ({})
507
+ def list_event_types(params = {}, options = {})
508
+ req = build_request(:list_event_types, params)
509
+ req.send_request(options)
510
+ end
511
+
512
+ # Returns a list of the notification rules for an AWS account.
513
+ #
514
+ # @option params [Array<Types::ListNotificationRulesFilter>] :filters
515
+ # The filters to use to return information by service or resource type.
516
+ # For valid values, see ListNotificationRulesFilter.
517
+ #
518
+ # <note markdown="1"> A filter with the same name can appear more than once when used with
519
+ # OR statements. Filters with different names should be applied with AND
520
+ # statements.
521
+ #
522
+ # </note>
523
+ #
524
+ # @option params [String] :next_token
525
+ # An enumeration token that, when provided in a request, returns the
526
+ # next batch of the results.
527
+ #
528
+ # @option params [Integer] :max_results
529
+ # A non-negative integer used to limit the number of returned results.
530
+ # The maximum number of results that can be returned is 100.
531
+ #
532
+ # @return [Types::ListNotificationRulesResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
533
+ #
534
+ # * {Types::ListNotificationRulesResult#next_token #next_token} => String
535
+ # * {Types::ListNotificationRulesResult#notification_rules #notification_rules} => Array&lt;Types::NotificationRuleSummary&gt;
536
+ #
537
+ # @example Request syntax with placeholder values
538
+ #
539
+ # resp = client.list_notification_rules({
540
+ # filters: [
541
+ # {
542
+ # name: "EVENT_TYPE_ID", # required, accepts EVENT_TYPE_ID, CREATED_BY, RESOURCE, TARGET_ADDRESS
543
+ # value: "ListNotificationRulesFilterValue", # required
544
+ # },
545
+ # ],
546
+ # next_token: "NextToken",
547
+ # max_results: 1,
548
+ # })
549
+ #
550
+ # @example Response structure
551
+ #
552
+ # resp.next_token #=> String
553
+ # resp.notification_rules #=> Array
554
+ # resp.notification_rules[0].id #=> String
555
+ # resp.notification_rules[0].arn #=> String
556
+ #
557
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListNotificationRules AWS API Documentation
558
+ #
559
+ # @overload list_notification_rules(params = {})
560
+ # @param [Hash] params ({})
561
+ def list_notification_rules(params = {}, options = {})
562
+ req = build_request(:list_notification_rules, params)
563
+ req.send_request(options)
564
+ end
565
+
566
+ # Returns a list of the tags associated with a notification rule.
567
+ #
568
+ # @option params [required, String] :arn
569
+ # The Amazon Resource Name (ARN) for the notification rule.
570
+ #
571
+ # @return [Types::ListTagsForResourceResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
572
+ #
573
+ # * {Types::ListTagsForResourceResult#tags #tags} => Hash&lt;String,String&gt;
574
+ #
575
+ # @example Request syntax with placeholder values
576
+ #
577
+ # resp = client.list_tags_for_resource({
578
+ # arn: "NotificationRuleArn", # required
579
+ # })
580
+ #
581
+ # @example Response structure
582
+ #
583
+ # resp.tags #=> Hash
584
+ # resp.tags["TagKey"] #=> String
585
+ #
586
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTagsForResource AWS API Documentation
587
+ #
588
+ # @overload list_tags_for_resource(params = {})
589
+ # @param [Hash] params ({})
590
+ def list_tags_for_resource(params = {}, options = {})
591
+ req = build_request(:list_tags_for_resource, params)
592
+ req.send_request(options)
593
+ end
594
+
595
+ # Returns a list of the notification rule targets for an AWS account.
596
+ #
597
+ # @option params [Array<Types::ListTargetsFilter>] :filters
598
+ # The filters to use to return information by service or resource type.
599
+ # Valid filters include target type, target address, and target status.
600
+ #
601
+ # <note markdown="1"> A filter with the same name can appear more than once when used with
602
+ # OR statements. Filters with different names should be applied with AND
603
+ # statements.
604
+ #
605
+ # </note>
606
+ #
607
+ # @option params [String] :next_token
608
+ # An enumeration token that, when provided in a request, returns the
609
+ # next batch of the results.
610
+ #
611
+ # @option params [Integer] :max_results
612
+ # A non-negative integer used to limit the number of returned results.
613
+ # The maximum number of results that can be returned is 100.
614
+ #
615
+ # @return [Types::ListTargetsResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
616
+ #
617
+ # * {Types::ListTargetsResult#targets #targets} => Array&lt;Types::TargetSummary&gt;
618
+ # * {Types::ListTargetsResult#next_token #next_token} => String
619
+ #
620
+ # @example Request syntax with placeholder values
621
+ #
622
+ # resp = client.list_targets({
623
+ # filters: [
624
+ # {
625
+ # name: "TARGET_TYPE", # required, accepts TARGET_TYPE, TARGET_ADDRESS, TARGET_STATUS
626
+ # value: "ListTargetsFilterValue", # required
627
+ # },
628
+ # ],
629
+ # next_token: "NextToken",
630
+ # max_results: 1,
631
+ # })
632
+ #
633
+ # @example Response structure
634
+ #
635
+ # resp.targets #=> Array
636
+ # resp.targets[0].target_address #=> String
637
+ # resp.targets[0].target_type #=> String
638
+ # resp.targets[0].target_status #=> String, one of "PENDING", "ACTIVE", "UNREACHABLE", "INACTIVE", "DEACTIVATED"
639
+ # resp.next_token #=> String
640
+ #
641
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTargets AWS API Documentation
642
+ #
643
+ # @overload list_targets(params = {})
644
+ # @param [Hash] params ({})
645
+ def list_targets(params = {}, options = {})
646
+ req = build_request(:list_targets, params)
647
+ req.send_request(options)
648
+ end
649
+
650
+ # Creates an association between a notification rule and an SNS topic so
651
+ # that the associated target can receive notifications when the events
652
+ # described in the rule are triggered.
653
+ #
654
+ # @option params [required, String] :arn
655
+ # The Amazon Resource Name (ARN) of the notification rule for which you
656
+ # want to create the association.
657
+ #
658
+ # @option params [required, Types::Target] :target
659
+ # Information about the SNS topics associated with a notification rule.
660
+ #
661
+ # @option params [String] :client_request_token
662
+ # An enumeration token that, when provided in a request, returns the
663
+ # next batch of the results.
664
+ #
665
+ # @return [Types::SubscribeResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
666
+ #
667
+ # * {Types::SubscribeResult#arn #arn} => String
668
+ #
669
+ # @example Request syntax with placeholder values
670
+ #
671
+ # resp = client.subscribe({
672
+ # arn: "NotificationRuleArn", # required
673
+ # target: { # required
674
+ # target_type: "TargetType",
675
+ # target_address: "TargetAddress",
676
+ # },
677
+ # client_request_token: "ClientRequestToken",
678
+ # })
679
+ #
680
+ # @example Response structure
681
+ #
682
+ # resp.arn #=> String
683
+ #
684
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Subscribe AWS API Documentation
685
+ #
686
+ # @overload subscribe(params = {})
687
+ # @param [Hash] params ({})
688
+ def subscribe(params = {}, options = {})
689
+ req = build_request(:subscribe, params)
690
+ req.send_request(options)
691
+ end
692
+
693
+ # Associates a set of provided tags with a notification rule.
694
+ #
695
+ # @option params [required, String] :arn
696
+ # The Amazon Resource Name (ARN) of the notification rule to tag.
697
+ #
698
+ # @option params [required, Hash<String,String>] :tags
699
+ # The list of tags to associate with the resource. Tag key names cannot
700
+ # start with "aws".
701
+ #
702
+ # @return [Types::TagResourceResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
703
+ #
704
+ # * {Types::TagResourceResult#tags #tags} => Hash&lt;String,String&gt;
705
+ #
706
+ # @example Request syntax with placeholder values
707
+ #
708
+ # resp = client.tag_resource({
709
+ # arn: "NotificationRuleArn", # required
710
+ # tags: { # required
711
+ # "TagKey" => "TagValue",
712
+ # },
713
+ # })
714
+ #
715
+ # @example Response structure
716
+ #
717
+ # resp.tags #=> Hash
718
+ # resp.tags["TagKey"] #=> String
719
+ #
720
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/TagResource AWS API Documentation
721
+ #
722
+ # @overload tag_resource(params = {})
723
+ # @param [Hash] params ({})
724
+ def tag_resource(params = {}, options = {})
725
+ req = build_request(:tag_resource, params)
726
+ req.send_request(options)
727
+ end
728
+
729
+ # Removes an association between a notification rule and an Amazon SNS
730
+ # topic so that subscribers to that topic stop receiving notifications
731
+ # when the events described in the rule are triggered.
732
+ #
733
+ # @option params [required, String] :arn
734
+ # The Amazon Resource Name (ARN) of the notification rule.
735
+ #
736
+ # @option params [required, String] :target_address
737
+ # The ARN of the SNS topic to unsubscribe from the notification rule.
738
+ #
739
+ # @return [Types::UnsubscribeResult] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
740
+ #
741
+ # * {Types::UnsubscribeResult#arn #arn} => String
742
+ #
743
+ # @example Request syntax with placeholder values
744
+ #
745
+ # resp = client.unsubscribe({
746
+ # arn: "NotificationRuleArn", # required
747
+ # target_address: "TargetAddress", # required
748
+ # })
749
+ #
750
+ # @example Response structure
751
+ #
752
+ # resp.arn #=> String
753
+ #
754
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Unsubscribe AWS API Documentation
755
+ #
756
+ # @overload unsubscribe(params = {})
757
+ # @param [Hash] params ({})
758
+ def unsubscribe(params = {}, options = {})
759
+ req = build_request(:unsubscribe, params)
760
+ req.send_request(options)
761
+ end
762
+
763
+ # Removes the association between one or more provided tags and a
764
+ # notification rule.
765
+ #
766
+ # @option params [required, String] :arn
767
+ # The Amazon Resource Name (ARN) of the notification rule from which to
768
+ # remove the tags.
769
+ #
770
+ # @option params [required, Array<String>] :tag_keys
771
+ # The key names of the tags to remove.
772
+ #
773
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
774
+ #
775
+ # @example Request syntax with placeholder values
776
+ #
777
+ # resp = client.untag_resource({
778
+ # arn: "NotificationRuleArn", # required
779
+ # tag_keys: ["TagKey"], # required
780
+ # })
781
+ #
782
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UntagResource AWS API Documentation
783
+ #
784
+ # @overload untag_resource(params = {})
785
+ # @param [Hash] params ({})
786
+ def untag_resource(params = {}, options = {})
787
+ req = build_request(:untag_resource, params)
788
+ req.send_request(options)
789
+ end
790
+
791
+ # Updates a notification rule for a resource. You can change the events
792
+ # that trigger the notification rule, the status of the rule, and the
793
+ # targets that receive the notifications.
794
+ #
795
+ # <note markdown="1"> To add or remove tags for a notification rule, you must use
796
+ # TagResource and UntagResource.
797
+ #
798
+ # </note>
799
+ #
800
+ # @option params [required, String] :arn
801
+ # The Amazon Resource Name (ARN) of the notification rule.
802
+ #
803
+ # @option params [String] :name
804
+ # The name of the notification rule.
805
+ #
806
+ # @option params [String] :status
807
+ # The status of the notification rule. Valid statuses include enabled
808
+ # (sending notifications) or disabled (not sending notifications).
809
+ #
810
+ # @option params [Array<String>] :event_type_ids
811
+ # A list of event types associated with this notification rule.
812
+ #
813
+ # @option params [Array<Types::Target>] :targets
814
+ # The address and type of the targets to receive notifications from this
815
+ # notification rule.
816
+ #
817
+ # @option params [String] :detail_type
818
+ # The level of detail to include in the notifications for this resource.
819
+ # BASIC will include only the contents of the event as it would appear
820
+ # in AWS CloudWatch. FULL will include any supplemental information
821
+ # provided by AWS CodeStar Notifications and/or the service for the
822
+ # resource for which the notification is created.
823
+ #
824
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
825
+ #
826
+ # @example Request syntax with placeholder values
827
+ #
828
+ # resp = client.update_notification_rule({
829
+ # arn: "NotificationRuleArn", # required
830
+ # name: "NotificationRuleName",
831
+ # status: "ENABLED", # accepts ENABLED, DISABLED
832
+ # event_type_ids: ["EventTypeId"],
833
+ # targets: [
834
+ # {
835
+ # target_type: "TargetType",
836
+ # target_address: "TargetAddress",
837
+ # },
838
+ # ],
839
+ # detail_type: "BASIC", # accepts BASIC, FULL
840
+ # })
841
+ #
842
+ # @see http://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UpdateNotificationRule AWS API Documentation
843
+ #
844
+ # @overload update_notification_rule(params = {})
845
+ # @param [Hash] params ({})
846
+ def update_notification_rule(params = {}, options = {})
847
+ req = build_request(:update_notification_rule, params)
848
+ req.send_request(options)
849
+ end
850
+
851
+ # @!endgroup
852
+
853
+ # @param params ({})
854
+ # @api private
855
+ def build_request(operation_name, params = {})
856
+ handlers = @handlers.for(operation_name)
857
+ context = Seahorse::Client::RequestContext.new(
858
+ operation_name: operation_name,
859
+ operation: config.api.operation(operation_name),
860
+ client: self,
861
+ params: params,
862
+ config: config)
863
+ context[:gem_name] = 'aws-sdk-codestarnotifications'
864
+ context[:gem_version] = '1.0.0'
865
+ Seahorse::Client::Request.new(handlers, context)
866
+ end
867
+
868
+ # @api private
869
+ # @deprecated
870
+ def waiter_names
871
+ []
872
+ end
873
+
874
+ class << self
875
+
876
+ # @api private
877
+ attr_reader :identifier
878
+
879
+ # @api private
880
+ def errors_module
881
+ Errors
882
+ end
883
+
884
+ end
885
+ end
886
+ end