aws-sdk-cloudwatchevents 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 03c644226f70a2bab59d8c9c1bba5ef6cab459af
4
+ data.tar.gz: c3e06e3001e20567a7ee01815347366f1bd0569b
5
+ SHA512:
6
+ metadata.gz: cc5317a1cf65aee36cc00d88888e76b657f851ee0bf9e08ef6923443eef1952078578a3d8c0d8a8343f9601d4cb6e0ce85ac0db5ef071daffe065589bca8bd41
7
+ data.tar.gz: 6d2856e51873f0117dfff040cd919155c00ec5a4e35f5e7f57b7ab14800849b82e20ebc7cfcfe6712a6ad1d4667b192534c1f380d3ea6cc4d7a2dae571d3c8bc
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
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-cloudwatchevents/types'
12
+ require_relative 'aws-sdk-cloudwatchevents/client_api'
13
+ require_relative 'aws-sdk-cloudwatchevents/client'
14
+ require_relative 'aws-sdk-cloudwatchevents/errors'
15
+ require_relative 'aws-sdk-cloudwatchevents/resource'
16
+ require_relative 'aws-sdk-cloudwatchevents/customizations'
17
+
18
+ # This module provides support for Amazon CloudWatch Events. This module is available in the
19
+ # `aws-sdk-cloudwatchevents` 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 Amazon CloudWatch Events all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::CloudWatchEvents::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::CloudWatchEvents
44
+
45
+ GEM_VERSION = '1.0.0.rc1'
46
+
47
+ end
@@ -0,0 +1,615 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
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/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:cloudwatchevents)
25
+
26
+ module Aws
27
+ module CloudWatchEvents
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :cloudwatchevents
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::SignatureV4)
50
+ add_plugin(Aws::Plugins::Protocols::JsonRpc)
51
+
52
+ # @option options [required, Aws::CredentialProvider] :credentials
53
+ # Your AWS credentials. This can be an instance of any one of the
54
+ # following classes:
55
+ #
56
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
57
+ # credentials.
58
+ #
59
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
60
+ # from an EC2 IMDS on an EC2 instance.
61
+ #
62
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
63
+ # shared file, such as `~/.aws/config`.
64
+ #
65
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
66
+ #
67
+ # When `:credentials` are not configured directly, the following
68
+ # locations will be searched for credentials:
69
+ #
70
+ # * `Aws.config[:credentials]`
71
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
72
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
73
+ # * `~/.aws/credentials`
74
+ # * `~/.aws/config`
75
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
76
+ # very aggressive. Construct and pass an instance of
77
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
78
+ # timeouts.
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # @option options [String] :access_key_id
91
+ # @option options [Boolean] :convert_params (true)
92
+ # When `true`, an attempt is made to coerce request parameters into
93
+ # the required types.
94
+ # @option options [String] :endpoint
95
+ # The client endpoint is normally constructed from the `:region`
96
+ # option. You should only configure an `:endpoint` when connecting
97
+ # to test endpoints. This should be avalid HTTP(S) URI.
98
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
99
+ # The log formatter.
100
+ # @option options [Symbol] :log_level (:info)
101
+ # The log level to send messages to the `:logger` at.
102
+ # @option options [Logger] :logger
103
+ # The Logger instance to send log messages to. If this option
104
+ # is not set, logging will be disabled.
105
+ # @option options [String] :profile ("default")
106
+ # Used when loading credentials from the shared credentials file
107
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
108
+ # @option options [Integer] :retry_limit (3)
109
+ # The maximum number of times to retry failed requests. Only
110
+ # ~ 500 level server errors and certain ~ 400 level client errors
111
+ # are retried. Generally, these are throttling errors, data
112
+ # checksum errors, networking errors, timeout errors and auth
113
+ # errors from expired credentials.
114
+ # @option options [String] :secret_access_key
115
+ # @option options [String] :session_token
116
+ # @option options [Boolean] :simple_json (false)
117
+ # Disables request parameter conversion, validation, and formatting.
118
+ # Also disable response data type conversions. This option is useful
119
+ # when you want to ensure the highest level of performance by
120
+ # avoiding overhead of walking request parameters and response data
121
+ # structures.
122
+ #
123
+ # When `:simple_json` is enabled, the request parameters hash must
124
+ # be formatted exactly as the DynamoDB API expects.
125
+ # @option options [Boolean] :stub_responses (false)
126
+ # Causes the client to return stubbed responses. By default
127
+ # fake responses are generated and returned. You can specify
128
+ # the response data to return or errors to raise by calling
129
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
130
+ #
131
+ # ** Please note ** When response stubbing is enabled, no HTTP
132
+ # requests are made, and retries are disabled.
133
+ # @option options [Boolean] :validate_params (true)
134
+ # When `true`, request parameters are validated before
135
+ # sending the request.
136
+ def initialize(*args)
137
+ super
138
+ end
139
+
140
+ # @!group API Operations
141
+
142
+ # Deletes a rule. You must remove all targets from a rule using
143
+ # RemoveTargets before you can delete the rule.
144
+ #
145
+ # **Note:** When you delete a rule, incoming events might still continue
146
+ # to match to the deleted rule. Please allow a short period of time for
147
+ # changes to take effect.
148
+ # @option params [required, String] :name
149
+ # The name of the rule to be deleted.
150
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
151
+ #
152
+ # @example Request syntax with placeholder values
153
+ # resp = client.delete_rule({
154
+ # name: "RuleName", # required
155
+ # })
156
+ # @overload delete_rule(params = {})
157
+ # @param [Hash] params ({})
158
+ def delete_rule(params = {}, options = {})
159
+ req = build_request(:delete_rule, params)
160
+ req.send_request(options)
161
+ end
162
+
163
+ # Describes the details of the specified rule.
164
+ # @option params [required, String] :name
165
+ # The name of the rule you want to describe details for.
166
+ # @return [Types::DescribeRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
167
+ #
168
+ # * {Types::DescribeRuleResponse#name #Name} => String
169
+ # * {Types::DescribeRuleResponse#arn #Arn} => String
170
+ # * {Types::DescribeRuleResponse#event_pattern #EventPattern} => String
171
+ # * {Types::DescribeRuleResponse#schedule_expression #ScheduleExpression} => String
172
+ # * {Types::DescribeRuleResponse#state #State} => String
173
+ # * {Types::DescribeRuleResponse#description #Description} => String
174
+ # * {Types::DescribeRuleResponse#role_arn #RoleArn} => String
175
+ #
176
+ # @example Request syntax with placeholder values
177
+ # resp = client.describe_rule({
178
+ # name: "RuleName", # required
179
+ # })
180
+ #
181
+ # @example Response structure
182
+ # resp.name #=> String
183
+ # resp.arn #=> String
184
+ # resp.event_pattern #=> String
185
+ # resp.schedule_expression #=> String
186
+ # resp.state #=> String, one of "ENABLED", "DISABLED"
187
+ # resp.description #=> String
188
+ # resp.role_arn #=> String
189
+ # @overload describe_rule(params = {})
190
+ # @param [Hash] params ({})
191
+ def describe_rule(params = {}, options = {})
192
+ req = build_request(:describe_rule, params)
193
+ req.send_request(options)
194
+ end
195
+
196
+ # Disables a rule. A disabled rule won't match any events, and won't
197
+ # self-trigger if it has a schedule expression.
198
+ #
199
+ # **Note:** When you disable a rule, incoming events might still
200
+ # continue to match to the disabled rule. Please allow a short period of
201
+ # time for changes to take effect.
202
+ # @option params [required, String] :name
203
+ # The name of the rule you want to disable.
204
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
205
+ #
206
+ # @example Request syntax with placeholder values
207
+ # resp = client.disable_rule({
208
+ # name: "RuleName", # required
209
+ # })
210
+ # @overload disable_rule(params = {})
211
+ # @param [Hash] params ({})
212
+ def disable_rule(params = {}, options = {})
213
+ req = build_request(:disable_rule, params)
214
+ req.send_request(options)
215
+ end
216
+
217
+ # Enables a rule. If the rule does not exist, the operation fails.
218
+ #
219
+ # **Note:** When you enable a rule, incoming events might not
220
+ # immediately start matching to a newly enabled rule. Please allow a
221
+ # short period of time for changes to take effect.
222
+ # @option params [required, String] :name
223
+ # The name of the rule that you want to enable.
224
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
225
+ #
226
+ # @example Request syntax with placeholder values
227
+ # resp = client.enable_rule({
228
+ # name: "RuleName", # required
229
+ # })
230
+ # @overload enable_rule(params = {})
231
+ # @param [Hash] params ({})
232
+ def enable_rule(params = {}, options = {})
233
+ req = build_request(:enable_rule, params)
234
+ req.send_request(options)
235
+ end
236
+
237
+ # Lists the names of the rules that the given target is put to. You can
238
+ # see which of the rules in Amazon CloudWatch Events can invoke a
239
+ # specific target in your account. If you have more rules in your
240
+ # account than the given limit, the results will be paginated. In that
241
+ # case, use the next token returned in the response and repeat
242
+ # ListRulesByTarget until the NextToken in the response is returned as
243
+ # null.
244
+ # @option params [required, String] :target_arn
245
+ # The Amazon Resource Name (ARN) of the target resource that you want to
246
+ # list the rules for.
247
+ # @option params [String] :next_token
248
+ # The token returned by a previous call to indicate that there is more
249
+ # data available.
250
+ # @option params [Integer] :limit
251
+ # The maximum number of results to return.
252
+ # @return [Types::ListRuleNamesByTargetResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
253
+ #
254
+ # * {Types::ListRuleNamesByTargetResponse#rule_names #RuleNames} => Array&lt;String&gt;
255
+ # * {Types::ListRuleNamesByTargetResponse#next_token #NextToken} => String
256
+ #
257
+ # @example Request syntax with placeholder values
258
+ # resp = client.list_rule_names_by_target({
259
+ # target_arn: "TargetArn", # required
260
+ # next_token: "NextToken",
261
+ # limit: 1,
262
+ # })
263
+ #
264
+ # @example Response structure
265
+ # resp.rule_names #=> Array
266
+ # resp.rule_names[0] #=> String
267
+ # resp.next_token #=> String
268
+ # @overload list_rule_names_by_target(params = {})
269
+ # @param [Hash] params ({})
270
+ def list_rule_names_by_target(params = {}, options = {})
271
+ req = build_request(:list_rule_names_by_target, params)
272
+ req.send_request(options)
273
+ end
274
+
275
+ # Lists the Amazon CloudWatch Events rules in your account. You can
276
+ # either list all the rules or you can provide a prefix to match to the
277
+ # rule names. If you have more rules in your account than the given
278
+ # limit, the results will be paginated. In that case, use the next token
279
+ # returned in the response and repeat ListRules until the NextToken in
280
+ # the response is returned as null.
281
+ # @option params [String] :name_prefix
282
+ # The prefix matching the rule name.
283
+ # @option params [String] :next_token
284
+ # The token returned by a previous call to indicate that there is more
285
+ # data available.
286
+ # @option params [Integer] :limit
287
+ # The maximum number of results to return.
288
+ # @return [Types::ListRulesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
289
+ #
290
+ # * {Types::ListRulesResponse#rules #Rules} => Array&lt;Types::Rule&gt;
291
+ # * {Types::ListRulesResponse#next_token #NextToken} => String
292
+ #
293
+ # @example Request syntax with placeholder values
294
+ # resp = client.list_rules({
295
+ # name_prefix: "RuleName",
296
+ # next_token: "NextToken",
297
+ # limit: 1,
298
+ # })
299
+ #
300
+ # @example Response structure
301
+ # resp.rules #=> Array
302
+ # resp.rules[0].name #=> String
303
+ # resp.rules[0].arn #=> String
304
+ # resp.rules[0].event_pattern #=> String
305
+ # resp.rules[0].state #=> String, one of "ENABLED", "DISABLED"
306
+ # resp.rules[0].description #=> String
307
+ # resp.rules[0].schedule_expression #=> String
308
+ # resp.rules[0].role_arn #=> String
309
+ # resp.next_token #=> String
310
+ # @overload list_rules(params = {})
311
+ # @param [Hash] params ({})
312
+ def list_rules(params = {}, options = {})
313
+ req = build_request(:list_rules, params)
314
+ req.send_request(options)
315
+ end
316
+
317
+ # Lists of targets assigned to the rule.
318
+ # @option params [required, String] :rule
319
+ # The name of the rule whose targets you want to list.
320
+ # @option params [String] :next_token
321
+ # The token returned by a previous call to indicate that there is more
322
+ # data available.
323
+ # @option params [Integer] :limit
324
+ # The maximum number of results to return.
325
+ # @return [Types::ListTargetsByRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
326
+ #
327
+ # * {Types::ListTargetsByRuleResponse#targets #Targets} => Array&lt;Types::Target&gt;
328
+ # * {Types::ListTargetsByRuleResponse#next_token #NextToken} => String
329
+ #
330
+ # @example Request syntax with placeholder values
331
+ # resp = client.list_targets_by_rule({
332
+ # rule: "RuleName", # required
333
+ # next_token: "NextToken",
334
+ # limit: 1,
335
+ # })
336
+ #
337
+ # @example Response structure
338
+ # resp.targets #=> Array
339
+ # resp.targets[0].id #=> String
340
+ # resp.targets[0].arn #=> String
341
+ # resp.targets[0].input #=> String
342
+ # resp.targets[0].input_path #=> String
343
+ # resp.next_token #=> String
344
+ # @overload list_targets_by_rule(params = {})
345
+ # @param [Hash] params ({})
346
+ def list_targets_by_rule(params = {}, options = {})
347
+ req = build_request(:list_targets_by_rule, params)
348
+ req.send_request(options)
349
+ end
350
+
351
+ # Sends custom events to Amazon CloudWatch Events so that they can be
352
+ # matched to rules.
353
+ # @option params [required, Array<Types::PutEventsRequestEntry>] :entries
354
+ # The entry that defines an event in your system. You can specify
355
+ # several parameters for the entry such as the source and type of the
356
+ # event, resources associated with the event, and so on.
357
+ # @return [Types::PutEventsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
358
+ #
359
+ # * {Types::PutEventsResponse#failed_entry_count #FailedEntryCount} => Integer
360
+ # * {Types::PutEventsResponse#entries #Entries} => Array&lt;Types::PutEventsResultEntry&gt;
361
+ #
362
+ # @example Request syntax with placeholder values
363
+ # resp = client.put_events({
364
+ # entries: [ # required
365
+ # {
366
+ # time: Time.now,
367
+ # source: "String",
368
+ # resources: ["EventResource"],
369
+ # detail_type: "String",
370
+ # detail: "String",
371
+ # },
372
+ # ],
373
+ # })
374
+ #
375
+ # @example Response structure
376
+ # resp.failed_entry_count #=> Integer
377
+ # resp.entries #=> Array
378
+ # resp.entries[0].event_id #=> String
379
+ # resp.entries[0].error_code #=> String
380
+ # resp.entries[0].error_message #=> String
381
+ # @overload put_events(params = {})
382
+ # @param [Hash] params ({})
383
+ def put_events(params = {}, options = {})
384
+ req = build_request(:put_events, params)
385
+ req.send_request(options)
386
+ end
387
+
388
+ # Creates or updates a rule. Rules are enabled by default, or based on
389
+ # value of the State parameter. You can disable a rule using
390
+ # DisableRule.
391
+ #
392
+ # **Note:** When you create or update a rule, incoming events might not
393
+ # immediately start matching to new or updated rules. Please allow a
394
+ # short period of time for changes to take effect.
395
+ #
396
+ # A rule must contain at least an EventPattern or ScheduleExpression.
397
+ # Rules with EventPatterns are triggered when a matching event is
398
+ # observed. Rules with ScheduleExpressions self-trigger based on the
399
+ # given schedule. A rule can have both an EventPattern and a
400
+ # ScheduleExpression, in which case the rule will trigger on matching
401
+ # events as well as on a schedule.
402
+ #
403
+ # **Note:** Most services in AWS treat : or / as the same character in
404
+ # Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact
405
+ # match in event patterns and rules. Be sure to use the correct ARN
406
+ # characters when creating event patterns so that they match the ARN
407
+ # syntax in the event you want to match.
408
+ # @option params [required, String] :name
409
+ # The name of the rule that you are creating or updating.
410
+ # @option params [String] :schedule_expression
411
+ # The scheduling expression. For example, "cron(0 20 * * ? *)",
412
+ # "rate(5 minutes)".
413
+ # @option params [String] :event_pattern
414
+ # The event pattern.
415
+ # @option params [String] :state
416
+ # Indicates whether the rule is enabled or disabled.
417
+ # @option params [String] :description
418
+ # A description of the rule.
419
+ # @option params [String] :role_arn
420
+ # The Amazon Resource Name (ARN) of the IAM role associated with the
421
+ # rule.
422
+ # @return [Types::PutRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
423
+ #
424
+ # * {Types::PutRuleResponse#rule_arn #RuleArn} => String
425
+ #
426
+ # @example Request syntax with placeholder values
427
+ # resp = client.put_rule({
428
+ # name: "RuleName", # required
429
+ # schedule_expression: "ScheduleExpression",
430
+ # event_pattern: "EventPattern",
431
+ # state: "ENABLED", # accepts ENABLED, DISABLED
432
+ # description: "RuleDescription",
433
+ # role_arn: "RoleArn",
434
+ # })
435
+ #
436
+ # @example Response structure
437
+ # resp.rule_arn #=> String
438
+ # @overload put_rule(params = {})
439
+ # @param [Hash] params ({})
440
+ def put_rule(params = {}, options = {})
441
+ req = build_request(:put_rule, params)
442
+ req.send_request(options)
443
+ end
444
+
445
+ # Adds target(s) to a rule. Targets are the resources that can be
446
+ # invoked when a rule is triggered. For example, AWS Lambda functions,
447
+ # Amazon Kinesis streams, and built-in targets. Updates the target(s) if
448
+ # they are already associated with the role. In other words, if there is
449
+ # already a target with the given target ID, then the target associated
450
+ # with that ID is updated.
451
+ #
452
+ # In order to be able to make API calls against the resources you own,
453
+ # Amazon CloudWatch Events needs the appropriate permissions. For AWS
454
+ # Lambda and Amazon SNS resources, CloudWatch Events relies on
455
+ # resource-based policies. For Amazon Kinesis streams, CloudWatch Events
456
+ # relies on IAM roles. For more information, see [Permissions for
457
+ # Sending Events to Targets][1] in the ***Amazon CloudWatch Developer
458
+ # Guide***.
459
+ #
460
+ # **Input** and **InputPath** are mutually-exclusive and optional
461
+ # parameters of a target. When a rule is triggered due to a matched
462
+ # event, if for a target:
463
+ #
464
+ # * Neither **Input** nor **InputPath** is specified, then the entire
465
+ # event is passed to the target in JSON form.
466
+ # * **InputPath** is specified in the form of JSONPath (e.g.
467
+ # **$.detail**), then only the part of the event specified in the path
468
+ # is passed to the target (e.g. only the detail part of the event is
469
+ # passed).
470
+ # * **Input** is specified in the form of a valid JSON, then the matched
471
+ # event is overridden with this constant.
472
+ #
473
+ # **Note:** When you add targets to a rule, when the associated rule
474
+ # triggers, new or updated targets might not be immediately invoked.
475
+ # Please allow a short period of time for changes to take effect.
476
+ #
477
+ #
478
+ #
479
+ # [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/EventsTargetPermissions.html
480
+ # @option params [required, String] :rule
481
+ # The name of the rule you want to add targets to.
482
+ # @option params [required, Array<Types::Target>] :targets
483
+ # List of targets you want to update or add to the rule.
484
+ # @return [Types::PutTargetsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
485
+ #
486
+ # * {Types::PutTargetsResponse#failed_entry_count #FailedEntryCount} => Integer
487
+ # * {Types::PutTargetsResponse#failed_entries #FailedEntries} => Array&lt;Types::PutTargetsResultEntry&gt;
488
+ #
489
+ # @example Request syntax with placeholder values
490
+ # resp = client.put_targets({
491
+ # rule: "RuleName", # required
492
+ # targets: [ # required
493
+ # {
494
+ # id: "TargetId", # required
495
+ # arn: "TargetArn", # required
496
+ # input: "TargetInput",
497
+ # input_path: "TargetInputPath",
498
+ # },
499
+ # ],
500
+ # })
501
+ #
502
+ # @example Response structure
503
+ # resp.failed_entry_count #=> Integer
504
+ # resp.failed_entries #=> Array
505
+ # resp.failed_entries[0].target_id #=> String
506
+ # resp.failed_entries[0].error_code #=> String
507
+ # resp.failed_entries[0].error_message #=> String
508
+ # @overload put_targets(params = {})
509
+ # @param [Hash] params ({})
510
+ def put_targets(params = {}, options = {})
511
+ req = build_request(:put_targets, params)
512
+ req.send_request(options)
513
+ end
514
+
515
+ # Removes target(s) from a rule so that when the rule is triggered,
516
+ # those targets will no longer be invoked.
517
+ #
518
+ # **Note:** When you remove a target, when the associated rule triggers,
519
+ # removed targets might still continue to be invoked. Please allow a
520
+ # short period of time for changes to take effect.
521
+ # @option params [required, String] :rule
522
+ # The name of the rule you want to remove targets from.
523
+ # @option params [required, Array<String>] :ids
524
+ # The list of target IDs to remove from the rule.
525
+ # @return [Types::RemoveTargetsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
526
+ #
527
+ # * {Types::RemoveTargetsResponse#failed_entry_count #FailedEntryCount} => Integer
528
+ # * {Types::RemoveTargetsResponse#failed_entries #FailedEntries} => Array&lt;Types::RemoveTargetsResultEntry&gt;
529
+ #
530
+ # @example Request syntax with placeholder values
531
+ # resp = client.remove_targets({
532
+ # rule: "RuleName", # required
533
+ # ids: ["TargetId"], # required
534
+ # })
535
+ #
536
+ # @example Response structure
537
+ # resp.failed_entry_count #=> Integer
538
+ # resp.failed_entries #=> Array
539
+ # resp.failed_entries[0].target_id #=> String
540
+ # resp.failed_entries[0].error_code #=> String
541
+ # resp.failed_entries[0].error_message #=> String
542
+ # @overload remove_targets(params = {})
543
+ # @param [Hash] params ({})
544
+ def remove_targets(params = {}, options = {})
545
+ req = build_request(:remove_targets, params)
546
+ req.send_request(options)
547
+ end
548
+
549
+ # Tests whether an event pattern matches the provided event.
550
+ #
551
+ # **Note:** Most services in AWS treat : or / as the same character in
552
+ # Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact
553
+ # match in event patterns and rules. Be sure to use the correct ARN
554
+ # characters when creating event patterns so that they match the ARN
555
+ # syntax in the event you want to match.
556
+ # @option params [required, String] :event_pattern
557
+ # The event pattern you want to test.
558
+ # @option params [required, String] :event
559
+ # The event in the JSON format to test against the event pattern.
560
+ # @return [Types::TestEventPatternResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
561
+ #
562
+ # * {Types::TestEventPatternResponse#result #Result} => Boolean
563
+ #
564
+ # @example Request syntax with placeholder values
565
+ # resp = client.test_event_pattern({
566
+ # event_pattern: "EventPattern", # required
567
+ # event: "String", # required
568
+ # })
569
+ #
570
+ # @example Response structure
571
+ # resp.result #=> Boolean
572
+ # @overload test_event_pattern(params = {})
573
+ # @param [Hash] params ({})
574
+ def test_event_pattern(params = {}, options = {})
575
+ req = build_request(:test_event_pattern, params)
576
+ req.send_request(options)
577
+ end
578
+
579
+ # @!endgroup
580
+
581
+ # @param params ({})
582
+ # @api private
583
+ def build_request(operation_name, params = {})
584
+ handlers = @handlers.for(operation_name)
585
+ context = Seahorse::Client::RequestContext.new(
586
+ operation_name: operation_name,
587
+ operation: config.api.operation(operation_name),
588
+ client: self,
589
+ params: params,
590
+ config: config)
591
+ context[:gem_name] = 'aws-sdk-cloudwatchevents'
592
+ context[:gem_version] = '1.0.0.rc1'
593
+ Seahorse::Client::Request.new(handlers, context)
594
+ end
595
+
596
+ # @api private
597
+ # @deprecated
598
+ def waiter_names
599
+ []
600
+ end
601
+
602
+ class << self
603
+
604
+ # @api private
605
+ attr_reader :identifier
606
+
607
+ # @api private
608
+ def errors_module
609
+ Errors
610
+ end
611
+
612
+ end
613
+ end
614
+ end
615
+ end