api.go 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package cloudwatchevents provides a client for Amazon CloudWatch Events.
  3. package cloudwatchevents
  4. import (
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  11. )
  12. const opDeleteRule = "DeleteRule"
  13. // DeleteRuleRequest generates a "aws/request.Request" representing the
  14. // client's request for the DeleteRule operation. The "output" return
  15. // value can be used to capture response data after the request's "Send" method
  16. // is called.
  17. //
  18. // Creating a request object using this method should be used when you want to inject
  19. // custom logic into the request's lifecycle using a custom handler, or if you want to
  20. // access properties on the request object before or after sending the request. If
  21. // you just want the service response, call the DeleteRule method directly
  22. // instead.
  23. //
  24. // Note: You must call the "Send" method on the returned request object in order
  25. // to execute the request.
  26. //
  27. // // Example sending a request using the DeleteRuleRequest method.
  28. // req, resp := client.DeleteRuleRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) {
  36. op := &request.Operation{
  37. Name: opDeleteRule,
  38. HTTPMethod: "POST",
  39. HTTPPath: "/",
  40. }
  41. if input == nil {
  42. input = &DeleteRuleInput{}
  43. }
  44. req = c.newRequest(op, input, output)
  45. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  46. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  47. output = &DeleteRuleOutput{}
  48. req.Data = output
  49. return
  50. }
  51. // Deletes a rule. You must remove all targets from a rule using RemoveTargets
  52. // before you can delete the rule.
  53. //
  54. // Note: When you delete a rule, incoming events might still continue to match
  55. // to the deleted rule. Please allow a short period of time for changes to take
  56. // effect.
  57. func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) {
  58. req, out := c.DeleteRuleRequest(input)
  59. err := req.Send()
  60. return out, err
  61. }
  62. const opDescribeRule = "DescribeRule"
  63. // DescribeRuleRequest generates a "aws/request.Request" representing the
  64. // client's request for the DescribeRule operation. The "output" return
  65. // value can be used to capture response data after the request's "Send" method
  66. // is called.
  67. //
  68. // Creating a request object using this method should be used when you want to inject
  69. // custom logic into the request's lifecycle using a custom handler, or if you want to
  70. // access properties on the request object before or after sending the request. If
  71. // you just want the service response, call the DescribeRule method directly
  72. // instead.
  73. //
  74. // Note: You must call the "Send" method on the returned request object in order
  75. // to execute the request.
  76. //
  77. // // Example sending a request using the DescribeRuleRequest method.
  78. // req, resp := client.DescribeRuleRequest(params)
  79. //
  80. // err := req.Send()
  81. // if err == nil { // resp is now filled
  82. // fmt.Println(resp)
  83. // }
  84. //
  85. func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *request.Request, output *DescribeRuleOutput) {
  86. op := &request.Operation{
  87. Name: opDescribeRule,
  88. HTTPMethod: "POST",
  89. HTTPPath: "/",
  90. }
  91. if input == nil {
  92. input = &DescribeRuleInput{}
  93. }
  94. req = c.newRequest(op, input, output)
  95. output = &DescribeRuleOutput{}
  96. req.Data = output
  97. return
  98. }
  99. // Describes the details of the specified rule.
  100. func (c *CloudWatchEvents) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error) {
  101. req, out := c.DescribeRuleRequest(input)
  102. err := req.Send()
  103. return out, err
  104. }
  105. const opDisableRule = "DisableRule"
  106. // DisableRuleRequest generates a "aws/request.Request" representing the
  107. // client's request for the DisableRule operation. The "output" return
  108. // value can be used to capture response data after the request's "Send" method
  109. // is called.
  110. //
  111. // Creating a request object using this method should be used when you want to inject
  112. // custom logic into the request's lifecycle using a custom handler, or if you want to
  113. // access properties on the request object before or after sending the request. If
  114. // you just want the service response, call the DisableRule method directly
  115. // instead.
  116. //
  117. // Note: You must call the "Send" method on the returned request object in order
  118. // to execute the request.
  119. //
  120. // // Example sending a request using the DisableRuleRequest method.
  121. // req, resp := client.DisableRuleRequest(params)
  122. //
  123. // err := req.Send()
  124. // if err == nil { // resp is now filled
  125. // fmt.Println(resp)
  126. // }
  127. //
  128. func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *request.Request, output *DisableRuleOutput) {
  129. op := &request.Operation{
  130. Name: opDisableRule,
  131. HTTPMethod: "POST",
  132. HTTPPath: "/",
  133. }
  134. if input == nil {
  135. input = &DisableRuleInput{}
  136. }
  137. req = c.newRequest(op, input, output)
  138. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  139. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  140. output = &DisableRuleOutput{}
  141. req.Data = output
  142. return
  143. }
  144. // Disables a rule. A disabled rule won't match any events, and won't self-trigger
  145. // if it has a schedule expression.
  146. //
  147. // Note: When you disable a rule, incoming events might still continue to
  148. // match to the disabled rule. Please allow a short period of time for changes
  149. // to take effect.
  150. func (c *CloudWatchEvents) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error) {
  151. req, out := c.DisableRuleRequest(input)
  152. err := req.Send()
  153. return out, err
  154. }
  155. const opEnableRule = "EnableRule"
  156. // EnableRuleRequest generates a "aws/request.Request" representing the
  157. // client's request for the EnableRule operation. The "output" return
  158. // value can be used to capture response data after the request's "Send" method
  159. // is called.
  160. //
  161. // Creating a request object using this method should be used when you want to inject
  162. // custom logic into the request's lifecycle using a custom handler, or if you want to
  163. // access properties on the request object before or after sending the request. If
  164. // you just want the service response, call the EnableRule method directly
  165. // instead.
  166. //
  167. // Note: You must call the "Send" method on the returned request object in order
  168. // to execute the request.
  169. //
  170. // // Example sending a request using the EnableRuleRequest method.
  171. // req, resp := client.EnableRuleRequest(params)
  172. //
  173. // err := req.Send()
  174. // if err == nil { // resp is now filled
  175. // fmt.Println(resp)
  176. // }
  177. //
  178. func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *request.Request, output *EnableRuleOutput) {
  179. op := &request.Operation{
  180. Name: opEnableRule,
  181. HTTPMethod: "POST",
  182. HTTPPath: "/",
  183. }
  184. if input == nil {
  185. input = &EnableRuleInput{}
  186. }
  187. req = c.newRequest(op, input, output)
  188. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  189. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  190. output = &EnableRuleOutput{}
  191. req.Data = output
  192. return
  193. }
  194. // Enables a rule. If the rule does not exist, the operation fails.
  195. //
  196. // Note: When you enable a rule, incoming events might not immediately start
  197. // matching to a newly enabled rule. Please allow a short period of time for
  198. // changes to take effect.
  199. func (c *CloudWatchEvents) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error) {
  200. req, out := c.EnableRuleRequest(input)
  201. err := req.Send()
  202. return out, err
  203. }
  204. const opListRuleNamesByTarget = "ListRuleNamesByTarget"
  205. // ListRuleNamesByTargetRequest generates a "aws/request.Request" representing the
  206. // client's request for the ListRuleNamesByTarget operation. The "output" return
  207. // value can be used to capture response data after the request's "Send" method
  208. // is called.
  209. //
  210. // Creating a request object using this method should be used when you want to inject
  211. // custom logic into the request's lifecycle using a custom handler, or if you want to
  212. // access properties on the request object before or after sending the request. If
  213. // you just want the service response, call the ListRuleNamesByTarget method directly
  214. // instead.
  215. //
  216. // Note: You must call the "Send" method on the returned request object in order
  217. // to execute the request.
  218. //
  219. // // Example sending a request using the ListRuleNamesByTargetRequest method.
  220. // req, resp := client.ListRuleNamesByTargetRequest(params)
  221. //
  222. // err := req.Send()
  223. // if err == nil { // resp is now filled
  224. // fmt.Println(resp)
  225. // }
  226. //
  227. func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTargetInput) (req *request.Request, output *ListRuleNamesByTargetOutput) {
  228. op := &request.Operation{
  229. Name: opListRuleNamesByTarget,
  230. HTTPMethod: "POST",
  231. HTTPPath: "/",
  232. }
  233. if input == nil {
  234. input = &ListRuleNamesByTargetInput{}
  235. }
  236. req = c.newRequest(op, input, output)
  237. output = &ListRuleNamesByTargetOutput{}
  238. req.Data = output
  239. return
  240. }
  241. // Lists the names of the rules that the given target is put to. You can see
  242. // which of the rules in Amazon CloudWatch Events can invoke a specific target
  243. // in your account. If you have more rules in your account than the given limit,
  244. // the results will be paginated. In that case, use the next token returned
  245. // in the response and repeat ListRulesByTarget until the NextToken in the response
  246. // is returned as null.
  247. func (c *CloudWatchEvents) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) {
  248. req, out := c.ListRuleNamesByTargetRequest(input)
  249. err := req.Send()
  250. return out, err
  251. }
  252. const opListRules = "ListRules"
  253. // ListRulesRequest generates a "aws/request.Request" representing the
  254. // client's request for the ListRules operation. The "output" return
  255. // value can be used to capture response data after the request's "Send" method
  256. // is called.
  257. //
  258. // Creating a request object using this method should be used when you want to inject
  259. // custom logic into the request's lifecycle using a custom handler, or if you want to
  260. // access properties on the request object before or after sending the request. If
  261. // you just want the service response, call the ListRules method directly
  262. // instead.
  263. //
  264. // Note: You must call the "Send" method on the returned request object in order
  265. // to execute the request.
  266. //
  267. // // Example sending a request using the ListRulesRequest method.
  268. // req, resp := client.ListRulesRequest(params)
  269. //
  270. // err := req.Send()
  271. // if err == nil { // resp is now filled
  272. // fmt.Println(resp)
  273. // }
  274. //
  275. func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) {
  276. op := &request.Operation{
  277. Name: opListRules,
  278. HTTPMethod: "POST",
  279. HTTPPath: "/",
  280. }
  281. if input == nil {
  282. input = &ListRulesInput{}
  283. }
  284. req = c.newRequest(op, input, output)
  285. output = &ListRulesOutput{}
  286. req.Data = output
  287. return
  288. }
  289. // Lists the Amazon CloudWatch Events rules in your account. You can either
  290. // list all the rules or you can provide a prefix to match to the rule names.
  291. // If you have more rules in your account than the given limit, the results
  292. // will be paginated. In that case, use the next token returned in the response
  293. // and repeat ListRules until the NextToken in the response is returned as null.
  294. func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error) {
  295. req, out := c.ListRulesRequest(input)
  296. err := req.Send()
  297. return out, err
  298. }
  299. const opListTargetsByRule = "ListTargetsByRule"
  300. // ListTargetsByRuleRequest generates a "aws/request.Request" representing the
  301. // client's request for the ListTargetsByRule operation. The "output" return
  302. // value can be used to capture response data after the request's "Send" method
  303. // is called.
  304. //
  305. // Creating a request object using this method should be used when you want to inject
  306. // custom logic into the request's lifecycle using a custom handler, or if you want to
  307. // access properties on the request object before or after sending the request. If
  308. // you just want the service response, call the ListTargetsByRule method directly
  309. // instead.
  310. //
  311. // Note: You must call the "Send" method on the returned request object in order
  312. // to execute the request.
  313. //
  314. // // Example sending a request using the ListTargetsByRuleRequest method.
  315. // req, resp := client.ListTargetsByRuleRequest(params)
  316. //
  317. // err := req.Send()
  318. // if err == nil { // resp is now filled
  319. // fmt.Println(resp)
  320. // }
  321. //
  322. func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInput) (req *request.Request, output *ListTargetsByRuleOutput) {
  323. op := &request.Operation{
  324. Name: opListTargetsByRule,
  325. HTTPMethod: "POST",
  326. HTTPPath: "/",
  327. }
  328. if input == nil {
  329. input = &ListTargetsByRuleInput{}
  330. }
  331. req = c.newRequest(op, input, output)
  332. output = &ListTargetsByRuleOutput{}
  333. req.Data = output
  334. return
  335. }
  336. // Lists of targets assigned to the rule.
  337. func (c *CloudWatchEvents) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error) {
  338. req, out := c.ListTargetsByRuleRequest(input)
  339. err := req.Send()
  340. return out, err
  341. }
  342. const opPutEvents = "PutEvents"
  343. // PutEventsRequest generates a "aws/request.Request" representing the
  344. // client's request for the PutEvents operation. The "output" return
  345. // value can be used to capture response data after the request's "Send" method
  346. // is called.
  347. //
  348. // Creating a request object using this method should be used when you want to inject
  349. // custom logic into the request's lifecycle using a custom handler, or if you want to
  350. // access properties on the request object before or after sending the request. If
  351. // you just want the service response, call the PutEvents method directly
  352. // instead.
  353. //
  354. // Note: You must call the "Send" method on the returned request object in order
  355. // to execute the request.
  356. //
  357. // // Example sending a request using the PutEventsRequest method.
  358. // req, resp := client.PutEventsRequest(params)
  359. //
  360. // err := req.Send()
  361. // if err == nil { // resp is now filled
  362. // fmt.Println(resp)
  363. // }
  364. //
  365. func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) {
  366. op := &request.Operation{
  367. Name: opPutEvents,
  368. HTTPMethod: "POST",
  369. HTTPPath: "/",
  370. }
  371. if input == nil {
  372. input = &PutEventsInput{}
  373. }
  374. req = c.newRequest(op, input, output)
  375. output = &PutEventsOutput{}
  376. req.Data = output
  377. return
  378. }
  379. // Sends custom events to Amazon CloudWatch Events so that they can be matched
  380. // to rules.
  381. func (c *CloudWatchEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) {
  382. req, out := c.PutEventsRequest(input)
  383. err := req.Send()
  384. return out, err
  385. }
  386. const opPutRule = "PutRule"
  387. // PutRuleRequest generates a "aws/request.Request" representing the
  388. // client's request for the PutRule operation. The "output" return
  389. // value can be used to capture response data after the request's "Send" method
  390. // is called.
  391. //
  392. // Creating a request object using this method should be used when you want to inject
  393. // custom logic into the request's lifecycle using a custom handler, or if you want to
  394. // access properties on the request object before or after sending the request. If
  395. // you just want the service response, call the PutRule method directly
  396. // instead.
  397. //
  398. // Note: You must call the "Send" method on the returned request object in order
  399. // to execute the request.
  400. //
  401. // // Example sending a request using the PutRuleRequest method.
  402. // req, resp := client.PutRuleRequest(params)
  403. //
  404. // err := req.Send()
  405. // if err == nil { // resp is now filled
  406. // fmt.Println(resp)
  407. // }
  408. //
  409. func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Request, output *PutRuleOutput) {
  410. op := &request.Operation{
  411. Name: opPutRule,
  412. HTTPMethod: "POST",
  413. HTTPPath: "/",
  414. }
  415. if input == nil {
  416. input = &PutRuleInput{}
  417. }
  418. req = c.newRequest(op, input, output)
  419. output = &PutRuleOutput{}
  420. req.Data = output
  421. return
  422. }
  423. // Creates or updates a rule. Rules are enabled by default, or based on value
  424. // of the State parameter. You can disable a rule using DisableRule.
  425. //
  426. // Note: When you create or update a rule, incoming events might not immediately
  427. // start matching to new or updated rules. Please allow a short period of time
  428. // for changes to take effect.
  429. //
  430. // A rule must contain at least an EventPattern or ScheduleExpression. Rules
  431. // with EventPatterns are triggered when a matching event is observed. Rules
  432. // with ScheduleExpressions self-trigger based on the given schedule. A rule
  433. // can have both an EventPattern and a ScheduleExpression, in which case the
  434. // rule will trigger on matching events as well as on a schedule.
  435. //
  436. // Note: Most services in AWS treat : or / as the same character in Amazon
  437. // Resource Names (ARNs). However, CloudWatch Events uses an exact match in
  438. // event patterns and rules. Be sure to use the correct ARN characters when
  439. // creating event patterns so that they match the ARN syntax in the event you
  440. // want to match.
  441. func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error) {
  442. req, out := c.PutRuleRequest(input)
  443. err := req.Send()
  444. return out, err
  445. }
  446. const opPutTargets = "PutTargets"
  447. // PutTargetsRequest generates a "aws/request.Request" representing the
  448. // client's request for the PutTargets operation. The "output" return
  449. // value can be used to capture response data after the request's "Send" method
  450. // is called.
  451. //
  452. // Creating a request object using this method should be used when you want to inject
  453. // custom logic into the request's lifecycle using a custom handler, or if you want to
  454. // access properties on the request object before or after sending the request. If
  455. // you just want the service response, call the PutTargets method directly
  456. // instead.
  457. //
  458. // Note: You must call the "Send" method on the returned request object in order
  459. // to execute the request.
  460. //
  461. // // Example sending a request using the PutTargetsRequest method.
  462. // req, resp := client.PutTargetsRequest(params)
  463. //
  464. // err := req.Send()
  465. // if err == nil { // resp is now filled
  466. // fmt.Println(resp)
  467. // }
  468. //
  469. func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *request.Request, output *PutTargetsOutput) {
  470. op := &request.Operation{
  471. Name: opPutTargets,
  472. HTTPMethod: "POST",
  473. HTTPPath: "/",
  474. }
  475. if input == nil {
  476. input = &PutTargetsInput{}
  477. }
  478. req = c.newRequest(op, input, output)
  479. output = &PutTargetsOutput{}
  480. req.Data = output
  481. return
  482. }
  483. // Adds target(s) to a rule. Targets are the resources that can be invoked when
  484. // a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams,
  485. // and built-in targets. Updates the target(s) if they are already associated
  486. // with the role. In other words, if there is already a target with the given
  487. // target ID, then the target associated with that ID is updated.
  488. //
  489. // In order to be able to make API calls against the resources you own, Amazon
  490. // CloudWatch Events needs the appropriate permissions. For AWS Lambda and Amazon
  491. // SNS resources, CloudWatch Events relies on resource-based policies. For Amazon
  492. // Kinesis streams, CloudWatch Events relies on IAM roles. For more information,
  493. // see Permissions for Sending Events to Targets (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/EventsTargetPermissions.html)
  494. // in the Amazon CloudWatch Developer Guide.
  495. //
  496. // Input and InputPath are mutually-exclusive and optional parameters of a
  497. // target. When a rule is triggered due to a matched event, if for a target:
  498. //
  499. // Neither Input nor InputPath is specified, then the entire event is passed
  500. // to the target in JSON form. InputPath is specified in the form of JSONPath
  501. // (e.g. $.detail), then only the part of the event specified in the path is
  502. // passed to the target (e.g. only the detail part of the event is passed).
  503. // Input is specified in the form of a valid JSON, then the matched event
  504. // is overridden with this constant. Note: When you add targets to a rule,
  505. // when the associated rule triggers, new or updated targets might not be immediately
  506. // invoked. Please allow a short period of time for changes to take effect.
  507. func (c *CloudWatchEvents) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error) {
  508. req, out := c.PutTargetsRequest(input)
  509. err := req.Send()
  510. return out, err
  511. }
  512. const opRemoveTargets = "RemoveTargets"
  513. // RemoveTargetsRequest generates a "aws/request.Request" representing the
  514. // client's request for the RemoveTargets operation. The "output" return
  515. // value can be used to capture response data after the request's "Send" method
  516. // is called.
  517. //
  518. // Creating a request object using this method should be used when you want to inject
  519. // custom logic into the request's lifecycle using a custom handler, or if you want to
  520. // access properties on the request object before or after sending the request. If
  521. // you just want the service response, call the RemoveTargets method directly
  522. // instead.
  523. //
  524. // Note: You must call the "Send" method on the returned request object in order
  525. // to execute the request.
  526. //
  527. // // Example sending a request using the RemoveTargetsRequest method.
  528. // req, resp := client.RemoveTargetsRequest(params)
  529. //
  530. // err := req.Send()
  531. // if err == nil { // resp is now filled
  532. // fmt.Println(resp)
  533. // }
  534. //
  535. func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req *request.Request, output *RemoveTargetsOutput) {
  536. op := &request.Operation{
  537. Name: opRemoveTargets,
  538. HTTPMethod: "POST",
  539. HTTPPath: "/",
  540. }
  541. if input == nil {
  542. input = &RemoveTargetsInput{}
  543. }
  544. req = c.newRequest(op, input, output)
  545. output = &RemoveTargetsOutput{}
  546. req.Data = output
  547. return
  548. }
  549. // Removes target(s) from a rule so that when the rule is triggered, those targets
  550. // will no longer be invoked.
  551. //
  552. // Note: When you remove a target, when the associated rule triggers, removed
  553. // targets might still continue to be invoked. Please allow a short period of
  554. // time for changes to take effect.
  555. func (c *CloudWatchEvents) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error) {
  556. req, out := c.RemoveTargetsRequest(input)
  557. err := req.Send()
  558. return out, err
  559. }
  560. const opTestEventPattern = "TestEventPattern"
  561. // TestEventPatternRequest generates a "aws/request.Request" representing the
  562. // client's request for the TestEventPattern operation. The "output" return
  563. // value can be used to capture response data after the request's "Send" method
  564. // is called.
  565. //
  566. // Creating a request object using this method should be used when you want to inject
  567. // custom logic into the request's lifecycle using a custom handler, or if you want to
  568. // access properties on the request object before or after sending the request. If
  569. // you just want the service response, call the TestEventPattern method directly
  570. // instead.
  571. //
  572. // Note: You must call the "Send" method on the returned request object in order
  573. // to execute the request.
  574. //
  575. // // Example sending a request using the TestEventPatternRequest method.
  576. // req, resp := client.TestEventPatternRequest(params)
  577. //
  578. // err := req.Send()
  579. // if err == nil { // resp is now filled
  580. // fmt.Println(resp)
  581. // }
  582. //
  583. func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) (req *request.Request, output *TestEventPatternOutput) {
  584. op := &request.Operation{
  585. Name: opTestEventPattern,
  586. HTTPMethod: "POST",
  587. HTTPPath: "/",
  588. }
  589. if input == nil {
  590. input = &TestEventPatternInput{}
  591. }
  592. req = c.newRequest(op, input, output)
  593. output = &TestEventPatternOutput{}
  594. req.Data = output
  595. return
  596. }
  597. // Tests whether an event pattern matches the provided event.
  598. //
  599. // Note: Most services in AWS treat : or / as the same character in Amazon
  600. // Resource Names (ARNs). However, CloudWatch Events uses an exact match in
  601. // event patterns and rules. Be sure to use the correct ARN characters when
  602. // creating event patterns so that they match the ARN syntax in the event you
  603. // want to match.
  604. func (c *CloudWatchEvents) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error) {
  605. req, out := c.TestEventPatternRequest(input)
  606. err := req.Send()
  607. return out, err
  608. }
  609. // Container for the parameters to the DeleteRule operation.
  610. type DeleteRuleInput struct {
  611. _ struct{} `type:"structure"`
  612. // The name of the rule to be deleted.
  613. Name *string `min:"1" type:"string" required:"true"`
  614. }
  615. // String returns the string representation
  616. func (s DeleteRuleInput) String() string {
  617. return awsutil.Prettify(s)
  618. }
  619. // GoString returns the string representation
  620. func (s DeleteRuleInput) GoString() string {
  621. return s.String()
  622. }
  623. // Validate inspects the fields of the type to determine if they are valid.
  624. func (s *DeleteRuleInput) Validate() error {
  625. invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"}
  626. if s.Name == nil {
  627. invalidParams.Add(request.NewErrParamRequired("Name"))
  628. }
  629. if s.Name != nil && len(*s.Name) < 1 {
  630. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  631. }
  632. if invalidParams.Len() > 0 {
  633. return invalidParams
  634. }
  635. return nil
  636. }
  637. type DeleteRuleOutput struct {
  638. _ struct{} `type:"structure"`
  639. }
  640. // String returns the string representation
  641. func (s DeleteRuleOutput) String() string {
  642. return awsutil.Prettify(s)
  643. }
  644. // GoString returns the string representation
  645. func (s DeleteRuleOutput) GoString() string {
  646. return s.String()
  647. }
  648. // Container for the parameters to the DescribeRule operation.
  649. type DescribeRuleInput struct {
  650. _ struct{} `type:"structure"`
  651. // The name of the rule you want to describe details for.
  652. Name *string `min:"1" type:"string" required:"true"`
  653. }
  654. // String returns the string representation
  655. func (s DescribeRuleInput) String() string {
  656. return awsutil.Prettify(s)
  657. }
  658. // GoString returns the string representation
  659. func (s DescribeRuleInput) GoString() string {
  660. return s.String()
  661. }
  662. // Validate inspects the fields of the type to determine if they are valid.
  663. func (s *DescribeRuleInput) Validate() error {
  664. invalidParams := request.ErrInvalidParams{Context: "DescribeRuleInput"}
  665. if s.Name == nil {
  666. invalidParams.Add(request.NewErrParamRequired("Name"))
  667. }
  668. if s.Name != nil && len(*s.Name) < 1 {
  669. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  670. }
  671. if invalidParams.Len() > 0 {
  672. return invalidParams
  673. }
  674. return nil
  675. }
  676. // The result of the DescribeRule operation.
  677. type DescribeRuleOutput struct {
  678. _ struct{} `type:"structure"`
  679. // The Amazon Resource Name (ARN) associated with the rule.
  680. Arn *string `min:"1" type:"string"`
  681. // The rule's description.
  682. Description *string `type:"string"`
  683. // The event pattern.
  684. EventPattern *string `type:"string"`
  685. // The rule's name.
  686. Name *string `min:"1" type:"string"`
  687. // The Amazon Resource Name (ARN) of the IAM role associated with the rule.
  688. RoleArn *string `min:"1" type:"string"`
  689. // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
  690. ScheduleExpression *string `type:"string"`
  691. // Specifies whether the rule is enabled or disabled.
  692. State *string `type:"string" enum:"RuleState"`
  693. }
  694. // String returns the string representation
  695. func (s DescribeRuleOutput) String() string {
  696. return awsutil.Prettify(s)
  697. }
  698. // GoString returns the string representation
  699. func (s DescribeRuleOutput) GoString() string {
  700. return s.String()
  701. }
  702. // Container for the parameters to the DisableRule operation.
  703. type DisableRuleInput struct {
  704. _ struct{} `type:"structure"`
  705. // The name of the rule you want to disable.
  706. Name *string `min:"1" type:"string" required:"true"`
  707. }
  708. // String returns the string representation
  709. func (s DisableRuleInput) String() string {
  710. return awsutil.Prettify(s)
  711. }
  712. // GoString returns the string representation
  713. func (s DisableRuleInput) GoString() string {
  714. return s.String()
  715. }
  716. // Validate inspects the fields of the type to determine if they are valid.
  717. func (s *DisableRuleInput) Validate() error {
  718. invalidParams := request.ErrInvalidParams{Context: "DisableRuleInput"}
  719. if s.Name == nil {
  720. invalidParams.Add(request.NewErrParamRequired("Name"))
  721. }
  722. if s.Name != nil && len(*s.Name) < 1 {
  723. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  724. }
  725. if invalidParams.Len() > 0 {
  726. return invalidParams
  727. }
  728. return nil
  729. }
  730. type DisableRuleOutput struct {
  731. _ struct{} `type:"structure"`
  732. }
  733. // String returns the string representation
  734. func (s DisableRuleOutput) String() string {
  735. return awsutil.Prettify(s)
  736. }
  737. // GoString returns the string representation
  738. func (s DisableRuleOutput) GoString() string {
  739. return s.String()
  740. }
  741. // Container for the parameters to the EnableRule operation.
  742. type EnableRuleInput struct {
  743. _ struct{} `type:"structure"`
  744. // The name of the rule that you want to enable.
  745. Name *string `min:"1" type:"string" required:"true"`
  746. }
  747. // String returns the string representation
  748. func (s EnableRuleInput) String() string {
  749. return awsutil.Prettify(s)
  750. }
  751. // GoString returns the string representation
  752. func (s EnableRuleInput) GoString() string {
  753. return s.String()
  754. }
  755. // Validate inspects the fields of the type to determine if they are valid.
  756. func (s *EnableRuleInput) Validate() error {
  757. invalidParams := request.ErrInvalidParams{Context: "EnableRuleInput"}
  758. if s.Name == nil {
  759. invalidParams.Add(request.NewErrParamRequired("Name"))
  760. }
  761. if s.Name != nil && len(*s.Name) < 1 {
  762. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  763. }
  764. if invalidParams.Len() > 0 {
  765. return invalidParams
  766. }
  767. return nil
  768. }
  769. type EnableRuleOutput struct {
  770. _ struct{} `type:"structure"`
  771. }
  772. // String returns the string representation
  773. func (s EnableRuleOutput) String() string {
  774. return awsutil.Prettify(s)
  775. }
  776. // GoString returns the string representation
  777. func (s EnableRuleOutput) GoString() string {
  778. return s.String()
  779. }
  780. // Container for the parameters to the ListRuleNamesByTarget operation.
  781. type ListRuleNamesByTargetInput struct {
  782. _ struct{} `type:"structure"`
  783. // The maximum number of results to return.
  784. Limit *int64 `min:"1" type:"integer"`
  785. // The token returned by a previous call to indicate that there is more data
  786. // available.
  787. NextToken *string `min:"1" type:"string"`
  788. // The Amazon Resource Name (ARN) of the target resource that you want to list
  789. // the rules for.
  790. TargetArn *string `min:"1" type:"string" required:"true"`
  791. }
  792. // String returns the string representation
  793. func (s ListRuleNamesByTargetInput) String() string {
  794. return awsutil.Prettify(s)
  795. }
  796. // GoString returns the string representation
  797. func (s ListRuleNamesByTargetInput) GoString() string {
  798. return s.String()
  799. }
  800. // Validate inspects the fields of the type to determine if they are valid.
  801. func (s *ListRuleNamesByTargetInput) Validate() error {
  802. invalidParams := request.ErrInvalidParams{Context: "ListRuleNamesByTargetInput"}
  803. if s.Limit != nil && *s.Limit < 1 {
  804. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  805. }
  806. if s.NextToken != nil && len(*s.NextToken) < 1 {
  807. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  808. }
  809. if s.TargetArn == nil {
  810. invalidParams.Add(request.NewErrParamRequired("TargetArn"))
  811. }
  812. if s.TargetArn != nil && len(*s.TargetArn) < 1 {
  813. invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1))
  814. }
  815. if invalidParams.Len() > 0 {
  816. return invalidParams
  817. }
  818. return nil
  819. }
  820. // The result of the ListRuleNamesByTarget operation.
  821. type ListRuleNamesByTargetOutput struct {
  822. _ struct{} `type:"structure"`
  823. // Indicates that there are additional results to retrieve.
  824. NextToken *string `min:"1" type:"string"`
  825. // List of rules names that can invoke the given target.
  826. RuleNames []*string `type:"list"`
  827. }
  828. // String returns the string representation
  829. func (s ListRuleNamesByTargetOutput) String() string {
  830. return awsutil.Prettify(s)
  831. }
  832. // GoString returns the string representation
  833. func (s ListRuleNamesByTargetOutput) GoString() string {
  834. return s.String()
  835. }
  836. // Container for the parameters to the ListRules operation.
  837. type ListRulesInput struct {
  838. _ struct{} `type:"structure"`
  839. // The maximum number of results to return.
  840. Limit *int64 `min:"1" type:"integer"`
  841. // The prefix matching the rule name.
  842. NamePrefix *string `min:"1" type:"string"`
  843. // The token returned by a previous call to indicate that there is more data
  844. // available.
  845. NextToken *string `min:"1" type:"string"`
  846. }
  847. // String returns the string representation
  848. func (s ListRulesInput) String() string {
  849. return awsutil.Prettify(s)
  850. }
  851. // GoString returns the string representation
  852. func (s ListRulesInput) GoString() string {
  853. return s.String()
  854. }
  855. // Validate inspects the fields of the type to determine if they are valid.
  856. func (s *ListRulesInput) Validate() error {
  857. invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"}
  858. if s.Limit != nil && *s.Limit < 1 {
  859. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  860. }
  861. if s.NamePrefix != nil && len(*s.NamePrefix) < 1 {
  862. invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1))
  863. }
  864. if s.NextToken != nil && len(*s.NextToken) < 1 {
  865. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  866. }
  867. if invalidParams.Len() > 0 {
  868. return invalidParams
  869. }
  870. return nil
  871. }
  872. // The result of the ListRules operation.
  873. type ListRulesOutput struct {
  874. _ struct{} `type:"structure"`
  875. // Indicates that there are additional results to retrieve.
  876. NextToken *string `min:"1" type:"string"`
  877. // List of rules matching the specified criteria.
  878. Rules []*Rule `type:"list"`
  879. }
  880. // String returns the string representation
  881. func (s ListRulesOutput) String() string {
  882. return awsutil.Prettify(s)
  883. }
  884. // GoString returns the string representation
  885. func (s ListRulesOutput) GoString() string {
  886. return s.String()
  887. }
  888. // Container for the parameters to the ListTargetsByRule operation.
  889. type ListTargetsByRuleInput struct {
  890. _ struct{} `type:"structure"`
  891. // The maximum number of results to return.
  892. Limit *int64 `min:"1" type:"integer"`
  893. // The token returned by a previous call to indicate that there is more data
  894. // available.
  895. NextToken *string `min:"1" type:"string"`
  896. // The name of the rule whose targets you want to list.
  897. Rule *string `min:"1" type:"string" required:"true"`
  898. }
  899. // String returns the string representation
  900. func (s ListTargetsByRuleInput) String() string {
  901. return awsutil.Prettify(s)
  902. }
  903. // GoString returns the string representation
  904. func (s ListTargetsByRuleInput) GoString() string {
  905. return s.String()
  906. }
  907. // Validate inspects the fields of the type to determine if they are valid.
  908. func (s *ListTargetsByRuleInput) Validate() error {
  909. invalidParams := request.ErrInvalidParams{Context: "ListTargetsByRuleInput"}
  910. if s.Limit != nil && *s.Limit < 1 {
  911. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  912. }
  913. if s.NextToken != nil && len(*s.NextToken) < 1 {
  914. invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
  915. }
  916. if s.Rule == nil {
  917. invalidParams.Add(request.NewErrParamRequired("Rule"))
  918. }
  919. if s.Rule != nil && len(*s.Rule) < 1 {
  920. invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
  921. }
  922. if invalidParams.Len() > 0 {
  923. return invalidParams
  924. }
  925. return nil
  926. }
  927. // The result of the ListTargetsByRule operation.
  928. type ListTargetsByRuleOutput struct {
  929. _ struct{} `type:"structure"`
  930. // Indicates that there are additional results to retrieve.
  931. NextToken *string `min:"1" type:"string"`
  932. // Lists the targets assigned to the rule.
  933. Targets []*Target `type:"list"`
  934. }
  935. // String returns the string representation
  936. func (s ListTargetsByRuleOutput) String() string {
  937. return awsutil.Prettify(s)
  938. }
  939. // GoString returns the string representation
  940. func (s ListTargetsByRuleOutput) GoString() string {
  941. return s.String()
  942. }
  943. // Container for the parameters to the PutEvents operation.
  944. type PutEventsInput struct {
  945. _ struct{} `type:"structure"`
  946. // The entry that defines an event in your system. You can specify several parameters
  947. // for the entry such as the source and type of the event, resources associated
  948. // with the event, and so on.
  949. Entries []*PutEventsRequestEntry `min:"1" type:"list" required:"true"`
  950. }
  951. // String returns the string representation
  952. func (s PutEventsInput) String() string {
  953. return awsutil.Prettify(s)
  954. }
  955. // GoString returns the string representation
  956. func (s PutEventsInput) GoString() string {
  957. return s.String()
  958. }
  959. // Validate inspects the fields of the type to determine if they are valid.
  960. func (s *PutEventsInput) Validate() error {
  961. invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"}
  962. if s.Entries == nil {
  963. invalidParams.Add(request.NewErrParamRequired("Entries"))
  964. }
  965. if s.Entries != nil && len(s.Entries) < 1 {
  966. invalidParams.Add(request.NewErrParamMinLen("Entries", 1))
  967. }
  968. if invalidParams.Len() > 0 {
  969. return invalidParams
  970. }
  971. return nil
  972. }
  973. // The result of the PutEvents operation.
  974. type PutEventsOutput struct {
  975. _ struct{} `type:"structure"`
  976. // A list of successfully and unsuccessfully ingested events results. If the
  977. // ingestion was successful, the entry will have the event ID in it. If not,
  978. // then the ErrorCode and ErrorMessage can be used to identify the problem with
  979. // the entry.
  980. Entries []*PutEventsResultEntry `type:"list"`
  981. // The number of failed entries.
  982. FailedEntryCount *int64 `type:"integer"`
  983. }
  984. // String returns the string representation
  985. func (s PutEventsOutput) String() string {
  986. return awsutil.Prettify(s)
  987. }
  988. // GoString returns the string representation
  989. func (s PutEventsOutput) GoString() string {
  990. return s.String()
  991. }
  992. // Contains information about the event to be used in PutEvents.
  993. type PutEventsRequestEntry struct {
  994. _ struct{} `type:"structure"`
  995. // In the JSON sense, an object containing fields, which may also contain nested
  996. // sub-objects. No constraints are imposed on its contents.
  997. Detail *string `type:"string"`
  998. // Free-form string used to decide what fields to expect in the event detail.
  999. DetailType *string `type:"string"`
  1000. // AWS resources, identified by Amazon Resource Name (ARN), which the event
  1001. // primarily concerns. Any number, including zero, may be present.
  1002. Resources []*string `type:"list"`
  1003. // The source of the event.
  1004. Source *string `type:"string"`
  1005. // Timestamp of event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt).
  1006. // If no timestamp is provided, the timestamp of the PutEvents call will be
  1007. // used.
  1008. Time *time.Time `type:"timestamp" timestampFormat:"unix"`
  1009. }
  1010. // String returns the string representation
  1011. func (s PutEventsRequestEntry) String() string {
  1012. return awsutil.Prettify(s)
  1013. }
  1014. // GoString returns the string representation
  1015. func (s PutEventsRequestEntry) GoString() string {
  1016. return s.String()
  1017. }
  1018. // A PutEventsResult contains a list of PutEventsResultEntry.
  1019. type PutEventsResultEntry struct {
  1020. _ struct{} `type:"structure"`
  1021. // The error code representing why the event submission failed on this entry.
  1022. ErrorCode *string `type:"string"`
  1023. // The error message explaining why the event submission failed on this entry.
  1024. ErrorMessage *string `type:"string"`
  1025. // The ID of the event submitted to Amazon CloudWatch Events.
  1026. EventId *string `type:"string"`
  1027. }
  1028. // String returns the string representation
  1029. func (s PutEventsResultEntry) String() string {
  1030. return awsutil.Prettify(s)
  1031. }
  1032. // GoString returns the string representation
  1033. func (s PutEventsResultEntry) GoString() string {
  1034. return s.String()
  1035. }
  1036. // Container for the parameters to the PutRule operation.
  1037. type PutRuleInput struct {
  1038. _ struct{} `type:"structure"`
  1039. // A description of the rule.
  1040. Description *string `type:"string"`
  1041. // The event pattern.
  1042. EventPattern *string `type:"string"`
  1043. // The name of the rule that you are creating or updating.
  1044. Name *string `min:"1" type:"string" required:"true"`
  1045. // The Amazon Resource Name (ARN) of the IAM role associated with the rule.
  1046. RoleArn *string `min:"1" type:"string"`
  1047. // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
  1048. ScheduleExpression *string `type:"string"`
  1049. // Indicates whether the rule is enabled or disabled.
  1050. State *string `type:"string" enum:"RuleState"`
  1051. }
  1052. // String returns the string representation
  1053. func (s PutRuleInput) String() string {
  1054. return awsutil.Prettify(s)
  1055. }
  1056. // GoString returns the string representation
  1057. func (s PutRuleInput) GoString() string {
  1058. return s.String()
  1059. }
  1060. // Validate inspects the fields of the type to determine if they are valid.
  1061. func (s *PutRuleInput) Validate() error {
  1062. invalidParams := request.ErrInvalidParams{Context: "PutRuleInput"}
  1063. if s.Name == nil {
  1064. invalidParams.Add(request.NewErrParamRequired("Name"))
  1065. }
  1066. if s.Name != nil && len(*s.Name) < 1 {
  1067. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  1068. }
  1069. if s.RoleArn != nil && len(*s.RoleArn) < 1 {
  1070. invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
  1071. }
  1072. if invalidParams.Len() > 0 {
  1073. return invalidParams
  1074. }
  1075. return nil
  1076. }
  1077. // The result of the PutRule operation.
  1078. type PutRuleOutput struct {
  1079. _ struct{} `type:"structure"`
  1080. // The Amazon Resource Name (ARN) that identifies the rule.
  1081. RuleArn *string `min:"1" type:"string"`
  1082. }
  1083. // String returns the string representation
  1084. func (s PutRuleOutput) String() string {
  1085. return awsutil.Prettify(s)
  1086. }
  1087. // GoString returns the string representation
  1088. func (s PutRuleOutput) GoString() string {
  1089. return s.String()
  1090. }
  1091. // Container for the parameters to the PutTargets operation.
  1092. type PutTargetsInput struct {
  1093. _ struct{} `type:"structure"`
  1094. // The name of the rule you want to add targets to.
  1095. Rule *string `min:"1" type:"string" required:"true"`
  1096. // List of targets you want to update or add to the rule.
  1097. Targets []*Target `type:"list" required:"true"`
  1098. }
  1099. // String returns the string representation
  1100. func (s PutTargetsInput) String() string {
  1101. return awsutil.Prettify(s)
  1102. }
  1103. // GoString returns the string representation
  1104. func (s PutTargetsInput) GoString() string {
  1105. return s.String()
  1106. }
  1107. // Validate inspects the fields of the type to determine if they are valid.
  1108. func (s *PutTargetsInput) Validate() error {
  1109. invalidParams := request.ErrInvalidParams{Context: "PutTargetsInput"}
  1110. if s.Rule == nil {
  1111. invalidParams.Add(request.NewErrParamRequired("Rule"))
  1112. }
  1113. if s.Rule != nil && len(*s.Rule) < 1 {
  1114. invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
  1115. }
  1116. if s.Targets == nil {
  1117. invalidParams.Add(request.NewErrParamRequired("Targets"))
  1118. }
  1119. if s.Targets != nil {
  1120. for i, v := range s.Targets {
  1121. if v == nil {
  1122. continue
  1123. }
  1124. if err := v.Validate(); err != nil {
  1125. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams))
  1126. }
  1127. }
  1128. }
  1129. if invalidParams.Len() > 0 {
  1130. return invalidParams
  1131. }
  1132. return nil
  1133. }
  1134. // The result of the PutTargets operation.
  1135. type PutTargetsOutput struct {
  1136. _ struct{} `type:"structure"`
  1137. // An array of failed target entries.
  1138. FailedEntries []*PutTargetsResultEntry `type:"list"`
  1139. // The number of failed entries.
  1140. FailedEntryCount *int64 `type:"integer"`
  1141. }
  1142. // String returns the string representation
  1143. func (s PutTargetsOutput) String() string {
  1144. return awsutil.Prettify(s)
  1145. }
  1146. // GoString returns the string representation
  1147. func (s PutTargetsOutput) GoString() string {
  1148. return s.String()
  1149. }
  1150. // A PutTargetsResult contains a list of PutTargetsResultEntry.
  1151. type PutTargetsResultEntry struct {
  1152. _ struct{} `type:"structure"`
  1153. // The error code representing why the target submission failed on this entry.
  1154. ErrorCode *string `type:"string"`
  1155. // The error message explaining why the target submission failed on this entry.
  1156. ErrorMessage *string `type:"string"`
  1157. // The ID of the target submitted to Amazon CloudWatch Events.
  1158. TargetId *string `min:"1" type:"string"`
  1159. }
  1160. // String returns the string representation
  1161. func (s PutTargetsResultEntry) String() string {
  1162. return awsutil.Prettify(s)
  1163. }
  1164. // GoString returns the string representation
  1165. func (s PutTargetsResultEntry) GoString() string {
  1166. return s.String()
  1167. }
  1168. // Container for the parameters to the RemoveTargets operation.
  1169. type RemoveTargetsInput struct {
  1170. _ struct{} `type:"structure"`
  1171. // The list of target IDs to remove from the rule.
  1172. Ids []*string `min:"1" type:"list" required:"true"`
  1173. // The name of the rule you want to remove targets from.
  1174. Rule *string `min:"1" type:"string" required:"true"`
  1175. }
  1176. // String returns the string representation
  1177. func (s RemoveTargetsInput) String() string {
  1178. return awsutil.Prettify(s)
  1179. }
  1180. // GoString returns the string representation
  1181. func (s RemoveTargetsInput) GoString() string {
  1182. return s.String()
  1183. }
  1184. // Validate inspects the fields of the type to determine if they are valid.
  1185. func (s *RemoveTargetsInput) Validate() error {
  1186. invalidParams := request.ErrInvalidParams{Context: "RemoveTargetsInput"}
  1187. if s.Ids == nil {
  1188. invalidParams.Add(request.NewErrParamRequired("Ids"))
  1189. }
  1190. if s.Ids != nil && len(s.Ids) < 1 {
  1191. invalidParams.Add(request.NewErrParamMinLen("Ids", 1))
  1192. }
  1193. if s.Rule == nil {
  1194. invalidParams.Add(request.NewErrParamRequired("Rule"))
  1195. }
  1196. if s.Rule != nil && len(*s.Rule) < 1 {
  1197. invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
  1198. }
  1199. if invalidParams.Len() > 0 {
  1200. return invalidParams
  1201. }
  1202. return nil
  1203. }
  1204. // The result of the RemoveTargets operation.
  1205. type RemoveTargetsOutput struct {
  1206. _ struct{} `type:"structure"`
  1207. // An array of failed target entries.
  1208. FailedEntries []*RemoveTargetsResultEntry `type:"list"`
  1209. // The number of failed entries.
  1210. FailedEntryCount *int64 `type:"integer"`
  1211. }
  1212. // String returns the string representation
  1213. func (s RemoveTargetsOutput) String() string {
  1214. return awsutil.Prettify(s)
  1215. }
  1216. // GoString returns the string representation
  1217. func (s RemoveTargetsOutput) GoString() string {
  1218. return s.String()
  1219. }
  1220. // The ID of the target requested to be removed from the rule by Amazon CloudWatch
  1221. // Events.
  1222. type RemoveTargetsResultEntry struct {
  1223. _ struct{} `type:"structure"`
  1224. // The error code representing why the target removal failed on this entry.
  1225. ErrorCode *string `type:"string"`
  1226. // The error message explaining why the target removal failed on this entry.
  1227. ErrorMessage *string `type:"string"`
  1228. // The ID of the target requested to be removed by Amazon CloudWatch Events.
  1229. TargetId *string `min:"1" type:"string"`
  1230. }
  1231. // String returns the string representation
  1232. func (s RemoveTargetsResultEntry) String() string {
  1233. return awsutil.Prettify(s)
  1234. }
  1235. // GoString returns the string representation
  1236. func (s RemoveTargetsResultEntry) GoString() string {
  1237. return s.String()
  1238. }
  1239. // Contains information about a rule in Amazon CloudWatch Events. A ListRulesResult
  1240. // contains a list of Rules.
  1241. type Rule struct {
  1242. _ struct{} `type:"structure"`
  1243. // The Amazon Resource Name (ARN) of the rule.
  1244. Arn *string `min:"1" type:"string"`
  1245. // The description of the rule.
  1246. Description *string `type:"string"`
  1247. // The event pattern of the rule.
  1248. EventPattern *string `type:"string"`
  1249. // The rule's name.
  1250. Name *string `min:"1" type:"string"`
  1251. // The Amazon Resource Name (ARN) associated with the role that is used for
  1252. // target invocation.
  1253. RoleArn *string `min:"1" type:"string"`
  1254. // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
  1255. ScheduleExpression *string `type:"string"`
  1256. // The rule's state.
  1257. State *string `type:"string" enum:"RuleState"`
  1258. }
  1259. // String returns the string representation
  1260. func (s Rule) String() string {
  1261. return awsutil.Prettify(s)
  1262. }
  1263. // GoString returns the string representation
  1264. func (s Rule) GoString() string {
  1265. return s.String()
  1266. }
  1267. // Targets are the resources that can be invoked when a rule is triggered. For
  1268. // example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets.
  1269. //
  1270. // Input and InputPath are mutually-exclusive and optional parameters of a
  1271. // target. When a rule is triggered due to a matched event, if for a target:
  1272. //
  1273. // Neither Input nor InputPath is specified, then the entire event is passed
  1274. // to the target in JSON form. InputPath is specified in the form of JSONPath
  1275. // (e.g. $.detail), then only the part of the event specified in the path is
  1276. // passed to the target (e.g. only the detail part of the event is passed).
  1277. // Input is specified in the form of a valid JSON, then the matched event
  1278. // is overridden with this constant.
  1279. type Target struct {
  1280. _ struct{} `type:"structure"`
  1281. // The Amazon Resource Name (ARN) associated of the target.
  1282. Arn *string `min:"1" type:"string" required:"true"`
  1283. // The unique target assignment ID.
  1284. Id *string `min:"1" type:"string" required:"true"`
  1285. // Valid JSON text passed to the target. For more information about JSON text,
  1286. // see The JavaScript Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt).
  1287. Input *string `type:"string"`
  1288. // The value of the JSONPath that is used for extracting part of the matched
  1289. // event when passing it to the target. For more information about JSON paths,
  1290. // see JSONPath (http://goessner.net/articles/JsonPath/).
  1291. InputPath *string `type:"string"`
  1292. }
  1293. // String returns the string representation
  1294. func (s Target) String() string {
  1295. return awsutil.Prettify(s)
  1296. }
  1297. // GoString returns the string representation
  1298. func (s Target) GoString() string {
  1299. return s.String()
  1300. }
  1301. // Validate inspects the fields of the type to determine if they are valid.
  1302. func (s *Target) Validate() error {
  1303. invalidParams := request.ErrInvalidParams{Context: "Target"}
  1304. if s.Arn == nil {
  1305. invalidParams.Add(request.NewErrParamRequired("Arn"))
  1306. }
  1307. if s.Arn != nil && len(*s.Arn) < 1 {
  1308. invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
  1309. }
  1310. if s.Id == nil {
  1311. invalidParams.Add(request.NewErrParamRequired("Id"))
  1312. }
  1313. if s.Id != nil && len(*s.Id) < 1 {
  1314. invalidParams.Add(request.NewErrParamMinLen("Id", 1))
  1315. }
  1316. if invalidParams.Len() > 0 {
  1317. return invalidParams
  1318. }
  1319. return nil
  1320. }
  1321. // Container for the parameters to the TestEventPattern operation.
  1322. type TestEventPatternInput struct {
  1323. _ struct{} `type:"structure"`
  1324. // The event in the JSON format to test against the event pattern.
  1325. Event *string `type:"string" required:"true"`
  1326. // The event pattern you want to test.
  1327. EventPattern *string `type:"string" required:"true"`
  1328. }
  1329. // String returns the string representation
  1330. func (s TestEventPatternInput) String() string {
  1331. return awsutil.Prettify(s)
  1332. }
  1333. // GoString returns the string representation
  1334. func (s TestEventPatternInput) GoString() string {
  1335. return s.String()
  1336. }
  1337. // Validate inspects the fields of the type to determine if they are valid.
  1338. func (s *TestEventPatternInput) Validate() error {
  1339. invalidParams := request.ErrInvalidParams{Context: "TestEventPatternInput"}
  1340. if s.Event == nil {
  1341. invalidParams.Add(request.NewErrParamRequired("Event"))
  1342. }
  1343. if s.EventPattern == nil {
  1344. invalidParams.Add(request.NewErrParamRequired("EventPattern"))
  1345. }
  1346. if invalidParams.Len() > 0 {
  1347. return invalidParams
  1348. }
  1349. return nil
  1350. }
  1351. // The result of the TestEventPattern operation.
  1352. type TestEventPatternOutput struct {
  1353. _ struct{} `type:"structure"`
  1354. // Indicates whether the event matches the event pattern.
  1355. Result *bool `type:"boolean"`
  1356. }
  1357. // String returns the string representation
  1358. func (s TestEventPatternOutput) String() string {
  1359. return awsutil.Prettify(s)
  1360. }
  1361. // GoString returns the string representation
  1362. func (s TestEventPatternOutput) GoString() string {
  1363. return s.String()
  1364. }
  1365. const (
  1366. // @enum RuleState
  1367. RuleStateEnabled = "ENABLED"
  1368. // @enum RuleState
  1369. RuleStateDisabled = "DISABLED"
  1370. )