3 Star 1 Fork 0

Gitee 极速下载/aws-sdk-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/aws/aws-sdk-go
克隆/下载
api.go 114.30 KB
一键复制 编辑 原始数据 按行查看 历史
awssdkgo 提交于 2018-04-03 20:44 . Release v1.13.27
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudwatchevents
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opDeleteRule = "DeleteRule"
// DeleteRuleRequest generates a "aws/request.Request" representing the
// client's request for the DeleteRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DeleteRule for more information on using the DeleteRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DeleteRuleRequest method.
// req, resp := client.DeleteRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule
func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) {
op := &request.Operation{
Name: opDeleteRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteRuleInput{}
}
output = &DeleteRuleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteRule API operation for Amazon CloudWatch Events.
//
// Deletes the specified rule.
//
// You must remove all targets from a rule using RemoveTargets before you can
// delete the rule.
//
// When you delete a rule, incoming events might continue to match to the deleted
// rule. Please allow a short period of time for changes to take effect.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation DeleteRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule
func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) {
req, out := c.DeleteRuleRequest(input)
return out, req.Send()
}
// DeleteRuleWithContext is the same as DeleteRule with the addition of
// the ability to pass a context and additional request options.
//
// See DeleteRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) {
req, out := c.DeleteRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeEventBus = "DescribeEventBus"
// DescribeEventBusRequest generates a "aws/request.Request" representing the
// client's request for the DescribeEventBus operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeEventBus for more information on using the DescribeEventBus
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DescribeEventBusRequest method.
// req, resp := client.DescribeEventBusRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus
func (c *CloudWatchEvents) DescribeEventBusRequest(input *DescribeEventBusInput) (req *request.Request, output *DescribeEventBusOutput) {
op := &request.Operation{
Name: opDescribeEventBus,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeEventBusInput{}
}
output = &DescribeEventBusOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeEventBus API operation for Amazon CloudWatch Events.
//
// Displays the external AWS accounts that are permitted to write events to
// your account using your account's event bus, and the associated policy. To
// enable your account to receive events from other accounts, use PutPermission.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation DescribeEventBus for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus
func (c *CloudWatchEvents) DescribeEventBus(input *DescribeEventBusInput) (*DescribeEventBusOutput, error) {
req, out := c.DescribeEventBusRequest(input)
return out, req.Send()
}
// DescribeEventBusWithContext is the same as DescribeEventBus with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeEventBus for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) DescribeEventBusWithContext(ctx aws.Context, input *DescribeEventBusInput, opts ...request.Option) (*DescribeEventBusOutput, error) {
req, out := c.DescribeEventBusRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDescribeRule = "DescribeRule"
// DescribeRuleRequest generates a "aws/request.Request" representing the
// client's request for the DescribeRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DescribeRule for more information on using the DescribeRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DescribeRuleRequest method.
// req, resp := client.DescribeRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule
func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *request.Request, output *DescribeRuleOutput) {
op := &request.Operation{
Name: opDescribeRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeRuleInput{}
}
output = &DescribeRuleOutput{}
req = c.newRequest(op, input, output)
return
}
// DescribeRule API operation for Amazon CloudWatch Events.
//
// Describes the specified rule.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation DescribeRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule
func (c *CloudWatchEvents) DescribeRule(input *DescribeRuleInput) (*DescribeRuleOutput, error) {
req, out := c.DescribeRuleRequest(input)
return out, req.Send()
}
// DescribeRuleWithContext is the same as DescribeRule with the addition of
// the ability to pass a context and additional request options.
//
// See DescribeRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) DescribeRuleWithContext(ctx aws.Context, input *DescribeRuleInput, opts ...request.Option) (*DescribeRuleOutput, error) {
req, out := c.DescribeRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDisableRule = "DisableRule"
// DisableRuleRequest generates a "aws/request.Request" representing the
// client's request for the DisableRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See DisableRule for more information on using the DisableRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the DisableRuleRequest method.
// req, resp := client.DisableRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule
func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *request.Request, output *DisableRuleOutput) {
op := &request.Operation{
Name: opDisableRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DisableRuleInput{}
}
output = &DisableRuleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// DisableRule API operation for Amazon CloudWatch Events.
//
// Disables the specified rule. A disabled rule won't match any events, and
// won't self-trigger if it has a schedule expression.
//
// When you disable a rule, incoming events might continue to match to the disabled
// rule. Please allow a short period of time for changes to take effect.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation DisableRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule
func (c *CloudWatchEvents) DisableRule(input *DisableRuleInput) (*DisableRuleOutput, error) {
req, out := c.DisableRuleRequest(input)
return out, req.Send()
}
// DisableRuleWithContext is the same as DisableRule with the addition of
// the ability to pass a context and additional request options.
//
// See DisableRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) DisableRuleWithContext(ctx aws.Context, input *DisableRuleInput, opts ...request.Option) (*DisableRuleOutput, error) {
req, out := c.DisableRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opEnableRule = "EnableRule"
// EnableRuleRequest generates a "aws/request.Request" representing the
// client's request for the EnableRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See EnableRule for more information on using the EnableRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the EnableRuleRequest method.
// req, resp := client.EnableRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule
func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *request.Request, output *EnableRuleOutput) {
op := &request.Operation{
Name: opEnableRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &EnableRuleInput{}
}
output = &EnableRuleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// EnableRule API operation for Amazon CloudWatch Events.
//
// Enables the specified rule. If the rule does not exist, the operation fails.
//
// When you enable a rule, incoming events might not immediately start matching
// to a newly enabled rule. Please allow a short period of time for changes
// to take effect.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation EnableRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule
func (c *CloudWatchEvents) EnableRule(input *EnableRuleInput) (*EnableRuleOutput, error) {
req, out := c.EnableRuleRequest(input)
return out, req.Send()
}
// EnableRuleWithContext is the same as EnableRule with the addition of
// the ability to pass a context and additional request options.
//
// See EnableRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) EnableRuleWithContext(ctx aws.Context, input *EnableRuleInput, opts ...request.Option) (*EnableRuleOutput, error) {
req, out := c.EnableRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListRuleNamesByTarget = "ListRuleNamesByTarget"
// ListRuleNamesByTargetRequest generates a "aws/request.Request" representing the
// client's request for the ListRuleNamesByTarget operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListRuleNamesByTarget for more information on using the ListRuleNamesByTarget
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListRuleNamesByTargetRequest method.
// req, resp := client.ListRuleNamesByTargetRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget
func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTargetInput) (req *request.Request, output *ListRuleNamesByTargetOutput) {
op := &request.Operation{
Name: opListRuleNamesByTarget,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListRuleNamesByTargetInput{}
}
output = &ListRuleNamesByTargetOutput{}
req = c.newRequest(op, input, output)
return
}
// ListRuleNamesByTarget API operation for Amazon CloudWatch Events.
//
// Lists the rules for the specified target. You can see which of the rules
// in Amazon CloudWatch Events can invoke a specific target in your account.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation ListRuleNamesByTarget for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget
func (c *CloudWatchEvents) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) {
req, out := c.ListRuleNamesByTargetRequest(input)
return out, req.Send()
}
// ListRuleNamesByTargetWithContext is the same as ListRuleNamesByTarget with the addition of
// the ability to pass a context and additional request options.
//
// See ListRuleNamesByTarget for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) ListRuleNamesByTargetWithContext(ctx aws.Context, input *ListRuleNamesByTargetInput, opts ...request.Option) (*ListRuleNamesByTargetOutput, error) {
req, out := c.ListRuleNamesByTargetRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListRules = "ListRules"
// ListRulesRequest generates a "aws/request.Request" representing the
// client's request for the ListRules operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListRules for more information on using the ListRules
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListRulesRequest method.
// req, resp := client.ListRulesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules
func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) {
op := &request.Operation{
Name: opListRules,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListRulesInput{}
}
output = &ListRulesOutput{}
req = c.newRequest(op, input, output)
return
}
// ListRules API operation for Amazon CloudWatch Events.
//
// Lists your Amazon CloudWatch Events rules. You can either list all the rules
// or you can provide a prefix to match to the rule names.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation ListRules for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules
func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error) {
req, out := c.ListRulesRequest(input)
return out, req.Send()
}
// ListRulesWithContext is the same as ListRules with the addition of
// the ability to pass a context and additional request options.
//
// See ListRules for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) ListRulesWithContext(ctx aws.Context, input *ListRulesInput, opts ...request.Option) (*ListRulesOutput, error) {
req, out := c.ListRulesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opListTargetsByRule = "ListTargetsByRule"
// ListTargetsByRuleRequest generates a "aws/request.Request" representing the
// client's request for the ListTargetsByRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See ListTargetsByRule for more information on using the ListTargetsByRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the ListTargetsByRuleRequest method.
// req, resp := client.ListTargetsByRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule
func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInput) (req *request.Request, output *ListTargetsByRuleOutput) {
op := &request.Operation{
Name: opListTargetsByRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &ListTargetsByRuleInput{}
}
output = &ListTargetsByRuleOutput{}
req = c.newRequest(op, input, output)
return
}
// ListTargetsByRule API operation for Amazon CloudWatch Events.
//
// Lists the targets assigned to the specified rule.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation ListTargetsByRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule
func (c *CloudWatchEvents) ListTargetsByRule(input *ListTargetsByRuleInput) (*ListTargetsByRuleOutput, error) {
req, out := c.ListTargetsByRuleRequest(input)
return out, req.Send()
}
// ListTargetsByRuleWithContext is the same as ListTargetsByRule with the addition of
// the ability to pass a context and additional request options.
//
// See ListTargetsByRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) ListTargetsByRuleWithContext(ctx aws.Context, input *ListTargetsByRuleInput, opts ...request.Option) (*ListTargetsByRuleOutput, error) {
req, out := c.ListTargetsByRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutEvents = "PutEvents"
// PutEventsRequest generates a "aws/request.Request" representing the
// client's request for the PutEvents operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutEvents for more information on using the PutEvents
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutEventsRequest method.
// req, resp := client.PutEventsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents
func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) {
op := &request.Operation{
Name: opPutEvents,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutEventsInput{}
}
output = &PutEventsOutput{}
req = c.newRequest(op, input, output)
return
}
// PutEvents API operation for Amazon CloudWatch Events.
//
// Sends custom events to Amazon CloudWatch Events so that they can be matched
// to rules.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation PutEvents for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents
func (c *CloudWatchEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) {
req, out := c.PutEventsRequest(input)
return out, req.Send()
}
// PutEventsWithContext is the same as PutEvents with the addition of
// the ability to pass a context and additional request options.
//
// See PutEvents for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) {
req, out := c.PutEventsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutPermission = "PutPermission"
// PutPermissionRequest generates a "aws/request.Request" representing the
// client's request for the PutPermission operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutPermission for more information on using the PutPermission
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutPermissionRequest method.
// req, resp := client.PutPermissionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission
func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req *request.Request, output *PutPermissionOutput) {
op := &request.Operation{
Name: opPutPermission,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutPermissionInput{}
}
output = &PutPermissionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// PutPermission API operation for Amazon CloudWatch Events.
//
// Running PutPermission permits the specified AWS account to put events to
// your account's default event bus. CloudWatch Events rules in your account
// are triggered by these events arriving to your default event bus.
//
// For another account to send events to your account, that external account
// must have a CloudWatch Events rule with your account's default event bus
// as a target.
//
// To enable multiple AWS accounts to put events to your default event bus,
// run PutPermission once for each of these accounts.
//
// The permission policy on the default event bus cannot exceed 10KB in size.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation PutPermission for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException"
// The event bus policy is too long. For more information, see the limits.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission
func (c *CloudWatchEvents) PutPermission(input *PutPermissionInput) (*PutPermissionOutput, error) {
req, out := c.PutPermissionRequest(input)
return out, req.Send()
}
// PutPermissionWithContext is the same as PutPermission with the addition of
// the ability to pass a context and additional request options.
//
// See PutPermission for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) PutPermissionWithContext(ctx aws.Context, input *PutPermissionInput, opts ...request.Option) (*PutPermissionOutput, error) {
req, out := c.PutPermissionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutRule = "PutRule"
// PutRuleRequest generates a "aws/request.Request" representing the
// client's request for the PutRule operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutRule for more information on using the PutRule
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutRuleRequest method.
// req, resp := client.PutRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule
func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Request, output *PutRuleOutput) {
op := &request.Operation{
Name: opPutRule,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutRuleInput{}
}
output = &PutRuleOutput{}
req = c.newRequest(op, input, output)
return
}
// PutRule API operation for Amazon CloudWatch Events.
//
// Creates or updates the specified rule. Rules are enabled by default, or based
// on value of the state. You can disable a rule using DisableRule.
//
// If you are updating an existing rule, the rule is completely replaced with
// what you specify in this PutRule command. If you omit arguments in PutRule,
// the old values for those arguments are not kept. Instead, they are replaced
// with null values.
//
// When you create or update a rule, incoming events might not immediately start
// matching to new or updated rules. Please allow a short period of time for
// changes to take effect.
//
// A rule must contain at least an EventPattern or ScheduleExpression. Rules
// with EventPatterns are triggered when a matching event is observed. Rules
// with ScheduleExpressions self-trigger based on the given schedule. A rule
// can have both an EventPattern and a ScheduleExpression, in which case the
// rule triggers on matching events as well as on a schedule.
//
// Most services in AWS treat : or / as the same character in Amazon Resource
// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns
// and rules. Be sure to use the correct ARN characters when creating event
// patterns so that they match the ARN syntax in the event you want to match.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation PutRule for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidEventPatternException "InvalidEventPatternException"
// The event pattern is not valid.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// You tried to create more rules or add more targets to a rule than is allowed.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule
func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error) {
req, out := c.PutRuleRequest(input)
return out, req.Send()
}
// PutRuleWithContext is the same as PutRule with the addition of
// the ability to pass a context and additional request options.
//
// See PutRule for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) PutRuleWithContext(ctx aws.Context, input *PutRuleInput, opts ...request.Option) (*PutRuleOutput, error) {
req, out := c.PutRuleRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opPutTargets = "PutTargets"
// PutTargetsRequest generates a "aws/request.Request" representing the
// client's request for the PutTargets operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutTargets for more information on using the PutTargets
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the PutTargetsRequest method.
// req, resp := client.PutTargetsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets
func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *request.Request, output *PutTargetsOutput) {
op := &request.Operation{
Name: opPutTargets,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &PutTargetsInput{}
}
output = &PutTargetsOutput{}
req = c.newRequest(op, input, output)
return
}
// PutTargets API operation for Amazon CloudWatch Events.
//
// Adds the specified targets to the specified rule, or updates the targets
// if they are already associated with the rule.
//
// Targets are the resources that are invoked when a rule is triggered.
//
// You can configure the following as targets for CloudWatch Events:
//
// * EC2 instances
//
// * AWS Lambda functions
//
// * Streams in Amazon Kinesis Streams
//
// * Delivery streams in Amazon Kinesis Firehose
//
// * Amazon ECS tasks
//
// * AWS Step Functions state machines
//
// * AWS Batch jobs
//
// * Pipelines in Amazon Code Pipeline
//
// * Amazon Inspector assessment templates
//
// * Amazon SNS topics
//
// * Amazon SQS queues, including FIFO queues
//
// * The default event bus of another AWS account
//
// Note that creating rules with built-in targets is supported only in the AWS
// Management Console.
//
// For some target types, PutTargets provides target-specific parameters. If
// the target is an Amazon Kinesis stream, you can optionally specify which
// shard the event goes to by using the KinesisParameters argument. To invoke
// a command on multiple EC2 instances with one rule, you can use the RunCommandParameters
// field.
//
// To be able to make API calls against the resources that you own, Amazon CloudWatch
// Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources,
// CloudWatch Events relies on resource-based policies. For EC2 instances, Amazon
// Kinesis streams, and AWS Step Functions state machines, CloudWatch Events
// relies on IAM roles that you specify in the RoleARN argument in PutTargets.
// For more information, see Authentication and Access Control (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/auth-and-access-control-cwe.html)
// in the Amazon CloudWatch Events User Guide.
//
// If another AWS account is in the same region and has granted you permission
// (using PutPermission), you can send events to that account by setting that
// account's event bus as a target of the rules in your account. To send the
// matched events to the other account, specify that account's event bus as
// the Arn when you run PutTargets. If your account sends events to another
// account, your account is charged for each sent event. Each event sent to
// antoher account is charged as a custom event. The account receiving the event
// is not charged. For more information on pricing, see Amazon CloudWatch Pricing
// (https://aws.amazon.com/cloudwatch/pricing/).
//
// For more information about enabling cross-account events, see PutPermission.
//
// Input, InputPath and InputTransformer are mutually exclusive and optional
// parameters of a target. When a rule is triggered due to a matched event:
//
// * If none of the following arguments are specified for a target, then
// the entire event is passed to the target in JSON form (unless the target
// is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from
// the event is passed to the target).
//
// * If Input is specified in the form of valid JSON, then the matched event
// is overridden with this constant.
//
// * If InputPath is specified in the form of JSONPath (for example, $.detail),
// then only the part of the event specified in the path is passed to the
// target (for example, only the detail part of the event is passed).
//
// * If InputTransformer is specified, then one or more specified JSONPaths
// are extracted from the event and used as values in a template that you
// specify as the input to the target.
//
// When you specify InputPath or InputTransformer, you must use JSON dot notation,
// not bracket notation.
//
// When you add targets to a rule and the associated rule triggers soon after,
// new or updated targets might not be immediately invoked. Please allow a short
// period of time for changes to take effect.
//
// This action can partially fail if too many requests are made at the same
// time. If that happens, FailedEntryCount is non-zero in the response and each
// entry in FailedEntries provides the ID of the failed target and the error
// code.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation PutTargets for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// You tried to create more rules or add more targets to a rule than is allowed.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets
func (c *CloudWatchEvents) PutTargets(input *PutTargetsInput) (*PutTargetsOutput, error) {
req, out := c.PutTargetsRequest(input)
return out, req.Send()
}
// PutTargetsWithContext is the same as PutTargets with the addition of
// the ability to pass a context and additional request options.
//
// See PutTargets for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) PutTargetsWithContext(ctx aws.Context, input *PutTargetsInput, opts ...request.Option) (*PutTargetsOutput, error) {
req, out := c.PutTargetsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opRemovePermission = "RemovePermission"
// RemovePermissionRequest generates a "aws/request.Request" representing the
// client's request for the RemovePermission operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See RemovePermission for more information on using the RemovePermission
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the RemovePermissionRequest method.
// req, resp := client.RemovePermissionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission
func (c *CloudWatchEvents) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) {
op := &request.Operation{
Name: opRemovePermission,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RemovePermissionInput{}
}
output = &RemovePermissionOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// RemovePermission API operation for Amazon CloudWatch Events.
//
// Revokes the permission of another AWS account to be able to put events to
// your default event bus. Specify the account to revoke by the StatementId
// value that you associated with the account when you granted it permission
// with PutPermission. You can find the StatementId by using DescribeEventBus.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation RemovePermission for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission
func (c *CloudWatchEvents) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
req, out := c.RemovePermissionRequest(input)
return out, req.Send()
}
// RemovePermissionWithContext is the same as RemovePermission with the addition of
// the ability to pass a context and additional request options.
//
// See RemovePermission for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) {
req, out := c.RemovePermissionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opRemoveTargets = "RemoveTargets"
// RemoveTargetsRequest generates a "aws/request.Request" representing the
// client's request for the RemoveTargets operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See RemoveTargets for more information on using the RemoveTargets
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the RemoveTargetsRequest method.
// req, resp := client.RemoveTargetsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets
func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req *request.Request, output *RemoveTargetsOutput) {
op := &request.Operation{
Name: opRemoveTargets,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RemoveTargetsInput{}
}
output = &RemoveTargetsOutput{}
req = c.newRequest(op, input, output)
return
}
// RemoveTargets API operation for Amazon CloudWatch Events.
//
// Removes the specified targets from the specified rule. When the rule is triggered,
// those targets are no longer be invoked.
//
// When you remove a target, when the associated rule triggers, removed targets
// might continue to be invoked. Please allow a short period of time for changes
// to take effect.
//
// This action can partially fail if too many requests are made at the same
// time. If that happens, FailedEntryCount is non-zero in the response and each
// entry in FailedEntries provides the ID of the failed target and the error
// code.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation RemoveTargets for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// An entity that you specified does not exist.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets
func (c *CloudWatchEvents) RemoveTargets(input *RemoveTargetsInput) (*RemoveTargetsOutput, error) {
req, out := c.RemoveTargetsRequest(input)
return out, req.Send()
}
// RemoveTargetsWithContext is the same as RemoveTargets with the addition of
// the ability to pass a context and additional request options.
//
// See RemoveTargets for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) RemoveTargetsWithContext(ctx aws.Context, input *RemoveTargetsInput, opts ...request.Option) (*RemoveTargetsOutput, error) {
req, out := c.RemoveTargetsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opTestEventPattern = "TestEventPattern"
// TestEventPatternRequest generates a "aws/request.Request" representing the
// client's request for the TestEventPattern operation. The "output" return
// value will be populated with the request's response once the request completes
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See TestEventPattern for more information on using the TestEventPattern
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the TestEventPatternRequest method.
// req, resp := client.TestEventPatternRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern
func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) (req *request.Request, output *TestEventPatternOutput) {
op := &request.Operation{
Name: opTestEventPattern,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &TestEventPatternInput{}
}
output = &TestEventPatternOutput{}
req = c.newRequest(op, input, output)
return
}
// TestEventPattern API operation for Amazon CloudWatch Events.
//
// Tests whether the specified event pattern matches the provided event.
//
// Most services in AWS treat : or / as the same character in Amazon Resource
// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns
// and rules. Be sure to use the correct ARN characters when creating event
// patterns so that they match the ARN syntax in the event you want to match.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for Amazon CloudWatch Events's
// API operation TestEventPattern for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidEventPatternException "InvalidEventPatternException"
// The event pattern is not valid.
//
// * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern
func (c *CloudWatchEvents) TestEventPattern(input *TestEventPatternInput) (*TestEventPatternOutput, error) {
req, out := c.TestEventPatternRequest(input)
return out, req.Send()
}
// TestEventPatternWithContext is the same as TestEventPattern with the addition of
// the ability to pass a context and additional request options.
//
// See TestEventPattern for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudWatchEvents) TestEventPatternWithContext(ctx aws.Context, input *TestEventPatternInput, opts ...request.Option) (*TestEventPatternOutput, error) {
req, out := c.TestEventPatternRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// The array properties for the submitted job, such as the size of the array.
// The array size can be between 2 and 10,000. If you specify array properties
// for a job, it becomes an array job. This parameter is used only if the target
// is an AWS Batch job.
type BatchArrayProperties struct {
_ struct{} `type:"structure"`
// The size of the array, if this is an array batch job. Valid values are integers
// between 2 and 10,000.
Size *int64 `type:"integer"`
}
// String returns the string representation
func (s BatchArrayProperties) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchArrayProperties) GoString() string {
return s.String()
}
// SetSize sets the Size field's value.
func (s *BatchArrayProperties) SetSize(v int64) *BatchArrayProperties {
s.Size = &v
return s
}
// The custom parameters to be used when the target is an AWS Batch job.
type BatchParameters struct {
_ struct{} `type:"structure"`
// The array properties for the submitted job, such as the size of the array.
// The array size can be between 2 and 10,000. If you specify array properties
// for a job, it becomes an array job. This parameter is used only if the target
// is an AWS Batch job.
ArrayProperties *BatchArrayProperties `type:"structure"`
// The ARN or name of the job definition to use if the event target is an AWS
// Batch job. This job definition must already exist.
//
// JobDefinition is a required field
JobDefinition *string `type:"string" required:"true"`
// The name to use for this execution of the job, if the target is an AWS Batch
// job.
//
// JobName is a required field
JobName *string `type:"string" required:"true"`
// The retry strategy to use for failed jobs, if the target is an AWS Batch
// job. The retry strategy is the number of times to retry the failed job execution.
// Valid values are 1 to 10. When you specify a retry strategy here, it overrides
// the retry strategy defined in the job definition.
RetryStrategy *BatchRetryStrategy `type:"structure"`
}
// String returns the string representation
func (s BatchParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchParameters) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchParameters) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchParameters"}
if s.JobDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("JobDefinition"))
}
if s.JobName == nil {
invalidParams.Add(request.NewErrParamRequired("JobName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetArrayProperties sets the ArrayProperties field's value.
func (s *BatchParameters) SetArrayProperties(v *BatchArrayProperties) *BatchParameters {
s.ArrayProperties = v
return s
}
// SetJobDefinition sets the JobDefinition field's value.
func (s *BatchParameters) SetJobDefinition(v string) *BatchParameters {
s.JobDefinition = &v
return s
}
// SetJobName sets the JobName field's value.
func (s *BatchParameters) SetJobName(v string) *BatchParameters {
s.JobName = &v
return s
}
// SetRetryStrategy sets the RetryStrategy field's value.
func (s *BatchParameters) SetRetryStrategy(v *BatchRetryStrategy) *BatchParameters {
s.RetryStrategy = v
return s
}
// The retry strategy to use for failed jobs, if the target is an AWS Batch
// job. If you specify a retry strategy here, it overrides the retry strategy
// defined in the job definition.
type BatchRetryStrategy struct {
_ struct{} `type:"structure"`
// The number of times to attempt to retry, if the job fails. Valid values are
// 1 to 10.
Attempts *int64 `type:"integer"`
}
// String returns the string representation
func (s BatchRetryStrategy) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchRetryStrategy) GoString() string {
return s.String()
}
// SetAttempts sets the Attempts field's value.
func (s *BatchRetryStrategy) SetAttempts(v int64) *BatchRetryStrategy {
s.Attempts = &v
return s
}
type DeleteRuleInput struct {
_ struct{} `type:"structure"`
// The name of the rule.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s DeleteRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetName sets the Name field's value.
func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput {
s.Name = &v
return s
}
type DeleteRuleOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s DeleteRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteRuleOutput) GoString() string {
return s.String()
}
type DescribeEventBusInput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s DescribeEventBusInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeEventBusInput) GoString() string {
return s.String()
}
type DescribeEventBusOutput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the account permitted to write events to
// the current account.
Arn *string `type:"string"`
// The name of the event bus. Currently, this is always default.
Name *string `type:"string"`
// The policy that enables the external account to send events to your account.
Policy *string `type:"string"`
}
// String returns the string representation
func (s DescribeEventBusOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeEventBusOutput) GoString() string {
return s.String()
}
// SetArn sets the Arn field's value.
func (s *DescribeEventBusOutput) SetArn(v string) *DescribeEventBusOutput {
s.Arn = &v
return s
}
// SetName sets the Name field's value.
func (s *DescribeEventBusOutput) SetName(v string) *DescribeEventBusOutput {
s.Name = &v
return s
}
// SetPolicy sets the Policy field's value.
func (s *DescribeEventBusOutput) SetPolicy(v string) *DescribeEventBusOutput {
s.Policy = &v
return s
}
type DescribeRuleInput struct {
_ struct{} `type:"structure"`
// The name of the rule.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s DescribeRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetName sets the Name field's value.
func (s *DescribeRuleInput) SetName(v string) *DescribeRuleInput {
s.Name = &v
return s
}
type DescribeRuleOutput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the rule.
Arn *string `min:"1" type:"string"`
// The description of the rule.
Description *string `type:"string"`
// The event pattern. For more information, see Events and Event Patterns (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html)
// in the Amazon CloudWatch Events User Guide.
EventPattern *string `type:"string"`
// The name of the rule.
Name *string `min:"1" type:"string"`
// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
RoleArn *string `min:"1" type:"string"`
// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
ScheduleExpression *string `type:"string"`
// Specifies whether the rule is enabled or disabled.
State *string `type:"string" enum:"RuleState"`
}
// String returns the string representation
func (s DescribeRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeRuleOutput) GoString() string {
return s.String()
}
// SetArn sets the Arn field's value.
func (s *DescribeRuleOutput) SetArn(v string) *DescribeRuleOutput {
s.Arn = &v
return s
}
// SetDescription sets the Description field's value.
func (s *DescribeRuleOutput) SetDescription(v string) *DescribeRuleOutput {
s.Description = &v
return s
}
// SetEventPattern sets the EventPattern field's value.
func (s *DescribeRuleOutput) SetEventPattern(v string) *DescribeRuleOutput {
s.EventPattern = &v
return s
}
// SetName sets the Name field's value.
func (s *DescribeRuleOutput) SetName(v string) *DescribeRuleOutput {
s.Name = &v
return s
}
// SetRoleArn sets the RoleArn field's value.
func (s *DescribeRuleOutput) SetRoleArn(v string) *DescribeRuleOutput {
s.RoleArn = &v
return s
}
// SetScheduleExpression sets the ScheduleExpression field's value.
func (s *DescribeRuleOutput) SetScheduleExpression(v string) *DescribeRuleOutput {
s.ScheduleExpression = &v
return s
}
// SetState sets the State field's value.
func (s *DescribeRuleOutput) SetState(v string) *DescribeRuleOutput {
s.State = &v
return s
}
type DisableRuleInput struct {
_ struct{} `type:"structure"`
// The name of the rule.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s DisableRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DisableRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetName sets the Name field's value.
func (s *DisableRuleInput) SetName(v string) *DisableRuleInput {
s.Name = &v
return s
}
type DisableRuleOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s DisableRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DisableRuleOutput) GoString() string {
return s.String()
}
// The custom parameters to be used when the target is an Amazon ECS cluster.
type EcsParameters struct {
_ struct{} `type:"structure"`
// The number of tasks to create based on the TaskDefinition. The default is
// one.
TaskCount *int64 `min:"1" type:"integer"`
// The ARN of the task definition to use if the event target is an Amazon ECS
// cluster.
//
// TaskDefinitionArn is a required field
TaskDefinitionArn *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s EcsParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s EcsParameters) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EcsParameters) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EcsParameters"}
if s.TaskCount != nil && *s.TaskCount < 1 {
invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1))
}
if s.TaskDefinitionArn == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinitionArn"))
}
if s.TaskDefinitionArn != nil && len(*s.TaskDefinitionArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TaskDefinitionArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetTaskCount sets the TaskCount field's value.
func (s *EcsParameters) SetTaskCount(v int64) *EcsParameters {
s.TaskCount = &v
return s
}
// SetTaskDefinitionArn sets the TaskDefinitionArn field's value.
func (s *EcsParameters) SetTaskDefinitionArn(v string) *EcsParameters {
s.TaskDefinitionArn = &v
return s
}
type EnableRuleInput struct {
_ struct{} `type:"structure"`
// The name of the rule.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s EnableRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s EnableRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetName sets the Name field's value.
func (s *EnableRuleInput) SetName(v string) *EnableRuleInput {
s.Name = &v
return s
}
type EnableRuleOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s EnableRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s EnableRuleOutput) GoString() string {
return s.String()
}
// Contains the parameters needed for you to provide custom input to a target
// based on one or more pieces of data extracted from the event.
type InputTransformer struct {
_ struct{} `type:"structure"`
// Map of JSON paths to be extracted from the event. These are key-value pairs,
// where each value is a JSON path. You must use JSON dot notation, not bracket
// notation.
InputPathsMap map[string]*string `type:"map"`
// Input template where you can use the values of the keys from InputPathsMap
// to customize the data sent to the target.
//
// InputTemplate is a required field
InputTemplate *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s InputTransformer) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s InputTransformer) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InputTransformer) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InputTransformer"}
if s.InputTemplate == nil {
invalidParams.Add(request.NewErrParamRequired("InputTemplate"))
}
if s.InputTemplate != nil && len(*s.InputTemplate) < 1 {
invalidParams.Add(request.NewErrParamMinLen("InputTemplate", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetInputPathsMap sets the InputPathsMap field's value.
func (s *InputTransformer) SetInputPathsMap(v map[string]*string) *InputTransformer {
s.InputPathsMap = v
return s
}
// SetInputTemplate sets the InputTemplate field's value.
func (s *InputTransformer) SetInputTemplate(v string) *InputTransformer {
s.InputTemplate = &v
return s
}
// This object enables you to specify a JSON path to extract from the event
// and use as the partition key for the Amazon Kinesis stream, so that you can
// control the shard to which the event goes. If you do not include this parameter,
// the default is to use the eventId as the partition key.
type KinesisParameters struct {
_ struct{} `type:"structure"`
// The JSON path to be extracted from the event and used as the partition key.
// For more information, see Amazon Kinesis Streams Key Concepts (http://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)
// in the Amazon Kinesis Streams Developer Guide.
//
// PartitionKeyPath is a required field
PartitionKeyPath *string `type:"string" required:"true"`
}
// String returns the string representation
func (s KinesisParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s KinesisParameters) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *KinesisParameters) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "KinesisParameters"}
if s.PartitionKeyPath == nil {
invalidParams.Add(request.NewErrParamRequired("PartitionKeyPath"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetPartitionKeyPath sets the PartitionKeyPath field's value.
func (s *KinesisParameters) SetPartitionKeyPath(v string) *KinesisParameters {
s.PartitionKeyPath = &v
return s
}
type ListRuleNamesByTargetInput struct {
_ struct{} `type:"structure"`
// The maximum number of results to return.
Limit *int64 `min:"1" type:"integer"`
// The token returned by a previous call to retrieve the next set of results.
NextToken *string `min:"1" type:"string"`
// The Amazon Resource Name (ARN) of the target resource.
//
// TargetArn is a required field
TargetArn *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s ListRuleNamesByTargetInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListRuleNamesByTargetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListRuleNamesByTargetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListRuleNamesByTargetInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.TargetArn == nil {
invalidParams.Add(request.NewErrParamRequired("TargetArn"))
}
if s.TargetArn != nil && len(*s.TargetArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetLimit sets the Limit field's value.
func (s *ListRuleNamesByTargetInput) SetLimit(v int64) *ListRuleNamesByTargetInput {
s.Limit = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *ListRuleNamesByTargetInput) SetNextToken(v string) *ListRuleNamesByTargetInput {
s.NextToken = &v
return s
}
// SetTargetArn sets the TargetArn field's value.
func (s *ListRuleNamesByTargetInput) SetTargetArn(v string) *ListRuleNamesByTargetInput {
s.TargetArn = &v
return s
}
type ListRuleNamesByTargetOutput struct {
_ struct{} `type:"structure"`
// Indicates whether there are additional results to retrieve. If there are
// no more results, the value is null.
NextToken *string `min:"1" type:"string"`
// The names of the rules that can invoke the given target.
RuleNames []*string `type:"list"`
}
// String returns the string representation
func (s ListRuleNamesByTargetOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListRuleNamesByTargetOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *ListRuleNamesByTargetOutput) SetNextToken(v string) *ListRuleNamesByTargetOutput {
s.NextToken = &v
return s
}
// SetRuleNames sets the RuleNames field's value.
func (s *ListRuleNamesByTargetOutput) SetRuleNames(v []*string) *ListRuleNamesByTargetOutput {
s.RuleNames = v
return s
}
type ListRulesInput struct {
_ struct{} `type:"structure"`
// The maximum number of results to return.
Limit *int64 `min:"1" type:"integer"`
// The prefix matching the rule name.
NamePrefix *string `min:"1" type:"string"`
// The token returned by a previous call to retrieve the next set of results.
NextToken *string `min:"1" type:"string"`
}
// String returns the string representation
func (s ListRulesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListRulesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListRulesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NamePrefix != nil && len(*s.NamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetLimit sets the Limit field's value.
func (s *ListRulesInput) SetLimit(v int64) *ListRulesInput {
s.Limit = &v
return s
}
// SetNamePrefix sets the NamePrefix field's value.
func (s *ListRulesInput) SetNamePrefix(v string) *ListRulesInput {
s.NamePrefix = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *ListRulesInput) SetNextToken(v string) *ListRulesInput {
s.NextToken = &v
return s
}
type ListRulesOutput struct {
_ struct{} `type:"structure"`
// Indicates whether there are additional results to retrieve. If there are
// no more results, the value is null.
NextToken *string `min:"1" type:"string"`
// The rules that match the specified criteria.
Rules []*Rule `type:"list"`
}
// String returns the string representation
func (s ListRulesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListRulesOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *ListRulesOutput) SetNextToken(v string) *ListRulesOutput {
s.NextToken = &v
return s
}
// SetRules sets the Rules field's value.
func (s *ListRulesOutput) SetRules(v []*Rule) *ListRulesOutput {
s.Rules = v
return s
}
type ListTargetsByRuleInput struct {
_ struct{} `type:"structure"`
// The maximum number of results to return.
Limit *int64 `min:"1" type:"integer"`
// The token returned by a previous call to retrieve the next set of results.
NextToken *string `min:"1" type:"string"`
// The name of the rule.
//
// Rule is a required field
Rule *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s ListTargetsByRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListTargetsByRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTargetsByRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTargetsByRuleInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetLimit sets the Limit field's value.
func (s *ListTargetsByRuleInput) SetLimit(v int64) *ListTargetsByRuleInput {
s.Limit = &v
return s
}
// SetNextToken sets the NextToken field's value.
func (s *ListTargetsByRuleInput) SetNextToken(v string) *ListTargetsByRuleInput {
s.NextToken = &v
return s
}
// SetRule sets the Rule field's value.
func (s *ListTargetsByRuleInput) SetRule(v string) *ListTargetsByRuleInput {
s.Rule = &v
return s
}
type ListTargetsByRuleOutput struct {
_ struct{} `type:"structure"`
// Indicates whether there are additional results to retrieve. If there are
// no more results, the value is null.
NextToken *string `min:"1" type:"string"`
// The targets assigned to the rule.
Targets []*Target `min:"1" type:"list"`
}
// String returns the string representation
func (s ListTargetsByRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ListTargetsByRuleOutput) GoString() string {
return s.String()
}
// SetNextToken sets the NextToken field's value.
func (s *ListTargetsByRuleOutput) SetNextToken(v string) *ListTargetsByRuleOutput {
s.NextToken = &v
return s
}
// SetTargets sets the Targets field's value.
func (s *ListTargetsByRuleOutput) SetTargets(v []*Target) *ListTargetsByRuleOutput {
s.Targets = v
return s
}
type PutEventsInput struct {
_ struct{} `type:"structure"`
// The entry that defines an event in your system. You can specify several parameters
// for the entry such as the source and type of the event, resources associated
// with the event, and so on.
//
// Entries is a required field
Entries []*PutEventsRequestEntry `min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s PutEventsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"}
if s.Entries == nil {
invalidParams.Add(request.NewErrParamRequired("Entries"))
}
if s.Entries != nil && len(s.Entries) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Entries", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEntries sets the Entries field's value.
func (s *PutEventsInput) SetEntries(v []*PutEventsRequestEntry) *PutEventsInput {
s.Entries = v
return s
}
type PutEventsOutput struct {
_ struct{} `type:"structure"`
// The successfully and unsuccessfully ingested events results. If the ingestion
// was successful, the entry has the event ID in it. Otherwise, you can use
// the error code and error message to identify the problem with the entry.
Entries []*PutEventsResultEntry `type:"list"`
// The number of failed entries.
FailedEntryCount *int64 `type:"integer"`
}
// String returns the string representation
func (s PutEventsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutEventsOutput) GoString() string {
return s.String()
}
// SetEntries sets the Entries field's value.
func (s *PutEventsOutput) SetEntries(v []*PutEventsResultEntry) *PutEventsOutput {
s.Entries = v
return s
}
// SetFailedEntryCount sets the FailedEntryCount field's value.
func (s *PutEventsOutput) SetFailedEntryCount(v int64) *PutEventsOutput {
s.FailedEntryCount = &v
return s
}
// Represents an event to be submitted.
type PutEventsRequestEntry struct {
_ struct{} `type:"structure"`
// A valid JSON string. There is no other schema imposed. The JSON string may
// contain fields and nested subobjects.
Detail *string `type:"string"`
// Free-form string used to decide what fields to expect in the event detail.
DetailType *string `type:"string"`
// AWS resources, identified by Amazon Resource Name (ARN), which the event
// primarily concerns. Any number, including zero, may be present.
Resources []*string `type:"list"`
// The source of the event.
Source *string `type:"string"`
// The timestamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt).
// If no timestamp is provided, the timestamp of the PutEvents call is used.
Time *time.Time `type:"timestamp" timestampFormat:"unix"`
}
// String returns the string representation
func (s PutEventsRequestEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutEventsRequestEntry) GoString() string {
return s.String()
}
// SetDetail sets the Detail field's value.
func (s *PutEventsRequestEntry) SetDetail(v string) *PutEventsRequestEntry {
s.Detail = &v
return s
}
// SetDetailType sets the DetailType field's value.
func (s *PutEventsRequestEntry) SetDetailType(v string) *PutEventsRequestEntry {
s.DetailType = &v
return s
}
// SetResources sets the Resources field's value.
func (s *PutEventsRequestEntry) SetResources(v []*string) *PutEventsRequestEntry {
s.Resources = v
return s
}
// SetSource sets the Source field's value.
func (s *PutEventsRequestEntry) SetSource(v string) *PutEventsRequestEntry {
s.Source = &v
return s
}
// SetTime sets the Time field's value.
func (s *PutEventsRequestEntry) SetTime(v time.Time) *PutEventsRequestEntry {
s.Time = &v
return s
}
// Represents an event that failed to be submitted.
type PutEventsResultEntry struct {
_ struct{} `type:"structure"`
// The error code that indicates why the event submission failed.
ErrorCode *string `type:"string"`
// The error message that explains why the event submission failed.
ErrorMessage *string `type:"string"`
// The ID of the event.
EventId *string `type:"string"`
}
// String returns the string representation
func (s PutEventsResultEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutEventsResultEntry) GoString() string {
return s.String()
}
// SetErrorCode sets the ErrorCode field's value.
func (s *PutEventsResultEntry) SetErrorCode(v string) *PutEventsResultEntry {
s.ErrorCode = &v
return s
}
// SetErrorMessage sets the ErrorMessage field's value.
func (s *PutEventsResultEntry) SetErrorMessage(v string) *PutEventsResultEntry {
s.ErrorMessage = &v
return s
}
// SetEventId sets the EventId field's value.
func (s *PutEventsResultEntry) SetEventId(v string) *PutEventsResultEntry {
s.EventId = &v
return s
}
type PutPermissionInput struct {
_ struct{} `type:"structure"`
// The action that you are enabling the other account to perform. Currently,
// this must be events:PutEvents.
//
// Action is a required field
Action *string `min:"1" type:"string" required:"true"`
// The 12-digit AWS account ID that you are permitting to put events to your
// default event bus. Specify "*" to permit any account to put events to your
// default event bus.
//
// If you specify "*", avoid creating rules that may match undesirable events.
// To create more secure rules, make sure that the event pattern for each rule
// contains an account field with a specific account ID from which to receive
// events. Rules with an account field do not match any events sent from other
// accounts.
//
// Principal is a required field
Principal *string `min:"1" type:"string" required:"true"`
// An identifier string for the external account that you are granting permissions
// to. If you later want to revoke the permission for this external account,
// specify this StatementId when you run RemovePermission.
//
// StatementId is a required field
StatementId *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s PutPermissionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutPermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutPermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutPermissionInput"}
if s.Action == nil {
invalidParams.Add(request.NewErrParamRequired("Action"))
}
if s.Action != nil && len(*s.Action) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Action", 1))
}
if s.Principal == nil {
invalidParams.Add(request.NewErrParamRequired("Principal"))
}
if s.Principal != nil && len(*s.Principal) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Principal", 1))
}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetAction sets the Action field's value.
func (s *PutPermissionInput) SetAction(v string) *PutPermissionInput {
s.Action = &v
return s
}
// SetPrincipal sets the Principal field's value.
func (s *PutPermissionInput) SetPrincipal(v string) *PutPermissionInput {
s.Principal = &v
return s
}
// SetStatementId sets the StatementId field's value.
func (s *PutPermissionInput) SetStatementId(v string) *PutPermissionInput {
s.StatementId = &v
return s
}
type PutPermissionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s PutPermissionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutPermissionOutput) GoString() string {
return s.String()
}
type PutRuleInput struct {
_ struct{} `type:"structure"`
// A description of the rule.
Description *string `type:"string"`
// The event pattern. For more information, see Events and Event Patterns (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html)
// in the Amazon CloudWatch Events User Guide.
EventPattern *string `type:"string"`
// The name of the rule that you are creating or updating.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
// The Amazon Resource Name (ARN) of the IAM role associated with the rule.
RoleArn *string `min:"1" type:"string"`
// The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
ScheduleExpression *string `type:"string"`
// Indicates whether the rule is enabled or disabled.
State *string `type:"string" enum:"RuleState"`
}
// String returns the string representation
func (s PutRuleInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if s.RoleArn != nil && len(*s.RoleArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetDescription sets the Description field's value.
func (s *PutRuleInput) SetDescription(v string) *PutRuleInput {
s.Description = &v
return s
}
// SetEventPattern sets the EventPattern field's value.
func (s *PutRuleInput) SetEventPattern(v string) *PutRuleInput {
s.EventPattern = &v
return s
}
// SetName sets the Name field's value.
func (s *PutRuleInput) SetName(v string) *PutRuleInput {
s.Name = &v
return s
}
// SetRoleArn sets the RoleArn field's value.
func (s *PutRuleInput) SetRoleArn(v string) *PutRuleInput {
s.RoleArn = &v
return s
}
// SetScheduleExpression sets the ScheduleExpression field's value.
func (s *PutRuleInput) SetScheduleExpression(v string) *PutRuleInput {
s.ScheduleExpression = &v
return s
}
// SetState sets the State field's value.
func (s *PutRuleInput) SetState(v string) *PutRuleInput {
s.State = &v
return s
}
type PutRuleOutput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the rule.
RuleArn *string `min:"1" type:"string"`
}
// String returns the string representation
func (s PutRuleOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutRuleOutput) GoString() string {
return s.String()
}
// SetRuleArn sets the RuleArn field's value.
func (s *PutRuleOutput) SetRuleArn(v string) *PutRuleOutput {
s.RuleArn = &v
return s
}
type PutTargetsInput struct {
_ struct{} `type:"structure"`
// The name of the rule.
//
// Rule is a required field
Rule *string `min:"1" type:"string" required:"true"`
// The targets to update or add to the rule.
//
// Targets is a required field
Targets []*Target `min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s PutTargetsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutTargetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutTargetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutTargetsInput"}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if s.Targets == nil {
invalidParams.Add(request.NewErrParamRequired("Targets"))
}
if s.Targets != nil && len(s.Targets) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Targets", 1))
}
if s.Targets != nil {
for i, v := range s.Targets {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetRule sets the Rule field's value.
func (s *PutTargetsInput) SetRule(v string) *PutTargetsInput {
s.Rule = &v
return s
}
// SetTargets sets the Targets field's value.
func (s *PutTargetsInput) SetTargets(v []*Target) *PutTargetsInput {
s.Targets = v
return s
}
type PutTargetsOutput struct {
_ struct{} `type:"structure"`
// The failed target entries.
FailedEntries []*PutTargetsResultEntry `type:"list"`
// The number of failed entries.
FailedEntryCount *int64 `type:"integer"`
}
// String returns the string representation
func (s PutTargetsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutTargetsOutput) GoString() string {
return s.String()
}
// SetFailedEntries sets the FailedEntries field's value.
func (s *PutTargetsOutput) SetFailedEntries(v []*PutTargetsResultEntry) *PutTargetsOutput {
s.FailedEntries = v
return s
}
// SetFailedEntryCount sets the FailedEntryCount field's value.
func (s *PutTargetsOutput) SetFailedEntryCount(v int64) *PutTargetsOutput {
s.FailedEntryCount = &v
return s
}
// Represents a target that failed to be added to a rule.
type PutTargetsResultEntry struct {
_ struct{} `type:"structure"`
// The error code that indicates why the target addition failed. If the value
// is ConcurrentModificationException, too many requests were made at the same
// time.
ErrorCode *string `type:"string"`
// The error message that explains why the target addition failed.
ErrorMessage *string `type:"string"`
// The ID of the target.
TargetId *string `min:"1" type:"string"`
}
// String returns the string representation
func (s PutTargetsResultEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s PutTargetsResultEntry) GoString() string {
return s.String()
}
// SetErrorCode sets the ErrorCode field's value.
func (s *PutTargetsResultEntry) SetErrorCode(v string) *PutTargetsResultEntry {
s.ErrorCode = &v
return s
}
// SetErrorMessage sets the ErrorMessage field's value.
func (s *PutTargetsResultEntry) SetErrorMessage(v string) *PutTargetsResultEntry {
s.ErrorMessage = &v
return s
}
// SetTargetId sets the TargetId field's value.
func (s *PutTargetsResultEntry) SetTargetId(v string) *PutTargetsResultEntry {
s.TargetId = &v
return s
}
type RemovePermissionInput struct {
_ struct{} `type:"structure"`
// The statement ID corresponding to the account that is no longer allowed to
// put events to the default event bus.
//
// StatementId is a required field
StatementId *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s RemovePermissionInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemovePermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemovePermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetStatementId sets the StatementId field's value.
func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput {
s.StatementId = &v
return s
}
type RemovePermissionOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s RemovePermissionOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemovePermissionOutput) GoString() string {
return s.String()
}
type RemoveTargetsInput struct {
_ struct{} `type:"structure"`
// The IDs of the targets to remove from the rule.
//
// Ids is a required field
Ids []*string `min:"1" type:"list" required:"true"`
// The name of the rule.
//
// Rule is a required field
Rule *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s RemoveTargetsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemoveTargetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTargetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTargetsInput"}
if s.Ids == nil {
invalidParams.Add(request.NewErrParamRequired("Ids"))
}
if s.Ids != nil && len(s.Ids) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Ids", 1))
}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetIds sets the Ids field's value.
func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput {
s.Ids = v
return s
}
// SetRule sets the Rule field's value.
func (s *RemoveTargetsInput) SetRule(v string) *RemoveTargetsInput {
s.Rule = &v
return s
}
type RemoveTargetsOutput struct {
_ struct{} `type:"structure"`
// The failed target entries.
FailedEntries []*RemoveTargetsResultEntry `type:"list"`
// The number of failed entries.
FailedEntryCount *int64 `type:"integer"`
}
// String returns the string representation
func (s RemoveTargetsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemoveTargetsOutput) GoString() string {
return s.String()
}
// SetFailedEntries sets the FailedEntries field's value.
func (s *RemoveTargetsOutput) SetFailedEntries(v []*RemoveTargetsResultEntry) *RemoveTargetsOutput {
s.FailedEntries = v
return s
}
// SetFailedEntryCount sets the FailedEntryCount field's value.
func (s *RemoveTargetsOutput) SetFailedEntryCount(v int64) *RemoveTargetsOutput {
s.FailedEntryCount = &v
return s
}
// Represents a target that failed to be removed from a rule.
type RemoveTargetsResultEntry struct {
_ struct{} `type:"structure"`
// The error code that indicates why the target removal failed. If the value
// is ConcurrentModificationException, too many requests were made at the same
// time.
ErrorCode *string `type:"string"`
// The error message that explains why the target removal failed.
ErrorMessage *string `type:"string"`
// The ID of the target.
TargetId *string `min:"1" type:"string"`
}
// String returns the string representation
func (s RemoveTargetsResultEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RemoveTargetsResultEntry) GoString() string {
return s.String()
}
// SetErrorCode sets the ErrorCode field's value.
func (s *RemoveTargetsResultEntry) SetErrorCode(v string) *RemoveTargetsResultEntry {
s.ErrorCode = &v
return s
}
// SetErrorMessage sets the ErrorMessage field's value.
func (s *RemoveTargetsResultEntry) SetErrorMessage(v string) *RemoveTargetsResultEntry {
s.ErrorMessage = &v
return s
}
// SetTargetId sets the TargetId field's value.
func (s *RemoveTargetsResultEntry) SetTargetId(v string) *RemoveTargetsResultEntry {
s.TargetId = &v
return s
}
// Contains information about a rule in Amazon CloudWatch Events.
type Rule struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the rule.
Arn *string `min:"1" type:"string"`
// The description of the rule.
Description *string `type:"string"`
// The event pattern of the rule. For more information, see Events and Event
// Patterns (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html)
// in the Amazon CloudWatch Events User Guide.
EventPattern *string `type:"string"`
// The name of the rule.
Name *string `min:"1" type:"string"`
// The Amazon Resource Name (ARN) of the role that is used for target invocation.
RoleArn *string `min:"1" type:"string"`
// The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
ScheduleExpression *string `type:"string"`
// The state of the rule.
State *string `type:"string" enum:"RuleState"`
}
// String returns the string representation
func (s Rule) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Rule) GoString() string {
return s.String()
}
// SetArn sets the Arn field's value.
func (s *Rule) SetArn(v string) *Rule {
s.Arn = &v
return s
}
// SetDescription sets the Description field's value.
func (s *Rule) SetDescription(v string) *Rule {
s.Description = &v
return s
}
// SetEventPattern sets the EventPattern field's value.
func (s *Rule) SetEventPattern(v string) *Rule {
s.EventPattern = &v
return s
}
// SetName sets the Name field's value.
func (s *Rule) SetName(v string) *Rule {
s.Name = &v
return s
}
// SetRoleArn sets the RoleArn field's value.
func (s *Rule) SetRoleArn(v string) *Rule {
s.RoleArn = &v
return s
}
// SetScheduleExpression sets the ScheduleExpression field's value.
func (s *Rule) SetScheduleExpression(v string) *Rule {
s.ScheduleExpression = &v
return s
}
// SetState sets the State field's value.
func (s *Rule) SetState(v string) *Rule {
s.State = &v
return s
}
// This parameter contains the criteria (either InstanceIds or a tag) used to
// specify which EC2 instances are to be sent the command.
type RunCommandParameters struct {
_ struct{} `type:"structure"`
// Currently, we support including only one RunCommandTarget block, which specifies
// either an array of InstanceIds or a tag.
//
// RunCommandTargets is a required field
RunCommandTargets []*RunCommandTarget `min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s RunCommandParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RunCommandParameters) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RunCommandParameters) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RunCommandParameters"}
if s.RunCommandTargets == nil {
invalidParams.Add(request.NewErrParamRequired("RunCommandTargets"))
}
if s.RunCommandTargets != nil && len(s.RunCommandTargets) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RunCommandTargets", 1))
}
if s.RunCommandTargets != nil {
for i, v := range s.RunCommandTargets {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RunCommandTargets", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetRunCommandTargets sets the RunCommandTargets field's value.
func (s *RunCommandParameters) SetRunCommandTargets(v []*RunCommandTarget) *RunCommandParameters {
s.RunCommandTargets = v
return s
}
// Information about the EC2 instances that are to be sent the command, specified
// as key-value pairs. Each RunCommandTarget block can include only one key,
// but this key may specify multiple values.
type RunCommandTarget struct {
_ struct{} `type:"structure"`
// Can be either tag:tag-key or InstanceIds.
//
// Key is a required field
Key *string `min:"1" type:"string" required:"true"`
// If Key is tag:tag-key, Values is a list of tag values. If Key is InstanceIds,
// Values is a list of Amazon EC2 instance IDs.
//
// Values is a required field
Values []*string `min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s RunCommandTarget) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s RunCommandTarget) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RunCommandTarget) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RunCommandTarget"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Key", 1))
}
if s.Values == nil {
invalidParams.Add(request.NewErrParamRequired("Values"))
}
if s.Values != nil && len(s.Values) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Values", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetKey sets the Key field's value.
func (s *RunCommandTarget) SetKey(v string) *RunCommandTarget {
s.Key = &v
return s
}
// SetValues sets the Values field's value.
func (s *RunCommandTarget) SetValues(v []*string) *RunCommandTarget {
s.Values = v
return s
}
// This structure includes the custom parameter to be used when the target is
// an SQS FIFO queue.
type SqsParameters struct {
_ struct{} `type:"structure"`
// The FIFO message group ID to use as the target.
MessageGroupId *string `type:"string"`
}
// String returns the string representation
func (s SqsParameters) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s SqsParameters) GoString() string {
return s.String()
}
// SetMessageGroupId sets the MessageGroupId field's value.
func (s *SqsParameters) SetMessageGroupId(v string) *SqsParameters {
s.MessageGroupId = &v
return s
}
// Targets are the resources to be invoked when a rule is triggered. Target
// types include EC2 instances, AWS Lambda functions, Amazon Kinesis streams,
// Amazon ECS tasks, AWS Step Functions state machines, Run Command, and built-in
// targets.
type Target struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the target.
//
// Arn is a required field
Arn *string `min:"1" type:"string" required:"true"`
// Contains the job definition, job name, and other parameters if the event
// target is an AWS Batch job. For more information about AWS Batch, see Jobs
// (http://docs.aws.amazon.com/batch/latest/userguide/jobs.html) in the AWS
// Batch User Guide.
BatchParameters *BatchParameters `type:"structure"`
// Contains the Amazon ECS task definition and task count to be used, if the
// event target is an Amazon ECS task. For more information about Amazon ECS
// tasks, see Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html)
// in the Amazon EC2 Container Service Developer Guide.
EcsParameters *EcsParameters `type:"structure"`
// The ID of the target.
//
// Id is a required field
Id *string `min:"1" type:"string" required:"true"`
// Valid JSON text passed to the target. In this case, nothing from the event
// itself is passed to the target. For more information, see The JavaScript
// Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt).
Input *string `type:"string"`
// The value of the JSONPath that is used for extracting part of the matched
// event when passing it to the target. You must use JSON dot notation, not
// bracket notation. For more information about JSON paths, see JSONPath (http://goessner.net/articles/JsonPath/).
InputPath *string `type:"string"`
// Settings to enable you to provide custom input to a target based on certain
// event data. You can extract one or more key-value pairs from the event and
// then use that data to send customized input to the target.
InputTransformer *InputTransformer `type:"structure"`
// The custom parameter you can use to control shard assignment, when the target
// is an Amazon Kinesis stream. If you do not include this parameter, the default
// is to use the eventId as the partition key.
KinesisParameters *KinesisParameters `type:"structure"`
// The Amazon Resource Name (ARN) of the IAM role to be used for this target
// when the rule is triggered. If one rule triggers multiple targets, you can
// use a different IAM role for each target.
RoleArn *string `min:"1" type:"string"`
// Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
RunCommandParameters *RunCommandParameters `type:"structure"`
// Contains the message group ID to use when the target is a FIFO queue.
SqsParameters *SqsParameters `type:"structure"`
}
// String returns the string representation
func (s Target) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Target) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Target) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Target"}
if s.Arn == nil {
invalidParams.Add(request.NewErrParamRequired("Arn"))
}
if s.Arn != nil && len(*s.Arn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.Id != nil && len(*s.Id) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Id", 1))
}
if s.RoleArn != nil && len(*s.RoleArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
}
if s.BatchParameters != nil {
if err := s.BatchParameters.Validate(); err != nil {
invalidParams.AddNested("BatchParameters", err.(request.ErrInvalidParams))
}
}
if s.EcsParameters != nil {
if err := s.EcsParameters.Validate(); err != nil {
invalidParams.AddNested("EcsParameters", err.(request.ErrInvalidParams))
}
}
if s.InputTransformer != nil {
if err := s.InputTransformer.Validate(); err != nil {
invalidParams.AddNested("InputTransformer", err.(request.ErrInvalidParams))
}
}
if s.KinesisParameters != nil {
if err := s.KinesisParameters.Validate(); err != nil {
invalidParams.AddNested("KinesisParameters", err.(request.ErrInvalidParams))
}
}
if s.RunCommandParameters != nil {
if err := s.RunCommandParameters.Validate(); err != nil {
invalidParams.AddNested("RunCommandParameters", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetArn sets the Arn field's value.
func (s *Target) SetArn(v string) *Target {
s.Arn = &v
return s
}
// SetBatchParameters sets the BatchParameters field's value.
func (s *Target) SetBatchParameters(v *BatchParameters) *Target {
s.BatchParameters = v
return s
}
// SetEcsParameters sets the EcsParameters field's value.
func (s *Target) SetEcsParameters(v *EcsParameters) *Target {
s.EcsParameters = v
return s
}
// SetId sets the Id field's value.
func (s *Target) SetId(v string) *Target {
s.Id = &v
return s
}
// SetInput sets the Input field's value.
func (s *Target) SetInput(v string) *Target {
s.Input = &v
return s
}
// SetInputPath sets the InputPath field's value.
func (s *Target) SetInputPath(v string) *Target {
s.InputPath = &v
return s
}
// SetInputTransformer sets the InputTransformer field's value.
func (s *Target) SetInputTransformer(v *InputTransformer) *Target {
s.InputTransformer = v
return s
}
// SetKinesisParameters sets the KinesisParameters field's value.
func (s *Target) SetKinesisParameters(v *KinesisParameters) *Target {
s.KinesisParameters = v
return s
}
// SetRoleArn sets the RoleArn field's value.
func (s *Target) SetRoleArn(v string) *Target {
s.RoleArn = &v
return s
}
// SetRunCommandParameters sets the RunCommandParameters field's value.
func (s *Target) SetRunCommandParameters(v *RunCommandParameters) *Target {
s.RunCommandParameters = v
return s
}
// SetSqsParameters sets the SqsParameters field's value.
func (s *Target) SetSqsParameters(v *SqsParameters) *Target {
s.SqsParameters = v
return s
}
type TestEventPatternInput struct {
_ struct{} `type:"structure"`
// The event, in JSON format, to test against the event pattern.
//
// Event is a required field
Event *string `type:"string" required:"true"`
// The event pattern. For more information, see Events and Event Patterns (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html)
// in the Amazon CloudWatch Events User Guide.
//
// EventPattern is a required field
EventPattern *string `type:"string" required:"true"`
}
// String returns the string representation
func (s TestEventPatternInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s TestEventPatternInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TestEventPatternInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TestEventPatternInput"}
if s.Event == nil {
invalidParams.Add(request.NewErrParamRequired("Event"))
}
if s.EventPattern == nil {
invalidParams.Add(request.NewErrParamRequired("EventPattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEvent sets the Event field's value.
func (s *TestEventPatternInput) SetEvent(v string) *TestEventPatternInput {
s.Event = &v
return s
}
// SetEventPattern sets the EventPattern field's value.
func (s *TestEventPatternInput) SetEventPattern(v string) *TestEventPatternInput {
s.EventPattern = &v
return s
}
type TestEventPatternOutput struct {
_ struct{} `type:"structure"`
// Indicates whether the event matches the event pattern.
Result *bool `type:"boolean"`
}
// String returns the string representation
func (s TestEventPatternOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s TestEventPatternOutput) GoString() string {
return s.String()
}
// SetResult sets the Result field's value.
func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput {
s.Result = &v
return s
}
const (
// RuleStateEnabled is a RuleState enum value
RuleStateEnabled = "ENABLED"
// RuleStateDisabled is a RuleState enum value
RuleStateDisabled = "DISABLED"
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/aws-sdk-go.git
git@gitee.com:mirrors/aws-sdk-go.git
mirrors
aws-sdk-go
aws-sdk-go
v1.14.27

搜索帮助