api.go 158 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package cloudtrail
  3. import (
  4. "fmt"
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  11. )
  12. const opAddTags = "AddTags"
  13. // AddTagsRequest generates a "aws/request.Request" representing the
  14. // client's request for the AddTags operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfully.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See AddTags for more information on using the AddTags
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. //
  28. // // Example sending a request using the AddTagsRequest method.
  29. // req, resp := client.AddTagsRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags
  37. func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) {
  38. op := &request.Operation{
  39. Name: opAddTags,
  40. HTTPMethod: "POST",
  41. HTTPPath: "/",
  42. }
  43. if input == nil {
  44. input = &AddTagsInput{}
  45. }
  46. output = &AddTagsOutput{}
  47. req = c.newRequest(op, input, output)
  48. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  49. return
  50. }
  51. // AddTags API operation for AWS CloudTrail.
  52. //
  53. // Adds one or more tags to a trail, up to a limit of 50. Tags must be unique
  54. // per trail. Overwrites an existing tag's value when a new value is specified
  55. // for an existing tag key. If you specify a key without a value, the tag will
  56. // be created with the specified key and a value of null. You can tag a trail
  57. // that applies to all regions only from the region in which the trail was created
  58. // (that is, from its home region).
  59. //
  60. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  61. // with awserr.Error's Code and Message methods to get detailed information about
  62. // the error.
  63. //
  64. // See the AWS API reference guide for AWS CloudTrail's
  65. // API operation AddTags for usage and error information.
  66. //
  67. // Returned Error Codes:
  68. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  69. // This exception is thrown when the specified resource is not found.
  70. //
  71. // * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
  72. // This exception is thrown when an operation is called with an invalid trail
  73. // ARN. The format of a trail ARN is:
  74. //
  75. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  76. //
  77. // * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException"
  78. // This exception is thrown when the specified resource type is not supported
  79. // by CloudTrail.
  80. //
  81. // * ErrCodeTagsLimitExceededException "TagsLimitExceededException"
  82. // The number of tags per trail has exceeded the permitted amount. Currently,
  83. // the limit is 50.
  84. //
  85. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  86. // This exception is thrown when the provided trail name is not valid. Trail
  87. // names must meet the following requirements:
  88. //
  89. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  90. // (_), or dashes (-)
  91. //
  92. // * Start with a letter or number, and end with a letter or number
  93. //
  94. // * Be between 3 and 128 characters
  95. //
  96. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  97. // and my--namespace are invalid.
  98. //
  99. // * Not be in IP address format (for example, 192.168.5.4)
  100. //
  101. // * ErrCodeInvalidTagParameterException "InvalidTagParameterException"
  102. // This exception is thrown when the key or value specified for the tag does
  103. // not match the regular expression ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$.
  104. //
  105. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  106. // This exception is thrown when the requested operation is not supported.
  107. //
  108. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  109. // This exception is thrown when the requested operation is not permitted.
  110. //
  111. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  112. // This exception is thrown when the AWS account making the request to create
  113. // or update an organization trail is not the master account for an organization
  114. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  115. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  116. //
  117. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags
  118. func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) {
  119. req, out := c.AddTagsRequest(input)
  120. return out, req.Send()
  121. }
  122. // AddTagsWithContext is the same as AddTags with the addition of
  123. // the ability to pass a context and additional request options.
  124. //
  125. // See AddTags for details on how to use this API operation.
  126. //
  127. // The context must be non-nil and will be used for request cancellation. If
  128. // the context is nil a panic will occur. In the future the SDK may create
  129. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  130. // for more information on using Contexts.
  131. func (c *CloudTrail) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) {
  132. req, out := c.AddTagsRequest(input)
  133. req.SetContext(ctx)
  134. req.ApplyOptions(opts...)
  135. return out, req.Send()
  136. }
  137. const opCreateTrail = "CreateTrail"
  138. // CreateTrailRequest generates a "aws/request.Request" representing the
  139. // client's request for the CreateTrail operation. The "output" return
  140. // value will be populated with the request's response once the request completes
  141. // successfully.
  142. //
  143. // Use "Send" method on the returned Request to send the API call to the service.
  144. // the "output" return value is not valid until after Send returns without error.
  145. //
  146. // See CreateTrail for more information on using the CreateTrail
  147. // API call, and error handling.
  148. //
  149. // This method is useful when you want to inject custom logic or configuration
  150. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  151. //
  152. //
  153. // // Example sending a request using the CreateTrailRequest method.
  154. // req, resp := client.CreateTrailRequest(params)
  155. //
  156. // err := req.Send()
  157. // if err == nil { // resp is now filled
  158. // fmt.Println(resp)
  159. // }
  160. //
  161. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail
  162. func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) {
  163. op := &request.Operation{
  164. Name: opCreateTrail,
  165. HTTPMethod: "POST",
  166. HTTPPath: "/",
  167. }
  168. if input == nil {
  169. input = &CreateTrailInput{}
  170. }
  171. output = &CreateTrailOutput{}
  172. req = c.newRequest(op, input, output)
  173. return
  174. }
  175. // CreateTrail API operation for AWS CloudTrail.
  176. //
  177. // Creates a trail that specifies the settings for delivery of log data to an
  178. // Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective
  179. // of the region in which they were created.
  180. //
  181. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  182. // with awserr.Error's Code and Message methods to get detailed information about
  183. // the error.
  184. //
  185. // See the AWS API reference guide for AWS CloudTrail's
  186. // API operation CreateTrail for usage and error information.
  187. //
  188. // Returned Error Codes:
  189. // * ErrCodeMaximumNumberOfTrailsExceededException "MaximumNumberOfTrailsExceededException"
  190. // This exception is thrown when the maximum number of trails is reached.
  191. //
  192. // * ErrCodeTrailAlreadyExistsException "TrailAlreadyExistsException"
  193. // This exception is thrown when the specified trail already exists.
  194. //
  195. // * ErrCodeS3BucketDoesNotExistException "S3BucketDoesNotExistException"
  196. // This exception is thrown when the specified S3 bucket does not exist.
  197. //
  198. // * ErrCodeInsufficientS3BucketPolicyException "InsufficientS3BucketPolicyException"
  199. // This exception is thrown when the policy on the S3 bucket is not sufficient.
  200. //
  201. // * ErrCodeInsufficientSnsTopicPolicyException "InsufficientSnsTopicPolicyException"
  202. // This exception is thrown when the policy on the SNS topic is not sufficient.
  203. //
  204. // * ErrCodeInsufficientEncryptionPolicyException "InsufficientEncryptionPolicyException"
  205. // This exception is thrown when the policy on the S3 bucket or KMS key is not
  206. // sufficient.
  207. //
  208. // * ErrCodeInvalidS3BucketNameException "InvalidS3BucketNameException"
  209. // This exception is thrown when the provided S3 bucket name is not valid.
  210. //
  211. // * ErrCodeInvalidS3PrefixException "InvalidS3PrefixException"
  212. // This exception is thrown when the provided S3 prefix is not valid.
  213. //
  214. // * ErrCodeInvalidSnsTopicNameException "InvalidSnsTopicNameException"
  215. // This exception is thrown when the provided SNS topic name is not valid.
  216. //
  217. // * ErrCodeInvalidKmsKeyIdException "InvalidKmsKeyIdException"
  218. // This exception is thrown when the KMS key ARN is invalid.
  219. //
  220. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  221. // This exception is thrown when the provided trail name is not valid. Trail
  222. // names must meet the following requirements:
  223. //
  224. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  225. // (_), or dashes (-)
  226. //
  227. // * Start with a letter or number, and end with a letter or number
  228. //
  229. // * Be between 3 and 128 characters
  230. //
  231. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  232. // and my--namespace are invalid.
  233. //
  234. // * Not be in IP address format (for example, 192.168.5.4)
  235. //
  236. // * ErrCodeTrailNotProvidedException "TrailNotProvidedException"
  237. // This exception is deprecated.
  238. //
  239. // * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException"
  240. // This exception is thrown when the combination of parameters provided is not
  241. // valid.
  242. //
  243. // * ErrCodeKmsKeyNotFoundException "KmsKeyNotFoundException"
  244. // This exception is thrown when the KMS key does not exist, or when the S3
  245. // bucket and the KMS key are not in the same region.
  246. //
  247. // * ErrCodeKmsKeyDisabledException "KmsKeyDisabledException"
  248. // This exception is deprecated.
  249. //
  250. // * ErrCodeKmsException "KmsException"
  251. // This exception is thrown when there is an issue with the specified KMS key
  252. // and the trail can’t be updated.
  253. //
  254. // * ErrCodeInvalidCloudWatchLogsLogGroupArnException "InvalidCloudWatchLogsLogGroupArnException"
  255. // This exception is thrown when the provided CloudWatch log group is not valid.
  256. //
  257. // * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException"
  258. // This exception is thrown when the provided role is not valid.
  259. //
  260. // * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException"
  261. // Cannot set a CloudWatch Logs delivery for this region.
  262. //
  263. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  264. // This exception is thrown when the requested operation is not supported.
  265. //
  266. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  267. // This exception is thrown when the requested operation is not permitted.
  268. //
  269. // * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException"
  270. // This exception is thrown when trusted access has not been enabled between
  271. // AWS CloudTrail and AWS Organizations. For more information, see Enabling
  272. // Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)
  273. // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  274. //
  275. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  276. // This exception is thrown when the IAM user or role that is used to create
  277. // the organization trail is lacking one or more required permissions for creating
  278. // an organization trail in a required service. For more information, see Prepare
  279. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  280. //
  281. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  282. // This exception is thrown when the AWS account making the request to create
  283. // or update an organization trail is not the master account for an organization
  284. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  285. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  286. //
  287. // * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException"
  288. // This exception is thrown when the request is made from an AWS account that
  289. // is not a member of an organization. To make this request, sign in using the
  290. // credentials of an account that belongs to an organization.
  291. //
  292. // * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException"
  293. // This exception is thrown when AWS Organizations is not configured to support
  294. // all features. All features must be enabled in AWS Organization to support
  295. // creating an organization trail. For more information, see Prepare For Creating
  296. // a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  297. //
  298. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail
  299. func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) {
  300. req, out := c.CreateTrailRequest(input)
  301. return out, req.Send()
  302. }
  303. // CreateTrailWithContext is the same as CreateTrail with the addition of
  304. // the ability to pass a context and additional request options.
  305. //
  306. // See CreateTrail for details on how to use this API operation.
  307. //
  308. // The context must be non-nil and will be used for request cancellation. If
  309. // the context is nil a panic will occur. In the future the SDK may create
  310. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  311. // for more information on using Contexts.
  312. func (c *CloudTrail) CreateTrailWithContext(ctx aws.Context, input *CreateTrailInput, opts ...request.Option) (*CreateTrailOutput, error) {
  313. req, out := c.CreateTrailRequest(input)
  314. req.SetContext(ctx)
  315. req.ApplyOptions(opts...)
  316. return out, req.Send()
  317. }
  318. const opDeleteTrail = "DeleteTrail"
  319. // DeleteTrailRequest generates a "aws/request.Request" representing the
  320. // client's request for the DeleteTrail operation. The "output" return
  321. // value will be populated with the request's response once the request completes
  322. // successfully.
  323. //
  324. // Use "Send" method on the returned Request to send the API call to the service.
  325. // the "output" return value is not valid until after Send returns without error.
  326. //
  327. // See DeleteTrail for more information on using the DeleteTrail
  328. // API call, and error handling.
  329. //
  330. // This method is useful when you want to inject custom logic or configuration
  331. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  332. //
  333. //
  334. // // Example sending a request using the DeleteTrailRequest method.
  335. // req, resp := client.DeleteTrailRequest(params)
  336. //
  337. // err := req.Send()
  338. // if err == nil { // resp is now filled
  339. // fmt.Println(resp)
  340. // }
  341. //
  342. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail
  343. func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) {
  344. op := &request.Operation{
  345. Name: opDeleteTrail,
  346. HTTPMethod: "POST",
  347. HTTPPath: "/",
  348. }
  349. if input == nil {
  350. input = &DeleteTrailInput{}
  351. }
  352. output = &DeleteTrailOutput{}
  353. req = c.newRequest(op, input, output)
  354. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  355. return
  356. }
  357. // DeleteTrail API operation for AWS CloudTrail.
  358. //
  359. // Deletes a trail. This operation must be called from the region in which the
  360. // trail was created. DeleteTrail cannot be called on the shadow trails (replicated
  361. // trails in other regions) of a trail that is enabled in all regions.
  362. //
  363. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  364. // with awserr.Error's Code and Message methods to get detailed information about
  365. // the error.
  366. //
  367. // See the AWS API reference guide for AWS CloudTrail's
  368. // API operation DeleteTrail for usage and error information.
  369. //
  370. // Returned Error Codes:
  371. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  372. // This exception is thrown when the trail with the given name is not found.
  373. //
  374. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  375. // This exception is thrown when the provided trail name is not valid. Trail
  376. // names must meet the following requirements:
  377. //
  378. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  379. // (_), or dashes (-)
  380. //
  381. // * Start with a letter or number, and end with a letter or number
  382. //
  383. // * Be between 3 and 128 characters
  384. //
  385. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  386. // and my--namespace are invalid.
  387. //
  388. // * Not be in IP address format (for example, 192.168.5.4)
  389. //
  390. // * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException"
  391. // This exception is thrown when an operation is called on a trail from a region
  392. // other than the region in which the trail was created.
  393. //
  394. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  395. // This exception is thrown when the requested operation is not supported.
  396. //
  397. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  398. // This exception is thrown when the requested operation is not permitted.
  399. //
  400. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  401. // This exception is thrown when the AWS account making the request to create
  402. // or update an organization trail is not the master account for an organization
  403. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  404. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  405. //
  406. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  407. // This exception is thrown when the IAM user or role that is used to create
  408. // the organization trail is lacking one or more required permissions for creating
  409. // an organization trail in a required service. For more information, see Prepare
  410. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  411. //
  412. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail
  413. func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) {
  414. req, out := c.DeleteTrailRequest(input)
  415. return out, req.Send()
  416. }
  417. // DeleteTrailWithContext is the same as DeleteTrail with the addition of
  418. // the ability to pass a context and additional request options.
  419. //
  420. // See DeleteTrail for details on how to use this API operation.
  421. //
  422. // The context must be non-nil and will be used for request cancellation. If
  423. // the context is nil a panic will occur. In the future the SDK may create
  424. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  425. // for more information on using Contexts.
  426. func (c *CloudTrail) DeleteTrailWithContext(ctx aws.Context, input *DeleteTrailInput, opts ...request.Option) (*DeleteTrailOutput, error) {
  427. req, out := c.DeleteTrailRequest(input)
  428. req.SetContext(ctx)
  429. req.ApplyOptions(opts...)
  430. return out, req.Send()
  431. }
  432. const opDescribeTrails = "DescribeTrails"
  433. // DescribeTrailsRequest generates a "aws/request.Request" representing the
  434. // client's request for the DescribeTrails operation. The "output" return
  435. // value will be populated with the request's response once the request completes
  436. // successfully.
  437. //
  438. // Use "Send" method on the returned Request to send the API call to the service.
  439. // the "output" return value is not valid until after Send returns without error.
  440. //
  441. // See DescribeTrails for more information on using the DescribeTrails
  442. // API call, and error handling.
  443. //
  444. // This method is useful when you want to inject custom logic or configuration
  445. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  446. //
  447. //
  448. // // Example sending a request using the DescribeTrailsRequest method.
  449. // req, resp := client.DescribeTrailsRequest(params)
  450. //
  451. // err := req.Send()
  452. // if err == nil { // resp is now filled
  453. // fmt.Println(resp)
  454. // }
  455. //
  456. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails
  457. func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) {
  458. op := &request.Operation{
  459. Name: opDescribeTrails,
  460. HTTPMethod: "POST",
  461. HTTPPath: "/",
  462. }
  463. if input == nil {
  464. input = &DescribeTrailsInput{}
  465. }
  466. output = &DescribeTrailsOutput{}
  467. req = c.newRequest(op, input, output)
  468. return
  469. }
  470. // DescribeTrails API operation for AWS CloudTrail.
  471. //
  472. // Retrieves settings for the trail associated with the current region for your
  473. // account.
  474. //
  475. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  476. // with awserr.Error's Code and Message methods to get detailed information about
  477. // the error.
  478. //
  479. // See the AWS API reference guide for AWS CloudTrail's
  480. // API operation DescribeTrails for usage and error information.
  481. //
  482. // Returned Error Codes:
  483. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  484. // This exception is thrown when the requested operation is not supported.
  485. //
  486. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  487. // This exception is thrown when the requested operation is not permitted.
  488. //
  489. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails
  490. func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) {
  491. req, out := c.DescribeTrailsRequest(input)
  492. return out, req.Send()
  493. }
  494. // DescribeTrailsWithContext is the same as DescribeTrails with the addition of
  495. // the ability to pass a context and additional request options.
  496. //
  497. // See DescribeTrails for details on how to use this API operation.
  498. //
  499. // The context must be non-nil and will be used for request cancellation. If
  500. // the context is nil a panic will occur. In the future the SDK may create
  501. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  502. // for more information on using Contexts.
  503. func (c *CloudTrail) DescribeTrailsWithContext(ctx aws.Context, input *DescribeTrailsInput, opts ...request.Option) (*DescribeTrailsOutput, error) {
  504. req, out := c.DescribeTrailsRequest(input)
  505. req.SetContext(ctx)
  506. req.ApplyOptions(opts...)
  507. return out, req.Send()
  508. }
  509. const opGetEventSelectors = "GetEventSelectors"
  510. // GetEventSelectorsRequest generates a "aws/request.Request" representing the
  511. // client's request for the GetEventSelectors operation. The "output" return
  512. // value will be populated with the request's response once the request completes
  513. // successfully.
  514. //
  515. // Use "Send" method on the returned Request to send the API call to the service.
  516. // the "output" return value is not valid until after Send returns without error.
  517. //
  518. // See GetEventSelectors for more information on using the GetEventSelectors
  519. // API call, and error handling.
  520. //
  521. // This method is useful when you want to inject custom logic or configuration
  522. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  523. //
  524. //
  525. // // Example sending a request using the GetEventSelectorsRequest method.
  526. // req, resp := client.GetEventSelectorsRequest(params)
  527. //
  528. // err := req.Send()
  529. // if err == nil { // resp is now filled
  530. // fmt.Println(resp)
  531. // }
  532. //
  533. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors
  534. func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (req *request.Request, output *GetEventSelectorsOutput) {
  535. op := &request.Operation{
  536. Name: opGetEventSelectors,
  537. HTTPMethod: "POST",
  538. HTTPPath: "/",
  539. }
  540. if input == nil {
  541. input = &GetEventSelectorsInput{}
  542. }
  543. output = &GetEventSelectorsOutput{}
  544. req = c.newRequest(op, input, output)
  545. return
  546. }
  547. // GetEventSelectors API operation for AWS CloudTrail.
  548. //
  549. // Describes the settings for the event selectors that you configured for your
  550. // trail. The information returned for your event selectors includes the following:
  551. //
  552. // * If your event selector includes read-only events, write-only events,
  553. // or all events. This applies to both management events and data events.
  554. //
  555. // * If your event selector includes management events.
  556. //
  557. // * If your event selector includes data events, the Amazon S3 objects or
  558. // AWS Lambda functions that you are logging for data events.
  559. //
  560. // For more information, see Logging Data and Management Events for Trails
  561. // (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html)
  562. // in the AWS CloudTrail User Guide.
  563. //
  564. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  565. // with awserr.Error's Code and Message methods to get detailed information about
  566. // the error.
  567. //
  568. // See the AWS API reference guide for AWS CloudTrail's
  569. // API operation GetEventSelectors for usage and error information.
  570. //
  571. // Returned Error Codes:
  572. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  573. // This exception is thrown when the trail with the given name is not found.
  574. //
  575. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  576. // This exception is thrown when the provided trail name is not valid. Trail
  577. // names must meet the following requirements:
  578. //
  579. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  580. // (_), or dashes (-)
  581. //
  582. // * Start with a letter or number, and end with a letter or number
  583. //
  584. // * Be between 3 and 128 characters
  585. //
  586. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  587. // and my--namespace are invalid.
  588. //
  589. // * Not be in IP address format (for example, 192.168.5.4)
  590. //
  591. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  592. // This exception is thrown when the requested operation is not supported.
  593. //
  594. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  595. // This exception is thrown when the requested operation is not permitted.
  596. //
  597. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors
  598. func (c *CloudTrail) GetEventSelectors(input *GetEventSelectorsInput) (*GetEventSelectorsOutput, error) {
  599. req, out := c.GetEventSelectorsRequest(input)
  600. return out, req.Send()
  601. }
  602. // GetEventSelectorsWithContext is the same as GetEventSelectors with the addition of
  603. // the ability to pass a context and additional request options.
  604. //
  605. // See GetEventSelectors for details on how to use this API operation.
  606. //
  607. // The context must be non-nil and will be used for request cancellation. If
  608. // the context is nil a panic will occur. In the future the SDK may create
  609. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  610. // for more information on using Contexts.
  611. func (c *CloudTrail) GetEventSelectorsWithContext(ctx aws.Context, input *GetEventSelectorsInput, opts ...request.Option) (*GetEventSelectorsOutput, error) {
  612. req, out := c.GetEventSelectorsRequest(input)
  613. req.SetContext(ctx)
  614. req.ApplyOptions(opts...)
  615. return out, req.Send()
  616. }
  617. const opGetTrailStatus = "GetTrailStatus"
  618. // GetTrailStatusRequest generates a "aws/request.Request" representing the
  619. // client's request for the GetTrailStatus operation. The "output" return
  620. // value will be populated with the request's response once the request completes
  621. // successfully.
  622. //
  623. // Use "Send" method on the returned Request to send the API call to the service.
  624. // the "output" return value is not valid until after Send returns without error.
  625. //
  626. // See GetTrailStatus for more information on using the GetTrailStatus
  627. // API call, and error handling.
  628. //
  629. // This method is useful when you want to inject custom logic or configuration
  630. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  631. //
  632. //
  633. // // Example sending a request using the GetTrailStatusRequest method.
  634. // req, resp := client.GetTrailStatusRequest(params)
  635. //
  636. // err := req.Send()
  637. // if err == nil { // resp is now filled
  638. // fmt.Println(resp)
  639. // }
  640. //
  641. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus
  642. func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) {
  643. op := &request.Operation{
  644. Name: opGetTrailStatus,
  645. HTTPMethod: "POST",
  646. HTTPPath: "/",
  647. }
  648. if input == nil {
  649. input = &GetTrailStatusInput{}
  650. }
  651. output = &GetTrailStatusOutput{}
  652. req = c.newRequest(op, input, output)
  653. return
  654. }
  655. // GetTrailStatus API operation for AWS CloudTrail.
  656. //
  657. // Returns a JSON-formatted list of information about the specified trail. Fields
  658. // include information on delivery errors, Amazon SNS and Amazon S3 errors,
  659. // and start and stop logging times for each trail. This operation returns trail
  660. // status from a single region. To return trail status from all regions, you
  661. // must call the operation on each region.
  662. //
  663. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  664. // with awserr.Error's Code and Message methods to get detailed information about
  665. // the error.
  666. //
  667. // See the AWS API reference guide for AWS CloudTrail's
  668. // API operation GetTrailStatus for usage and error information.
  669. //
  670. // Returned Error Codes:
  671. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  672. // This exception is thrown when the trail with the given name is not found.
  673. //
  674. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  675. // This exception is thrown when the provided trail name is not valid. Trail
  676. // names must meet the following requirements:
  677. //
  678. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  679. // (_), or dashes (-)
  680. //
  681. // * Start with a letter or number, and end with a letter or number
  682. //
  683. // * Be between 3 and 128 characters
  684. //
  685. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  686. // and my--namespace are invalid.
  687. //
  688. // * Not be in IP address format (for example, 192.168.5.4)
  689. //
  690. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus
  691. func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) {
  692. req, out := c.GetTrailStatusRequest(input)
  693. return out, req.Send()
  694. }
  695. // GetTrailStatusWithContext is the same as GetTrailStatus with the addition of
  696. // the ability to pass a context and additional request options.
  697. //
  698. // See GetTrailStatus for details on how to use this API operation.
  699. //
  700. // The context must be non-nil and will be used for request cancellation. If
  701. // the context is nil a panic will occur. In the future the SDK may create
  702. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  703. // for more information on using Contexts.
  704. func (c *CloudTrail) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) {
  705. req, out := c.GetTrailStatusRequest(input)
  706. req.SetContext(ctx)
  707. req.ApplyOptions(opts...)
  708. return out, req.Send()
  709. }
  710. const opListPublicKeys = "ListPublicKeys"
  711. // ListPublicKeysRequest generates a "aws/request.Request" representing the
  712. // client's request for the ListPublicKeys operation. The "output" return
  713. // value will be populated with the request's response once the request completes
  714. // successfully.
  715. //
  716. // Use "Send" method on the returned Request to send the API call to the service.
  717. // the "output" return value is not valid until after Send returns without error.
  718. //
  719. // See ListPublicKeys for more information on using the ListPublicKeys
  720. // API call, and error handling.
  721. //
  722. // This method is useful when you want to inject custom logic or configuration
  723. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  724. //
  725. //
  726. // // Example sending a request using the ListPublicKeysRequest method.
  727. // req, resp := client.ListPublicKeysRequest(params)
  728. //
  729. // err := req.Send()
  730. // if err == nil { // resp is now filled
  731. // fmt.Println(resp)
  732. // }
  733. //
  734. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys
  735. func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) {
  736. op := &request.Operation{
  737. Name: opListPublicKeys,
  738. HTTPMethod: "POST",
  739. HTTPPath: "/",
  740. }
  741. if input == nil {
  742. input = &ListPublicKeysInput{}
  743. }
  744. output = &ListPublicKeysOutput{}
  745. req = c.newRequest(op, input, output)
  746. return
  747. }
  748. // ListPublicKeys API operation for AWS CloudTrail.
  749. //
  750. // Returns all public keys whose private keys were used to sign the digest files
  751. // within the specified time range. The public key is needed to validate digest
  752. // files that were signed with its corresponding private key.
  753. //
  754. // CloudTrail uses different private/public key pairs per region. Each digest
  755. // file is signed with a private key unique to its region. Therefore, when you
  756. // validate a digest file from a particular region, you must look in the same
  757. // region for its corresponding public key.
  758. //
  759. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  760. // with awserr.Error's Code and Message methods to get detailed information about
  761. // the error.
  762. //
  763. // See the AWS API reference guide for AWS CloudTrail's
  764. // API operation ListPublicKeys for usage and error information.
  765. //
  766. // Returned Error Codes:
  767. // * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException"
  768. // Occurs if the timestamp values are invalid. Either the start time occurs
  769. // after the end time or the time range is outside the range of possible values.
  770. //
  771. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  772. // This exception is thrown when the requested operation is not supported.
  773. //
  774. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  775. // This exception is thrown when the requested operation is not permitted.
  776. //
  777. // * ErrCodeInvalidTokenException "InvalidTokenException"
  778. // Reserved for future use.
  779. //
  780. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys
  781. func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) {
  782. req, out := c.ListPublicKeysRequest(input)
  783. return out, req.Send()
  784. }
  785. // ListPublicKeysWithContext is the same as ListPublicKeys with the addition of
  786. // the ability to pass a context and additional request options.
  787. //
  788. // See ListPublicKeys for details on how to use this API operation.
  789. //
  790. // The context must be non-nil and will be used for request cancellation. If
  791. // the context is nil a panic will occur. In the future the SDK may create
  792. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  793. // for more information on using Contexts.
  794. func (c *CloudTrail) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) {
  795. req, out := c.ListPublicKeysRequest(input)
  796. req.SetContext(ctx)
  797. req.ApplyOptions(opts...)
  798. return out, req.Send()
  799. }
  800. const opListTags = "ListTags"
  801. // ListTagsRequest generates a "aws/request.Request" representing the
  802. // client's request for the ListTags operation. The "output" return
  803. // value will be populated with the request's response once the request completes
  804. // successfully.
  805. //
  806. // Use "Send" method on the returned Request to send the API call to the service.
  807. // the "output" return value is not valid until after Send returns without error.
  808. //
  809. // See ListTags for more information on using the ListTags
  810. // API call, and error handling.
  811. //
  812. // This method is useful when you want to inject custom logic or configuration
  813. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  814. //
  815. //
  816. // // Example sending a request using the ListTagsRequest method.
  817. // req, resp := client.ListTagsRequest(params)
  818. //
  819. // err := req.Send()
  820. // if err == nil { // resp is now filled
  821. // fmt.Println(resp)
  822. // }
  823. //
  824. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags
  825. func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) {
  826. op := &request.Operation{
  827. Name: opListTags,
  828. HTTPMethod: "POST",
  829. HTTPPath: "/",
  830. }
  831. if input == nil {
  832. input = &ListTagsInput{}
  833. }
  834. output = &ListTagsOutput{}
  835. req = c.newRequest(op, input, output)
  836. return
  837. }
  838. // ListTags API operation for AWS CloudTrail.
  839. //
  840. // Lists the tags for the trail in the current region.
  841. //
  842. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  843. // with awserr.Error's Code and Message methods to get detailed information about
  844. // the error.
  845. //
  846. // See the AWS API reference guide for AWS CloudTrail's
  847. // API operation ListTags for usage and error information.
  848. //
  849. // Returned Error Codes:
  850. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  851. // This exception is thrown when the specified resource is not found.
  852. //
  853. // * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
  854. // This exception is thrown when an operation is called with an invalid trail
  855. // ARN. The format of a trail ARN is:
  856. //
  857. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  858. //
  859. // * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException"
  860. // This exception is thrown when the specified resource type is not supported
  861. // by CloudTrail.
  862. //
  863. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  864. // This exception is thrown when the provided trail name is not valid. Trail
  865. // names must meet the following requirements:
  866. //
  867. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  868. // (_), or dashes (-)
  869. //
  870. // * Start with a letter or number, and end with a letter or number
  871. //
  872. // * Be between 3 and 128 characters
  873. //
  874. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  875. // and my--namespace are invalid.
  876. //
  877. // * Not be in IP address format (for example, 192.168.5.4)
  878. //
  879. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  880. // This exception is thrown when the requested operation is not supported.
  881. //
  882. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  883. // This exception is thrown when the requested operation is not permitted.
  884. //
  885. // * ErrCodeInvalidTokenException "InvalidTokenException"
  886. // Reserved for future use.
  887. //
  888. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags
  889. func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) {
  890. req, out := c.ListTagsRequest(input)
  891. return out, req.Send()
  892. }
  893. // ListTagsWithContext is the same as ListTags with the addition of
  894. // the ability to pass a context and additional request options.
  895. //
  896. // See ListTags for details on how to use this API operation.
  897. //
  898. // The context must be non-nil and will be used for request cancellation. If
  899. // the context is nil a panic will occur. In the future the SDK may create
  900. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  901. // for more information on using Contexts.
  902. func (c *CloudTrail) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) {
  903. req, out := c.ListTagsRequest(input)
  904. req.SetContext(ctx)
  905. req.ApplyOptions(opts...)
  906. return out, req.Send()
  907. }
  908. const opLookupEvents = "LookupEvents"
  909. // LookupEventsRequest generates a "aws/request.Request" representing the
  910. // client's request for the LookupEvents operation. The "output" return
  911. // value will be populated with the request's response once the request completes
  912. // successfully.
  913. //
  914. // Use "Send" method on the returned Request to send the API call to the service.
  915. // the "output" return value is not valid until after Send returns without error.
  916. //
  917. // See LookupEvents for more information on using the LookupEvents
  918. // API call, and error handling.
  919. //
  920. // This method is useful when you want to inject custom logic or configuration
  921. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  922. //
  923. //
  924. // // Example sending a request using the LookupEventsRequest method.
  925. // req, resp := client.LookupEventsRequest(params)
  926. //
  927. // err := req.Send()
  928. // if err == nil { // resp is now filled
  929. // fmt.Println(resp)
  930. // }
  931. //
  932. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents
  933. func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) {
  934. op := &request.Operation{
  935. Name: opLookupEvents,
  936. HTTPMethod: "POST",
  937. HTTPPath: "/",
  938. Paginator: &request.Paginator{
  939. InputTokens: []string{"NextToken"},
  940. OutputTokens: []string{"NextToken"},
  941. LimitToken: "MaxResults",
  942. TruncationToken: "",
  943. },
  944. }
  945. if input == nil {
  946. input = &LookupEventsInput{}
  947. }
  948. output = &LookupEventsOutput{}
  949. req = c.newRequest(op, input, output)
  950. return
  951. }
  952. // LookupEvents API operation for AWS CloudTrail.
  953. //
  954. // Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events)
  955. // captured by CloudTrail. Events for a region can be looked up in that region
  956. // during the last 90 days. Lookup supports the following attributes:
  957. //
  958. // * AWS access key
  959. //
  960. // * Event ID
  961. //
  962. // * Event name
  963. //
  964. // * Event source
  965. //
  966. // * Read only
  967. //
  968. // * Resource name
  969. //
  970. // * Resource type
  971. //
  972. // * User name
  973. //
  974. // All attributes are optional. The default number of results returned is 50,
  975. // with a maximum of 50 possible. The response includes a token that you can
  976. // use to get the next page of results.
  977. //
  978. // The rate of lookup requests is limited to one per second per account. If
  979. // this limit is exceeded, a throttling error occurs.
  980. //
  981. // Events that occurred during the selected time range will not be available
  982. // for lookup if CloudTrail logging was not enabled when the events occurred.
  983. //
  984. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  985. // with awserr.Error's Code and Message methods to get detailed information about
  986. // the error.
  987. //
  988. // See the AWS API reference guide for AWS CloudTrail's
  989. // API operation LookupEvents for usage and error information.
  990. //
  991. // Returned Error Codes:
  992. // * ErrCodeInvalidLookupAttributesException "InvalidLookupAttributesException"
  993. // Occurs when an invalid lookup attribute is specified.
  994. //
  995. // * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException"
  996. // Occurs if the timestamp values are invalid. Either the start time occurs
  997. // after the end time or the time range is outside the range of possible values.
  998. //
  999. // * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException"
  1000. // This exception is thrown if the limit specified is invalid.
  1001. //
  1002. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  1003. // Invalid token or token that was previously used in a request with different
  1004. // parameters. This exception is thrown if the token is invalid.
  1005. //
  1006. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents
  1007. func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) {
  1008. req, out := c.LookupEventsRequest(input)
  1009. return out, req.Send()
  1010. }
  1011. // LookupEventsWithContext is the same as LookupEvents with the addition of
  1012. // the ability to pass a context and additional request options.
  1013. //
  1014. // See LookupEvents for details on how to use this API operation.
  1015. //
  1016. // The context must be non-nil and will be used for request cancellation. If
  1017. // the context is nil a panic will occur. In the future the SDK may create
  1018. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1019. // for more information on using Contexts.
  1020. func (c *CloudTrail) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) {
  1021. req, out := c.LookupEventsRequest(input)
  1022. req.SetContext(ctx)
  1023. req.ApplyOptions(opts...)
  1024. return out, req.Send()
  1025. }
  1026. // LookupEventsPages iterates over the pages of a LookupEvents operation,
  1027. // calling the "fn" function with the response data for each page. To stop
  1028. // iterating, return false from the fn function.
  1029. //
  1030. // See LookupEvents method for more information on how to use this operation.
  1031. //
  1032. // Note: This operation can generate multiple requests to a service.
  1033. //
  1034. // // Example iterating over at most 3 pages of a LookupEvents operation.
  1035. // pageNum := 0
  1036. // err := client.LookupEventsPages(params,
  1037. // func(page *LookupEventsOutput, lastPage bool) bool {
  1038. // pageNum++
  1039. // fmt.Println(page)
  1040. // return pageNum <= 3
  1041. // })
  1042. //
  1043. func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error {
  1044. return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn)
  1045. }
  1046. // LookupEventsPagesWithContext same as LookupEventsPages except
  1047. // it takes a Context and allows setting request options on the pages.
  1048. //
  1049. // The context must be non-nil and will be used for request cancellation. If
  1050. // the context is nil a panic will occur. In the future the SDK may create
  1051. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1052. // for more information on using Contexts.
  1053. func (c *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...request.Option) error {
  1054. p := request.Pagination{
  1055. NewRequest: func() (*request.Request, error) {
  1056. var inCpy *LookupEventsInput
  1057. if input != nil {
  1058. tmp := *input
  1059. inCpy = &tmp
  1060. }
  1061. req, _ := c.LookupEventsRequest(inCpy)
  1062. req.SetContext(ctx)
  1063. req.ApplyOptions(opts...)
  1064. return req, nil
  1065. },
  1066. }
  1067. cont := true
  1068. for p.Next() && cont {
  1069. cont = fn(p.Page().(*LookupEventsOutput), !p.HasNextPage())
  1070. }
  1071. return p.Err()
  1072. }
  1073. const opPutEventSelectors = "PutEventSelectors"
  1074. // PutEventSelectorsRequest generates a "aws/request.Request" representing the
  1075. // client's request for the PutEventSelectors operation. The "output" return
  1076. // value will be populated with the request's response once the request completes
  1077. // successfully.
  1078. //
  1079. // Use "Send" method on the returned Request to send the API call to the service.
  1080. // the "output" return value is not valid until after Send returns without error.
  1081. //
  1082. // See PutEventSelectors for more information on using the PutEventSelectors
  1083. // API call, and error handling.
  1084. //
  1085. // This method is useful when you want to inject custom logic or configuration
  1086. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1087. //
  1088. //
  1089. // // Example sending a request using the PutEventSelectorsRequest method.
  1090. // req, resp := client.PutEventSelectorsRequest(params)
  1091. //
  1092. // err := req.Send()
  1093. // if err == nil { // resp is now filled
  1094. // fmt.Println(resp)
  1095. // }
  1096. //
  1097. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors
  1098. func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (req *request.Request, output *PutEventSelectorsOutput) {
  1099. op := &request.Operation{
  1100. Name: opPutEventSelectors,
  1101. HTTPMethod: "POST",
  1102. HTTPPath: "/",
  1103. }
  1104. if input == nil {
  1105. input = &PutEventSelectorsInput{}
  1106. }
  1107. output = &PutEventSelectorsOutput{}
  1108. req = c.newRequest(op, input, output)
  1109. return
  1110. }
  1111. // PutEventSelectors API operation for AWS CloudTrail.
  1112. //
  1113. // Configures an event selector for your trail. Use event selectors to further
  1114. // specify the management and data event settings for your trail. By default,
  1115. // trails created without specific event selectors will be configured to log
  1116. // all read and write management events, and no data events.
  1117. //
  1118. // When an event occurs in your account, CloudTrail evaluates the event selectors
  1119. // in all trails. For each trail, if the event matches any event selector, the
  1120. // trail processes and logs the event. If the event doesn't match any event
  1121. // selector, the trail doesn't log the event.
  1122. //
  1123. // Example
  1124. //
  1125. // You create an event selector for a trail and specify that you want write-only
  1126. // events.
  1127. //
  1128. // The EC2 GetConsoleOutput and RunInstances API operations occur in your account.
  1129. //
  1130. // CloudTrail evaluates whether the events match your event selectors.
  1131. //
  1132. // The RunInstances is a write-only event and it matches your event selector.
  1133. // The trail logs the event.
  1134. //
  1135. // The GetConsoleOutput is a read-only event but it doesn't match your event
  1136. // selector. The trail doesn't log the event.
  1137. //
  1138. // The PutEventSelectors operation must be called from the region in which the
  1139. // trail was created; otherwise, an InvalidHomeRegionException is thrown.
  1140. //
  1141. // You can configure up to five event selectors for each trail. For more information,
  1142. // see Logging Data and Management Events for Trails (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html)
  1143. // and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html)
  1144. // in the AWS CloudTrail User Guide.
  1145. //
  1146. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1147. // with awserr.Error's Code and Message methods to get detailed information about
  1148. // the error.
  1149. //
  1150. // See the AWS API reference guide for AWS CloudTrail's
  1151. // API operation PutEventSelectors for usage and error information.
  1152. //
  1153. // Returned Error Codes:
  1154. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  1155. // This exception is thrown when the trail with the given name is not found.
  1156. //
  1157. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  1158. // This exception is thrown when the provided trail name is not valid. Trail
  1159. // names must meet the following requirements:
  1160. //
  1161. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1162. // (_), or dashes (-)
  1163. //
  1164. // * Start with a letter or number, and end with a letter or number
  1165. //
  1166. // * Be between 3 and 128 characters
  1167. //
  1168. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1169. // and my--namespace are invalid.
  1170. //
  1171. // * Not be in IP address format (for example, 192.168.5.4)
  1172. //
  1173. // * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException"
  1174. // This exception is thrown when an operation is called on a trail from a region
  1175. // other than the region in which the trail was created.
  1176. //
  1177. // * ErrCodeInvalidEventSelectorsException "InvalidEventSelectorsException"
  1178. // This exception is thrown when the PutEventSelectors operation is called with
  1179. // a number of event selectors or data resources that is not valid. The combination
  1180. // of event selectors and data resources is not valid. A trail can have up to
  1181. // 5 event selectors. A trail is limited to 250 data resources. These data resources
  1182. // can be distributed across event selectors, but the overall total cannot exceed
  1183. // 250.
  1184. //
  1185. // You can:
  1186. //
  1187. // * Specify a valid number of event selectors (1 to 5) for a trail.
  1188. //
  1189. // * Specify a valid number of data resources (1 to 250) for an event selector.
  1190. // The limit of number of resources on an individual event selector is configurable
  1191. // up to 250. However, this upper limit is allowed only if the total number
  1192. // of data resources does not exceed 250 across all event selectors for a
  1193. // trail.
  1194. //
  1195. // * Specify a valid value for a parameter. For example, specifying the ReadWriteType
  1196. // parameter with a value of read-only is invalid.
  1197. //
  1198. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  1199. // This exception is thrown when the requested operation is not supported.
  1200. //
  1201. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  1202. // This exception is thrown when the requested operation is not permitted.
  1203. //
  1204. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  1205. // This exception is thrown when the AWS account making the request to create
  1206. // or update an organization trail is not the master account for an organization
  1207. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  1208. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1209. //
  1210. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  1211. // This exception is thrown when the IAM user or role that is used to create
  1212. // the organization trail is lacking one or more required permissions for creating
  1213. // an organization trail in a required service. For more information, see Prepare
  1214. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1215. //
  1216. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors
  1217. func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) {
  1218. req, out := c.PutEventSelectorsRequest(input)
  1219. return out, req.Send()
  1220. }
  1221. // PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of
  1222. // the ability to pass a context and additional request options.
  1223. //
  1224. // See PutEventSelectors for details on how to use this API operation.
  1225. //
  1226. // The context must be non-nil and will be used for request cancellation. If
  1227. // the context is nil a panic will occur. In the future the SDK may create
  1228. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1229. // for more information on using Contexts.
  1230. func (c *CloudTrail) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) {
  1231. req, out := c.PutEventSelectorsRequest(input)
  1232. req.SetContext(ctx)
  1233. req.ApplyOptions(opts...)
  1234. return out, req.Send()
  1235. }
  1236. const opRemoveTags = "RemoveTags"
  1237. // RemoveTagsRequest generates a "aws/request.Request" representing the
  1238. // client's request for the RemoveTags operation. The "output" return
  1239. // value will be populated with the request's response once the request completes
  1240. // successfully.
  1241. //
  1242. // Use "Send" method on the returned Request to send the API call to the service.
  1243. // the "output" return value is not valid until after Send returns without error.
  1244. //
  1245. // See RemoveTags for more information on using the RemoveTags
  1246. // API call, and error handling.
  1247. //
  1248. // This method is useful when you want to inject custom logic or configuration
  1249. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1250. //
  1251. //
  1252. // // Example sending a request using the RemoveTagsRequest method.
  1253. // req, resp := client.RemoveTagsRequest(params)
  1254. //
  1255. // err := req.Send()
  1256. // if err == nil { // resp is now filled
  1257. // fmt.Println(resp)
  1258. // }
  1259. //
  1260. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags
  1261. func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) {
  1262. op := &request.Operation{
  1263. Name: opRemoveTags,
  1264. HTTPMethod: "POST",
  1265. HTTPPath: "/",
  1266. }
  1267. if input == nil {
  1268. input = &RemoveTagsInput{}
  1269. }
  1270. output = &RemoveTagsOutput{}
  1271. req = c.newRequest(op, input, output)
  1272. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1273. return
  1274. }
  1275. // RemoveTags API operation for AWS CloudTrail.
  1276. //
  1277. // Removes the specified tags from a trail.
  1278. //
  1279. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1280. // with awserr.Error's Code and Message methods to get detailed information about
  1281. // the error.
  1282. //
  1283. // See the AWS API reference guide for AWS CloudTrail's
  1284. // API operation RemoveTags for usage and error information.
  1285. //
  1286. // Returned Error Codes:
  1287. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  1288. // This exception is thrown when the specified resource is not found.
  1289. //
  1290. // * ErrCodeARNInvalidException "CloudTrailARNInvalidException"
  1291. // This exception is thrown when an operation is called with an invalid trail
  1292. // ARN. The format of a trail ARN is:
  1293. //
  1294. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  1295. //
  1296. // * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException"
  1297. // This exception is thrown when the specified resource type is not supported
  1298. // by CloudTrail.
  1299. //
  1300. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  1301. // This exception is thrown when the provided trail name is not valid. Trail
  1302. // names must meet the following requirements:
  1303. //
  1304. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1305. // (_), or dashes (-)
  1306. //
  1307. // * Start with a letter or number, and end with a letter or number
  1308. //
  1309. // * Be between 3 and 128 characters
  1310. //
  1311. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1312. // and my--namespace are invalid.
  1313. //
  1314. // * Not be in IP address format (for example, 192.168.5.4)
  1315. //
  1316. // * ErrCodeInvalidTagParameterException "InvalidTagParameterException"
  1317. // This exception is thrown when the key or value specified for the tag does
  1318. // not match the regular expression ^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$.
  1319. //
  1320. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  1321. // This exception is thrown when the requested operation is not supported.
  1322. //
  1323. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  1324. // This exception is thrown when the requested operation is not permitted.
  1325. //
  1326. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  1327. // This exception is thrown when the AWS account making the request to create
  1328. // or update an organization trail is not the master account for an organization
  1329. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  1330. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1331. //
  1332. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags
  1333. func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) {
  1334. req, out := c.RemoveTagsRequest(input)
  1335. return out, req.Send()
  1336. }
  1337. // RemoveTagsWithContext is the same as RemoveTags with the addition of
  1338. // the ability to pass a context and additional request options.
  1339. //
  1340. // See RemoveTags for details on how to use this API operation.
  1341. //
  1342. // The context must be non-nil and will be used for request cancellation. If
  1343. // the context is nil a panic will occur. In the future the SDK may create
  1344. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1345. // for more information on using Contexts.
  1346. func (c *CloudTrail) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) {
  1347. req, out := c.RemoveTagsRequest(input)
  1348. req.SetContext(ctx)
  1349. req.ApplyOptions(opts...)
  1350. return out, req.Send()
  1351. }
  1352. const opStartLogging = "StartLogging"
  1353. // StartLoggingRequest generates a "aws/request.Request" representing the
  1354. // client's request for the StartLogging operation. The "output" return
  1355. // value will be populated with the request's response once the request completes
  1356. // successfully.
  1357. //
  1358. // Use "Send" method on the returned Request to send the API call to the service.
  1359. // the "output" return value is not valid until after Send returns without error.
  1360. //
  1361. // See StartLogging for more information on using the StartLogging
  1362. // API call, and error handling.
  1363. //
  1364. // This method is useful when you want to inject custom logic or configuration
  1365. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1366. //
  1367. //
  1368. // // Example sending a request using the StartLoggingRequest method.
  1369. // req, resp := client.StartLoggingRequest(params)
  1370. //
  1371. // err := req.Send()
  1372. // if err == nil { // resp is now filled
  1373. // fmt.Println(resp)
  1374. // }
  1375. //
  1376. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging
  1377. func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) {
  1378. op := &request.Operation{
  1379. Name: opStartLogging,
  1380. HTTPMethod: "POST",
  1381. HTTPPath: "/",
  1382. }
  1383. if input == nil {
  1384. input = &StartLoggingInput{}
  1385. }
  1386. output = &StartLoggingOutput{}
  1387. req = c.newRequest(op, input, output)
  1388. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1389. return
  1390. }
  1391. // StartLogging API operation for AWS CloudTrail.
  1392. //
  1393. // Starts the recording of AWS API calls and log file delivery for a trail.
  1394. // For a trail that is enabled in all regions, this operation must be called
  1395. // from the region in which the trail was created. This operation cannot be
  1396. // called on the shadow trails (replicated trails in other regions) of a trail
  1397. // that is enabled in all regions.
  1398. //
  1399. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1400. // with awserr.Error's Code and Message methods to get detailed information about
  1401. // the error.
  1402. //
  1403. // See the AWS API reference guide for AWS CloudTrail's
  1404. // API operation StartLogging for usage and error information.
  1405. //
  1406. // Returned Error Codes:
  1407. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  1408. // This exception is thrown when the trail with the given name is not found.
  1409. //
  1410. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  1411. // This exception is thrown when the provided trail name is not valid. Trail
  1412. // names must meet the following requirements:
  1413. //
  1414. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1415. // (_), or dashes (-)
  1416. //
  1417. // * Start with a letter or number, and end with a letter or number
  1418. //
  1419. // * Be between 3 and 128 characters
  1420. //
  1421. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1422. // and my--namespace are invalid.
  1423. //
  1424. // * Not be in IP address format (for example, 192.168.5.4)
  1425. //
  1426. // * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException"
  1427. // This exception is thrown when an operation is called on a trail from a region
  1428. // other than the region in which the trail was created.
  1429. //
  1430. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  1431. // This exception is thrown when the requested operation is not supported.
  1432. //
  1433. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  1434. // This exception is thrown when the requested operation is not permitted.
  1435. //
  1436. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  1437. // This exception is thrown when the AWS account making the request to create
  1438. // or update an organization trail is not the master account for an organization
  1439. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  1440. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1441. //
  1442. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  1443. // This exception is thrown when the IAM user or role that is used to create
  1444. // the organization trail is lacking one or more required permissions for creating
  1445. // an organization trail in a required service. For more information, see Prepare
  1446. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1447. //
  1448. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging
  1449. func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) {
  1450. req, out := c.StartLoggingRequest(input)
  1451. return out, req.Send()
  1452. }
  1453. // StartLoggingWithContext is the same as StartLogging with the addition of
  1454. // the ability to pass a context and additional request options.
  1455. //
  1456. // See StartLogging for details on how to use this API operation.
  1457. //
  1458. // The context must be non-nil and will be used for request cancellation. If
  1459. // the context is nil a panic will occur. In the future the SDK may create
  1460. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1461. // for more information on using Contexts.
  1462. func (c *CloudTrail) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) {
  1463. req, out := c.StartLoggingRequest(input)
  1464. req.SetContext(ctx)
  1465. req.ApplyOptions(opts...)
  1466. return out, req.Send()
  1467. }
  1468. const opStopLogging = "StopLogging"
  1469. // StopLoggingRequest generates a "aws/request.Request" representing the
  1470. // client's request for the StopLogging operation. The "output" return
  1471. // value will be populated with the request's response once the request completes
  1472. // successfully.
  1473. //
  1474. // Use "Send" method on the returned Request to send the API call to the service.
  1475. // the "output" return value is not valid until after Send returns without error.
  1476. //
  1477. // See StopLogging for more information on using the StopLogging
  1478. // API call, and error handling.
  1479. //
  1480. // This method is useful when you want to inject custom logic or configuration
  1481. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1482. //
  1483. //
  1484. // // Example sending a request using the StopLoggingRequest method.
  1485. // req, resp := client.StopLoggingRequest(params)
  1486. //
  1487. // err := req.Send()
  1488. // if err == nil { // resp is now filled
  1489. // fmt.Println(resp)
  1490. // }
  1491. //
  1492. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging
  1493. func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) {
  1494. op := &request.Operation{
  1495. Name: opStopLogging,
  1496. HTTPMethod: "POST",
  1497. HTTPPath: "/",
  1498. }
  1499. if input == nil {
  1500. input = &StopLoggingInput{}
  1501. }
  1502. output = &StopLoggingOutput{}
  1503. req = c.newRequest(op, input, output)
  1504. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1505. return
  1506. }
  1507. // StopLogging API operation for AWS CloudTrail.
  1508. //
  1509. // Suspends the recording of AWS API calls and log file delivery for the specified
  1510. // trail. Under most circumstances, there is no need to use this action. You
  1511. // can update a trail without stopping it first. This action is the only way
  1512. // to stop recording. For a trail enabled in all regions, this operation must
  1513. // be called from the region in which the trail was created, or an InvalidHomeRegionException
  1514. // will occur. This operation cannot be called on the shadow trails (replicated
  1515. // trails in other regions) of a trail enabled in all regions.
  1516. //
  1517. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1518. // with awserr.Error's Code and Message methods to get detailed information about
  1519. // the error.
  1520. //
  1521. // See the AWS API reference guide for AWS CloudTrail's
  1522. // API operation StopLogging for usage and error information.
  1523. //
  1524. // Returned Error Codes:
  1525. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  1526. // This exception is thrown when the trail with the given name is not found.
  1527. //
  1528. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  1529. // This exception is thrown when the provided trail name is not valid. Trail
  1530. // names must meet the following requirements:
  1531. //
  1532. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1533. // (_), or dashes (-)
  1534. //
  1535. // * Start with a letter or number, and end with a letter or number
  1536. //
  1537. // * Be between 3 and 128 characters
  1538. //
  1539. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1540. // and my--namespace are invalid.
  1541. //
  1542. // * Not be in IP address format (for example, 192.168.5.4)
  1543. //
  1544. // * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException"
  1545. // This exception is thrown when an operation is called on a trail from a region
  1546. // other than the region in which the trail was created.
  1547. //
  1548. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  1549. // This exception is thrown when the requested operation is not supported.
  1550. //
  1551. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  1552. // This exception is thrown when the requested operation is not permitted.
  1553. //
  1554. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  1555. // This exception is thrown when the AWS account making the request to create
  1556. // or update an organization trail is not the master account for an organization
  1557. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  1558. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1559. //
  1560. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  1561. // This exception is thrown when the IAM user or role that is used to create
  1562. // the organization trail is lacking one or more required permissions for creating
  1563. // an organization trail in a required service. For more information, see Prepare
  1564. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1565. //
  1566. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging
  1567. func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) {
  1568. req, out := c.StopLoggingRequest(input)
  1569. return out, req.Send()
  1570. }
  1571. // StopLoggingWithContext is the same as StopLogging with the addition of
  1572. // the ability to pass a context and additional request options.
  1573. //
  1574. // See StopLogging for details on how to use this API operation.
  1575. //
  1576. // The context must be non-nil and will be used for request cancellation. If
  1577. // the context is nil a panic will occur. In the future the SDK may create
  1578. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1579. // for more information on using Contexts.
  1580. func (c *CloudTrail) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) {
  1581. req, out := c.StopLoggingRequest(input)
  1582. req.SetContext(ctx)
  1583. req.ApplyOptions(opts...)
  1584. return out, req.Send()
  1585. }
  1586. const opUpdateTrail = "UpdateTrail"
  1587. // UpdateTrailRequest generates a "aws/request.Request" representing the
  1588. // client's request for the UpdateTrail operation. The "output" return
  1589. // value will be populated with the request's response once the request completes
  1590. // successfully.
  1591. //
  1592. // Use "Send" method on the returned Request to send the API call to the service.
  1593. // the "output" return value is not valid until after Send returns without error.
  1594. //
  1595. // See UpdateTrail for more information on using the UpdateTrail
  1596. // API call, and error handling.
  1597. //
  1598. // This method is useful when you want to inject custom logic or configuration
  1599. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1600. //
  1601. //
  1602. // // Example sending a request using the UpdateTrailRequest method.
  1603. // req, resp := client.UpdateTrailRequest(params)
  1604. //
  1605. // err := req.Send()
  1606. // if err == nil { // resp is now filled
  1607. // fmt.Println(resp)
  1608. // }
  1609. //
  1610. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail
  1611. func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) {
  1612. op := &request.Operation{
  1613. Name: opUpdateTrail,
  1614. HTTPMethod: "POST",
  1615. HTTPPath: "/",
  1616. }
  1617. if input == nil {
  1618. input = &UpdateTrailInput{}
  1619. }
  1620. output = &UpdateTrailOutput{}
  1621. req = c.newRequest(op, input, output)
  1622. return
  1623. }
  1624. // UpdateTrail API operation for AWS CloudTrail.
  1625. //
  1626. // Updates the settings that specify delivery of log files. Changes to a trail
  1627. // do not require stopping the CloudTrail service. Use this action to designate
  1628. // an existing bucket for log delivery. If the existing bucket has previously
  1629. // been a target for CloudTrail log files, an IAM policy exists for the bucket.
  1630. // UpdateTrail must be called from the region in which the trail was created;
  1631. // otherwise, an InvalidHomeRegionException is thrown.
  1632. //
  1633. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1634. // with awserr.Error's Code and Message methods to get detailed information about
  1635. // the error.
  1636. //
  1637. // See the AWS API reference guide for AWS CloudTrail's
  1638. // API operation UpdateTrail for usage and error information.
  1639. //
  1640. // Returned Error Codes:
  1641. // * ErrCodeS3BucketDoesNotExistException "S3BucketDoesNotExistException"
  1642. // This exception is thrown when the specified S3 bucket does not exist.
  1643. //
  1644. // * ErrCodeInsufficientS3BucketPolicyException "InsufficientS3BucketPolicyException"
  1645. // This exception is thrown when the policy on the S3 bucket is not sufficient.
  1646. //
  1647. // * ErrCodeInsufficientSnsTopicPolicyException "InsufficientSnsTopicPolicyException"
  1648. // This exception is thrown when the policy on the SNS topic is not sufficient.
  1649. //
  1650. // * ErrCodeInsufficientEncryptionPolicyException "InsufficientEncryptionPolicyException"
  1651. // This exception is thrown when the policy on the S3 bucket or KMS key is not
  1652. // sufficient.
  1653. //
  1654. // * ErrCodeTrailNotFoundException "TrailNotFoundException"
  1655. // This exception is thrown when the trail with the given name is not found.
  1656. //
  1657. // * ErrCodeInvalidS3BucketNameException "InvalidS3BucketNameException"
  1658. // This exception is thrown when the provided S3 bucket name is not valid.
  1659. //
  1660. // * ErrCodeInvalidS3PrefixException "InvalidS3PrefixException"
  1661. // This exception is thrown when the provided S3 prefix is not valid.
  1662. //
  1663. // * ErrCodeInvalidSnsTopicNameException "InvalidSnsTopicNameException"
  1664. // This exception is thrown when the provided SNS topic name is not valid.
  1665. //
  1666. // * ErrCodeInvalidKmsKeyIdException "InvalidKmsKeyIdException"
  1667. // This exception is thrown when the KMS key ARN is invalid.
  1668. //
  1669. // * ErrCodeInvalidTrailNameException "InvalidTrailNameException"
  1670. // This exception is thrown when the provided trail name is not valid. Trail
  1671. // names must meet the following requirements:
  1672. //
  1673. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1674. // (_), or dashes (-)
  1675. //
  1676. // * Start with a letter or number, and end with a letter or number
  1677. //
  1678. // * Be between 3 and 128 characters
  1679. //
  1680. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1681. // and my--namespace are invalid.
  1682. //
  1683. // * Not be in IP address format (for example, 192.168.5.4)
  1684. //
  1685. // * ErrCodeTrailNotProvidedException "TrailNotProvidedException"
  1686. // This exception is deprecated.
  1687. //
  1688. // * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException"
  1689. // This exception is thrown when the combination of parameters provided is not
  1690. // valid.
  1691. //
  1692. // * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException"
  1693. // This exception is thrown when an operation is called on a trail from a region
  1694. // other than the region in which the trail was created.
  1695. //
  1696. // * ErrCodeKmsKeyNotFoundException "KmsKeyNotFoundException"
  1697. // This exception is thrown when the KMS key does not exist, or when the S3
  1698. // bucket and the KMS key are not in the same region.
  1699. //
  1700. // * ErrCodeKmsKeyDisabledException "KmsKeyDisabledException"
  1701. // This exception is deprecated.
  1702. //
  1703. // * ErrCodeKmsException "KmsException"
  1704. // This exception is thrown when there is an issue with the specified KMS key
  1705. // and the trail can’t be updated.
  1706. //
  1707. // * ErrCodeInvalidCloudWatchLogsLogGroupArnException "InvalidCloudWatchLogsLogGroupArnException"
  1708. // This exception is thrown when the provided CloudWatch log group is not valid.
  1709. //
  1710. // * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException"
  1711. // This exception is thrown when the provided role is not valid.
  1712. //
  1713. // * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException"
  1714. // Cannot set a CloudWatch Logs delivery for this region.
  1715. //
  1716. // * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
  1717. // This exception is thrown when the requested operation is not supported.
  1718. //
  1719. // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
  1720. // This exception is thrown when the requested operation is not permitted.
  1721. //
  1722. // * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException"
  1723. // This exception is thrown when trusted access has not been enabled between
  1724. // AWS CloudTrail and AWS Organizations. For more information, see Enabling
  1725. // Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)
  1726. // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1727. //
  1728. // * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
  1729. // This exception is thrown when the IAM user or role that is used to create
  1730. // the organization trail is lacking one or more required permissions for creating
  1731. // an organization trail in a required service. For more information, see Prepare
  1732. // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1733. //
  1734. // * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException"
  1735. // This exception is thrown when the request is made from an AWS account that
  1736. // is not a member of an organization. To make this request, sign in using the
  1737. // credentials of an account that belongs to an organization.
  1738. //
  1739. // * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
  1740. // This exception is thrown when the AWS account making the request to create
  1741. // or update an organization trail is not the master account for an organization
  1742. // in AWS Organizations. For more information, see Prepare For Creating a Trail
  1743. // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1744. //
  1745. // * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException"
  1746. // This exception is thrown when AWS Organizations is not configured to support
  1747. // all features. All features must be enabled in AWS Organization to support
  1748. // creating an organization trail. For more information, see Prepare For Creating
  1749. // a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
  1750. //
  1751. // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail
  1752. func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) {
  1753. req, out := c.UpdateTrailRequest(input)
  1754. return out, req.Send()
  1755. }
  1756. // UpdateTrailWithContext is the same as UpdateTrail with the addition of
  1757. // the ability to pass a context and additional request options.
  1758. //
  1759. // See UpdateTrail for details on how to use this API operation.
  1760. //
  1761. // The context must be non-nil and will be used for request cancellation. If
  1762. // the context is nil a panic will occur. In the future the SDK may create
  1763. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1764. // for more information on using Contexts.
  1765. func (c *CloudTrail) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) {
  1766. req, out := c.UpdateTrailRequest(input)
  1767. req.SetContext(ctx)
  1768. req.ApplyOptions(opts...)
  1769. return out, req.Send()
  1770. }
  1771. // Specifies the tags to add to a trail.
  1772. type AddTagsInput struct {
  1773. _ struct{} `type:"structure"`
  1774. // Specifies the ARN of the trail to which one or more tags will be added. The
  1775. // format of a trail ARN is:
  1776. //
  1777. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  1778. //
  1779. // ResourceId is a required field
  1780. ResourceId *string `type:"string" required:"true"`
  1781. // Contains a list of CloudTrail tags, up to a limit of 50
  1782. TagsList []*Tag `type:"list"`
  1783. }
  1784. // String returns the string representation
  1785. func (s AddTagsInput) String() string {
  1786. return awsutil.Prettify(s)
  1787. }
  1788. // GoString returns the string representation
  1789. func (s AddTagsInput) GoString() string {
  1790. return s.String()
  1791. }
  1792. // Validate inspects the fields of the type to determine if they are valid.
  1793. func (s *AddTagsInput) Validate() error {
  1794. invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"}
  1795. if s.ResourceId == nil {
  1796. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  1797. }
  1798. if s.TagsList != nil {
  1799. for i, v := range s.TagsList {
  1800. if v == nil {
  1801. continue
  1802. }
  1803. if err := v.Validate(); err != nil {
  1804. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
  1805. }
  1806. }
  1807. }
  1808. if invalidParams.Len() > 0 {
  1809. return invalidParams
  1810. }
  1811. return nil
  1812. }
  1813. // SetResourceId sets the ResourceId field's value.
  1814. func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput {
  1815. s.ResourceId = &v
  1816. return s
  1817. }
  1818. // SetTagsList sets the TagsList field's value.
  1819. func (s *AddTagsInput) SetTagsList(v []*Tag) *AddTagsInput {
  1820. s.TagsList = v
  1821. return s
  1822. }
  1823. // Returns the objects or data listed below if successful. Otherwise, returns
  1824. // an error.
  1825. type AddTagsOutput struct {
  1826. _ struct{} `type:"structure"`
  1827. }
  1828. // String returns the string representation
  1829. func (s AddTagsOutput) String() string {
  1830. return awsutil.Prettify(s)
  1831. }
  1832. // GoString returns the string representation
  1833. func (s AddTagsOutput) GoString() string {
  1834. return s.String()
  1835. }
  1836. // Specifies the settings for each trail.
  1837. type CreateTrailInput struct {
  1838. _ struct{} `type:"structure"`
  1839. // Specifies a log group name using an Amazon Resource Name (ARN), a unique
  1840. // identifier that represents the log group to which CloudTrail logs will be
  1841. // delivered. Not required unless you specify CloudWatchLogsRoleArn.
  1842. CloudWatchLogsLogGroupArn *string `type:"string"`
  1843. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  1844. // a user's log group.
  1845. CloudWatchLogsRoleArn *string `type:"string"`
  1846. // Specifies whether log file integrity validation is enabled. The default is
  1847. // false.
  1848. //
  1849. // When you disable log file integrity validation, the chain of digest files
  1850. // is broken after one hour. CloudTrail will not create digest files for log
  1851. // files that were delivered during a period in which log file integrity validation
  1852. // was disabled. For example, if you enable log file integrity validation at
  1853. // noon on January 1, disable it at noon on January 2, and re-enable it at noon
  1854. // on January 10, digest files will not be created for the log files delivered
  1855. // from noon on January 2 to noon on January 10. The same applies whenever you
  1856. // stop CloudTrail logging or delete a trail.
  1857. EnableLogFileValidation *bool `type:"boolean"`
  1858. // Specifies whether the trail is publishing events from global services such
  1859. // as IAM to the log files.
  1860. IncludeGlobalServiceEvents *bool `type:"boolean"`
  1861. // Specifies whether the trail is created in the current region or in all regions.
  1862. // The default is false.
  1863. IsMultiRegionTrail *bool `type:"boolean"`
  1864. // Specifies whether the trail is created for all accounts in an organization
  1865. // in AWS Organizations, or only for the current AWS account. The default is
  1866. // false, and cannot be true unless the call is made on behalf of an AWS account
  1867. // that is the master account for an organization in AWS Organizations.
  1868. IsOrganizationTrail *bool `type:"boolean"`
  1869. // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
  1870. // The value can be an alias name prefixed by "alias/", a fully specified ARN
  1871. // to an alias, a fully specified ARN to a key, or a globally unique identifier.
  1872. //
  1873. // Examples:
  1874. //
  1875. // * alias/MyAliasName
  1876. //
  1877. // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
  1878. //
  1879. // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  1880. //
  1881. // * 12345678-1234-1234-1234-123456789012
  1882. KmsKeyId *string `type:"string"`
  1883. // Specifies the name of the trail. The name must meet the following requirements:
  1884. //
  1885. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  1886. // (_), or dashes (-)
  1887. //
  1888. // * Start with a letter or number, and end with a letter or number
  1889. //
  1890. // * Be between 3 and 128 characters
  1891. //
  1892. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  1893. // and my--namespace are invalid.
  1894. //
  1895. // * Not be in IP address format (for example, 192.168.5.4)
  1896. //
  1897. // Name is a required field
  1898. Name *string `type:"string" required:"true"`
  1899. // Specifies the name of the Amazon S3 bucket designated for publishing log
  1900. // files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
  1901. //
  1902. // S3BucketName is a required field
  1903. S3BucketName *string `type:"string" required:"true"`
  1904. // Specifies the Amazon S3 key prefix that comes after the name of the bucket
  1905. // you have designated for log file delivery. For more information, see Finding
  1906. // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
  1907. // The maximum length is 200 characters.
  1908. S3KeyPrefix *string `type:"string"`
  1909. // Specifies the name of the Amazon SNS topic defined for notification of log
  1910. // file delivery. The maximum length is 256 characters.
  1911. SnsTopicName *string `type:"string"`
  1912. }
  1913. // String returns the string representation
  1914. func (s CreateTrailInput) String() string {
  1915. return awsutil.Prettify(s)
  1916. }
  1917. // GoString returns the string representation
  1918. func (s CreateTrailInput) GoString() string {
  1919. return s.String()
  1920. }
  1921. // Validate inspects the fields of the type to determine if they are valid.
  1922. func (s *CreateTrailInput) Validate() error {
  1923. invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"}
  1924. if s.Name == nil {
  1925. invalidParams.Add(request.NewErrParamRequired("Name"))
  1926. }
  1927. if s.S3BucketName == nil {
  1928. invalidParams.Add(request.NewErrParamRequired("S3BucketName"))
  1929. }
  1930. if invalidParams.Len() > 0 {
  1931. return invalidParams
  1932. }
  1933. return nil
  1934. }
  1935. // SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value.
  1936. func (s *CreateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailInput {
  1937. s.CloudWatchLogsLogGroupArn = &v
  1938. return s
  1939. }
  1940. // SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
  1941. func (s *CreateTrailInput) SetCloudWatchLogsRoleArn(v string) *CreateTrailInput {
  1942. s.CloudWatchLogsRoleArn = &v
  1943. return s
  1944. }
  1945. // SetEnableLogFileValidation sets the EnableLogFileValidation field's value.
  1946. func (s *CreateTrailInput) SetEnableLogFileValidation(v bool) *CreateTrailInput {
  1947. s.EnableLogFileValidation = &v
  1948. return s
  1949. }
  1950. // SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value.
  1951. func (s *CreateTrailInput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailInput {
  1952. s.IncludeGlobalServiceEvents = &v
  1953. return s
  1954. }
  1955. // SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value.
  1956. func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput {
  1957. s.IsMultiRegionTrail = &v
  1958. return s
  1959. }
  1960. // SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
  1961. func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput {
  1962. s.IsOrganizationTrail = &v
  1963. return s
  1964. }
  1965. // SetKmsKeyId sets the KmsKeyId field's value.
  1966. func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput {
  1967. s.KmsKeyId = &v
  1968. return s
  1969. }
  1970. // SetName sets the Name field's value.
  1971. func (s *CreateTrailInput) SetName(v string) *CreateTrailInput {
  1972. s.Name = &v
  1973. return s
  1974. }
  1975. // SetS3BucketName sets the S3BucketName field's value.
  1976. func (s *CreateTrailInput) SetS3BucketName(v string) *CreateTrailInput {
  1977. s.S3BucketName = &v
  1978. return s
  1979. }
  1980. // SetS3KeyPrefix sets the S3KeyPrefix field's value.
  1981. func (s *CreateTrailInput) SetS3KeyPrefix(v string) *CreateTrailInput {
  1982. s.S3KeyPrefix = &v
  1983. return s
  1984. }
  1985. // SetSnsTopicName sets the SnsTopicName field's value.
  1986. func (s *CreateTrailInput) SetSnsTopicName(v string) *CreateTrailInput {
  1987. s.SnsTopicName = &v
  1988. return s
  1989. }
  1990. // Returns the objects or data listed below if successful. Otherwise, returns
  1991. // an error.
  1992. type CreateTrailOutput struct {
  1993. _ struct{} `type:"structure"`
  1994. // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
  1995. // logs will be delivered.
  1996. CloudWatchLogsLogGroupArn *string `type:"string"`
  1997. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  1998. // a user's log group.
  1999. CloudWatchLogsRoleArn *string `type:"string"`
  2000. // Specifies whether the trail is publishing events from global services such
  2001. // as IAM to the log files.
  2002. IncludeGlobalServiceEvents *bool `type:"boolean"`
  2003. // Specifies whether the trail exists in one region or in all regions.
  2004. IsMultiRegionTrail *bool `type:"boolean"`
  2005. // Specifies whether the trail is an organization trail.
  2006. IsOrganizationTrail *bool `type:"boolean"`
  2007. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
  2008. // The value is a fully specified ARN to a KMS key in the format:
  2009. //
  2010. // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  2011. KmsKeyId *string `type:"string"`
  2012. // Specifies whether log file integrity validation is enabled.
  2013. LogFileValidationEnabled *bool `type:"boolean"`
  2014. // Specifies the name of the trail.
  2015. Name *string `type:"string"`
  2016. // Specifies the name of the Amazon S3 bucket designated for publishing log
  2017. // files.
  2018. S3BucketName *string `type:"string"`
  2019. // Specifies the Amazon S3 key prefix that comes after the name of the bucket
  2020. // you have designated for log file delivery. For more information, see Finding
  2021. // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
  2022. S3KeyPrefix *string `type:"string"`
  2023. // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
  2024. // when log files are delivered. The format of a topic ARN is:
  2025. //
  2026. // arn:aws:sns:us-east-2:123456789012:MyTopic
  2027. SnsTopicARN *string `type:"string"`
  2028. // This field is deprecated. Use SnsTopicARN.
  2029. //
  2030. // Deprecated: SnsTopicName has been deprecated
  2031. SnsTopicName *string `deprecated:"true" type:"string"`
  2032. // Specifies the ARN of the trail that was created. The format of a trail ARN
  2033. // is:
  2034. //
  2035. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2036. TrailARN *string `type:"string"`
  2037. }
  2038. // String returns the string representation
  2039. func (s CreateTrailOutput) String() string {
  2040. return awsutil.Prettify(s)
  2041. }
  2042. // GoString returns the string representation
  2043. func (s CreateTrailOutput) GoString() string {
  2044. return s.String()
  2045. }
  2046. // SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value.
  2047. func (s *CreateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailOutput {
  2048. s.CloudWatchLogsLogGroupArn = &v
  2049. return s
  2050. }
  2051. // SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
  2052. func (s *CreateTrailOutput) SetCloudWatchLogsRoleArn(v string) *CreateTrailOutput {
  2053. s.CloudWatchLogsRoleArn = &v
  2054. return s
  2055. }
  2056. // SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value.
  2057. func (s *CreateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailOutput {
  2058. s.IncludeGlobalServiceEvents = &v
  2059. return s
  2060. }
  2061. // SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value.
  2062. func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput {
  2063. s.IsMultiRegionTrail = &v
  2064. return s
  2065. }
  2066. // SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
  2067. func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput {
  2068. s.IsOrganizationTrail = &v
  2069. return s
  2070. }
  2071. // SetKmsKeyId sets the KmsKeyId field's value.
  2072. func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput {
  2073. s.KmsKeyId = &v
  2074. return s
  2075. }
  2076. // SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value.
  2077. func (s *CreateTrailOutput) SetLogFileValidationEnabled(v bool) *CreateTrailOutput {
  2078. s.LogFileValidationEnabled = &v
  2079. return s
  2080. }
  2081. // SetName sets the Name field's value.
  2082. func (s *CreateTrailOutput) SetName(v string) *CreateTrailOutput {
  2083. s.Name = &v
  2084. return s
  2085. }
  2086. // SetS3BucketName sets the S3BucketName field's value.
  2087. func (s *CreateTrailOutput) SetS3BucketName(v string) *CreateTrailOutput {
  2088. s.S3BucketName = &v
  2089. return s
  2090. }
  2091. // SetS3KeyPrefix sets the S3KeyPrefix field's value.
  2092. func (s *CreateTrailOutput) SetS3KeyPrefix(v string) *CreateTrailOutput {
  2093. s.S3KeyPrefix = &v
  2094. return s
  2095. }
  2096. // SetSnsTopicARN sets the SnsTopicARN field's value.
  2097. func (s *CreateTrailOutput) SetSnsTopicARN(v string) *CreateTrailOutput {
  2098. s.SnsTopicARN = &v
  2099. return s
  2100. }
  2101. // SetSnsTopicName sets the SnsTopicName field's value.
  2102. func (s *CreateTrailOutput) SetSnsTopicName(v string) *CreateTrailOutput {
  2103. s.SnsTopicName = &v
  2104. return s
  2105. }
  2106. // SetTrailARN sets the TrailARN field's value.
  2107. func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput {
  2108. s.TrailARN = &v
  2109. return s
  2110. }
  2111. // The Amazon S3 buckets or AWS Lambda functions that you specify in your event
  2112. // selectors for your trail to log data events. Data events provide insight
  2113. // into the resource operations performed on or within a resource itself. These
  2114. // are also known as data plane operations. You can specify up to 250 data resources
  2115. // for a trail.
  2116. //
  2117. // The total number of allowed data resources is 250. This number can be distributed
  2118. // between 1 and 5 event selectors, but the total cannot exceed 250 across all
  2119. // selectors.
  2120. //
  2121. // The following example demonstrates how logging works when you configure logging
  2122. // of all data events for an S3 bucket named bucket-1. In this example, the
  2123. // CloudTrail user spcified an empty prefix, and the option to log both Read
  2124. // and Write data events.
  2125. //
  2126. // A user uploads an image file to bucket-1.
  2127. //
  2128. // The PutObject API operation is an Amazon S3 object-level API. It is recorded
  2129. // as a data event in CloudTrail. Because the CloudTrail user specified an S3
  2130. // bucket with an empty prefix, events that occur on any object in that bucket
  2131. // are logged. The trail processes and logs the event.
  2132. //
  2133. // A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2.
  2134. //
  2135. // The PutObject API operation occurred for an object in an S3 bucket that the
  2136. // CloudTrail user didn't specify for the trail. The trail doesn’t log the event.
  2137. //
  2138. // The following example demonstrates how logging works when you configure logging
  2139. // of AWS Lambda data events for a Lambda function named MyLambdaFunction, but
  2140. // not for all AWS Lambda functions.
  2141. //
  2142. // A user runs a script that includes a call to the MyLambdaFunction function
  2143. // and the MyOtherLambdaFunction function.
  2144. //
  2145. // The Invoke API operation on MyLambdaFunction is an AWS Lambda API. It is
  2146. // recorded as a data event in CloudTrail. Because the CloudTrail user specified
  2147. // logging data events for MyLambdaFunction, any invocations of that function
  2148. // are logged. The trail processes and logs the event.
  2149. //
  2150. // The Invoke API operation on MyOtherLambdaFunction is an AWS Lambda API. Because
  2151. // the CloudTrail user did not specify logging data events for all Lambda functions,
  2152. // the Invoke operation for MyOtherLambdaFunction does not match the function
  2153. // specified for the trail. The trail doesn’t log the event.
  2154. type DataResource struct {
  2155. _ struct{} `type:"structure"`
  2156. // The resource type in which you want to log data events. You can specify AWS::S3::Object
  2157. // or AWS::Lambda::Function resources.
  2158. Type *string `type:"string"`
  2159. // An array of Amazon Resource Name (ARN) strings or partial ARN strings for
  2160. // the specified objects.
  2161. //
  2162. // * To log data events for all objects in all S3 buckets in your AWS account,
  2163. // specify the prefix as arn:aws:s3:::.
  2164. //
  2165. // This will also enable logging of data event activity performed by any user
  2166. // or role in your AWS account, even if that activity is performed on a bucket
  2167. // that belongs to another AWS account.
  2168. //
  2169. // * To log data events for all objects in all S3 buckets that include my-bucket
  2170. // in their names, specify the prefix as aws:s3:::my-bucket. The trail logs
  2171. // data events for all objects in all buckets whose name contains a match
  2172. // for my-bucket.
  2173. //
  2174. // * To log data events for all objects in an S3 bucket, specify the bucket
  2175. // and an empty object prefix such as arn:aws:s3:::bucket-1/. The trail logs
  2176. // data events for all objects in this S3 bucket.
  2177. //
  2178. // * To log data events for specific objects, specify the S3 bucket and object
  2179. // prefix such as arn:aws:s3:::bucket-1/example-images. The trail logs data
  2180. // events for objects in this S3 bucket that match the prefix.
  2181. //
  2182. // * To log data events for all functions in your AWS account, specify the
  2183. // prefix as arn:aws:lambda.
  2184. //
  2185. // This will also enable logging of Invoke activity performed by any user or
  2186. // role in your AWS account, even if that activity is performed on a function
  2187. // that belongs to another AWS account.
  2188. //
  2189. // * To log data eents for a specific Lambda function, specify the function
  2190. // ARN.
  2191. //
  2192. // Lambda function ARNs are exact. Unlike S3, you cannot use matching. For example,
  2193. // if you specify a function ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld,
  2194. // data events will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld.
  2195. // They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2.
  2196. Values []*string `type:"list"`
  2197. }
  2198. // String returns the string representation
  2199. func (s DataResource) String() string {
  2200. return awsutil.Prettify(s)
  2201. }
  2202. // GoString returns the string representation
  2203. func (s DataResource) GoString() string {
  2204. return s.String()
  2205. }
  2206. // SetType sets the Type field's value.
  2207. func (s *DataResource) SetType(v string) *DataResource {
  2208. s.Type = &v
  2209. return s
  2210. }
  2211. // SetValues sets the Values field's value.
  2212. func (s *DataResource) SetValues(v []*string) *DataResource {
  2213. s.Values = v
  2214. return s
  2215. }
  2216. // The request that specifies the name of a trail to delete.
  2217. type DeleteTrailInput struct {
  2218. _ struct{} `type:"structure"`
  2219. // Specifies the name or the CloudTrail ARN of the trail to be deleted. The
  2220. // format of a trail ARN is: arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2221. //
  2222. // Name is a required field
  2223. Name *string `type:"string" required:"true"`
  2224. }
  2225. // String returns the string representation
  2226. func (s DeleteTrailInput) String() string {
  2227. return awsutil.Prettify(s)
  2228. }
  2229. // GoString returns the string representation
  2230. func (s DeleteTrailInput) GoString() string {
  2231. return s.String()
  2232. }
  2233. // Validate inspects the fields of the type to determine if they are valid.
  2234. func (s *DeleteTrailInput) Validate() error {
  2235. invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"}
  2236. if s.Name == nil {
  2237. invalidParams.Add(request.NewErrParamRequired("Name"))
  2238. }
  2239. if invalidParams.Len() > 0 {
  2240. return invalidParams
  2241. }
  2242. return nil
  2243. }
  2244. // SetName sets the Name field's value.
  2245. func (s *DeleteTrailInput) SetName(v string) *DeleteTrailInput {
  2246. s.Name = &v
  2247. return s
  2248. }
  2249. // Returns the objects or data listed below if successful. Otherwise, returns
  2250. // an error.
  2251. type DeleteTrailOutput struct {
  2252. _ struct{} `type:"structure"`
  2253. }
  2254. // String returns the string representation
  2255. func (s DeleteTrailOutput) String() string {
  2256. return awsutil.Prettify(s)
  2257. }
  2258. // GoString returns the string representation
  2259. func (s DeleteTrailOutput) GoString() string {
  2260. return s.String()
  2261. }
  2262. // Returns information about the trail.
  2263. type DescribeTrailsInput struct {
  2264. _ struct{} `type:"structure"`
  2265. // Specifies whether to include shadow trails in the response. A shadow trail
  2266. // is the replication in a region of a trail that was created in a different
  2267. // region, or in the case of an organization trail, the replication of an organization
  2268. // trail in member accounts. If you do not include shadow trails, organization
  2269. // trails in a member account and region replication trails will not be returned.
  2270. // The default is true.
  2271. IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"`
  2272. // Specifies a list of trail names, trail ARNs, or both, of the trails to describe.
  2273. // The format of a trail ARN is:
  2274. //
  2275. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2276. //
  2277. // If an empty list is specified, information for the trail in the current region
  2278. // is returned.
  2279. //
  2280. // * If an empty list is specified and IncludeShadowTrails is false, then
  2281. // information for all trails in the current region is returned.
  2282. //
  2283. // * If an empty list is specified and IncludeShadowTrails is null or true,
  2284. // then information for all trails in the current region and any associated
  2285. // shadow trails in other regions is returned.
  2286. //
  2287. // If one or more trail names are specified, information is returned only if
  2288. // the names match the names of trails belonging only to the current region.
  2289. // To return information about a trail in another region, you must specify its
  2290. // trail ARN.
  2291. TrailNameList []*string `locationName:"trailNameList" type:"list"`
  2292. }
  2293. // String returns the string representation
  2294. func (s DescribeTrailsInput) String() string {
  2295. return awsutil.Prettify(s)
  2296. }
  2297. // GoString returns the string representation
  2298. func (s DescribeTrailsInput) GoString() string {
  2299. return s.String()
  2300. }
  2301. // SetIncludeShadowTrails sets the IncludeShadowTrails field's value.
  2302. func (s *DescribeTrailsInput) SetIncludeShadowTrails(v bool) *DescribeTrailsInput {
  2303. s.IncludeShadowTrails = &v
  2304. return s
  2305. }
  2306. // SetTrailNameList sets the TrailNameList field's value.
  2307. func (s *DescribeTrailsInput) SetTrailNameList(v []*string) *DescribeTrailsInput {
  2308. s.TrailNameList = v
  2309. return s
  2310. }
  2311. // Returns the objects or data listed below if successful. Otherwise, returns
  2312. // an error.
  2313. type DescribeTrailsOutput struct {
  2314. _ struct{} `type:"structure"`
  2315. // The list of trail objects.
  2316. TrailList []*Trail `locationName:"trailList" type:"list"`
  2317. }
  2318. // String returns the string representation
  2319. func (s DescribeTrailsOutput) String() string {
  2320. return awsutil.Prettify(s)
  2321. }
  2322. // GoString returns the string representation
  2323. func (s DescribeTrailsOutput) GoString() string {
  2324. return s.String()
  2325. }
  2326. // SetTrailList sets the TrailList field's value.
  2327. func (s *DescribeTrailsOutput) SetTrailList(v []*Trail) *DescribeTrailsOutput {
  2328. s.TrailList = v
  2329. return s
  2330. }
  2331. // Contains information about an event that was returned by a lookup request.
  2332. // The result includes a representation of a CloudTrail event.
  2333. type Event struct {
  2334. _ struct{} `type:"structure"`
  2335. // The AWS access key ID that was used to sign the request. If the request was
  2336. // made with temporary security credentials, this is the access key ID of the
  2337. // temporary credentials.
  2338. AccessKeyId *string `type:"string"`
  2339. // A JSON string that contains a representation of the event returned.
  2340. CloudTrailEvent *string `type:"string"`
  2341. // The CloudTrail ID of the event returned.
  2342. EventId *string `type:"string"`
  2343. // The name of the event returned.
  2344. EventName *string `type:"string"`
  2345. // The AWS service that the request was made to.
  2346. EventSource *string `type:"string"`
  2347. // The date and time of the event returned.
  2348. EventTime *time.Time `type:"timestamp"`
  2349. // Information about whether the event is a write event or a read event.
  2350. ReadOnly *string `type:"string"`
  2351. // A list of resources referenced by the event returned.
  2352. Resources []*Resource `type:"list"`
  2353. // A user name or role name of the requester that called the API in the event
  2354. // returned.
  2355. Username *string `type:"string"`
  2356. }
  2357. // String returns the string representation
  2358. func (s Event) String() string {
  2359. return awsutil.Prettify(s)
  2360. }
  2361. // GoString returns the string representation
  2362. func (s Event) GoString() string {
  2363. return s.String()
  2364. }
  2365. // SetAccessKeyId sets the AccessKeyId field's value.
  2366. func (s *Event) SetAccessKeyId(v string) *Event {
  2367. s.AccessKeyId = &v
  2368. return s
  2369. }
  2370. // SetCloudTrailEvent sets the CloudTrailEvent field's value.
  2371. func (s *Event) SetCloudTrailEvent(v string) *Event {
  2372. s.CloudTrailEvent = &v
  2373. return s
  2374. }
  2375. // SetEventId sets the EventId field's value.
  2376. func (s *Event) SetEventId(v string) *Event {
  2377. s.EventId = &v
  2378. return s
  2379. }
  2380. // SetEventName sets the EventName field's value.
  2381. func (s *Event) SetEventName(v string) *Event {
  2382. s.EventName = &v
  2383. return s
  2384. }
  2385. // SetEventSource sets the EventSource field's value.
  2386. func (s *Event) SetEventSource(v string) *Event {
  2387. s.EventSource = &v
  2388. return s
  2389. }
  2390. // SetEventTime sets the EventTime field's value.
  2391. func (s *Event) SetEventTime(v time.Time) *Event {
  2392. s.EventTime = &v
  2393. return s
  2394. }
  2395. // SetReadOnly sets the ReadOnly field's value.
  2396. func (s *Event) SetReadOnly(v string) *Event {
  2397. s.ReadOnly = &v
  2398. return s
  2399. }
  2400. // SetResources sets the Resources field's value.
  2401. func (s *Event) SetResources(v []*Resource) *Event {
  2402. s.Resources = v
  2403. return s
  2404. }
  2405. // SetUsername sets the Username field's value.
  2406. func (s *Event) SetUsername(v string) *Event {
  2407. s.Username = &v
  2408. return s
  2409. }
  2410. // Use event selectors to further specify the management and data event settings
  2411. // for your trail. By default, trails created without specific event selectors
  2412. // will be configured to log all read and write management events, and no data
  2413. // events. When an event occurs in your account, CloudTrail evaluates the event
  2414. // selector for all trails. For each trail, if the event matches any event selector,
  2415. // the trail processes and logs the event. If the event doesn't match any event
  2416. // selector, the trail doesn't log the event.
  2417. //
  2418. // You can configure up to five event selectors for a trail.
  2419. type EventSelector struct {
  2420. _ struct{} `type:"structure"`
  2421. // CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda
  2422. // functions. You can specify up to 250 resources for an individual event selector,
  2423. // but the total number of data resources cannot exceed 250 across all event
  2424. // selectors in a trail. This limit does not apply if you configure resource
  2425. // logging for all data events.
  2426. //
  2427. // For more information, see Data Events (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-data-events)
  2428. // and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html)
  2429. // in the AWS CloudTrail User Guide.
  2430. DataResources []*DataResource `type:"list"`
  2431. // Specify if you want your event selector to include management events for
  2432. // your trail.
  2433. //
  2434. // For more information, see Management Events (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-management-events)
  2435. // in the AWS CloudTrail User Guide.
  2436. //
  2437. // By default, the value is true.
  2438. IncludeManagementEvents *bool `type:"boolean"`
  2439. // Specify if you want your trail to log read-only events, write-only events,
  2440. // or all. For example, the EC2 GetConsoleOutput is a read-only API operation
  2441. // and RunInstances is a write-only API operation.
  2442. //
  2443. // By default, the value is All.
  2444. ReadWriteType *string `type:"string" enum:"ReadWriteType"`
  2445. }
  2446. // String returns the string representation
  2447. func (s EventSelector) String() string {
  2448. return awsutil.Prettify(s)
  2449. }
  2450. // GoString returns the string representation
  2451. func (s EventSelector) GoString() string {
  2452. return s.String()
  2453. }
  2454. // SetDataResources sets the DataResources field's value.
  2455. func (s *EventSelector) SetDataResources(v []*DataResource) *EventSelector {
  2456. s.DataResources = v
  2457. return s
  2458. }
  2459. // SetIncludeManagementEvents sets the IncludeManagementEvents field's value.
  2460. func (s *EventSelector) SetIncludeManagementEvents(v bool) *EventSelector {
  2461. s.IncludeManagementEvents = &v
  2462. return s
  2463. }
  2464. // SetReadWriteType sets the ReadWriteType field's value.
  2465. func (s *EventSelector) SetReadWriteType(v string) *EventSelector {
  2466. s.ReadWriteType = &v
  2467. return s
  2468. }
  2469. type GetEventSelectorsInput struct {
  2470. _ struct{} `type:"structure"`
  2471. // Specifies the name of the trail or trail ARN. If you specify a trail name,
  2472. // the string must meet the following requirements:
  2473. //
  2474. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  2475. // (_), or dashes (-)
  2476. //
  2477. // * Start with a letter or number, and end with a letter or number
  2478. //
  2479. // * Be between 3 and 128 characters
  2480. //
  2481. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  2482. // and my--namespace are not valid.
  2483. //
  2484. // * Not be in IP address format (for example, 192.168.5.4)
  2485. //
  2486. // If you specify a trail ARN, it must be in the format:
  2487. //
  2488. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2489. //
  2490. // TrailName is a required field
  2491. TrailName *string `type:"string" required:"true"`
  2492. }
  2493. // String returns the string representation
  2494. func (s GetEventSelectorsInput) String() string {
  2495. return awsutil.Prettify(s)
  2496. }
  2497. // GoString returns the string representation
  2498. func (s GetEventSelectorsInput) GoString() string {
  2499. return s.String()
  2500. }
  2501. // Validate inspects the fields of the type to determine if they are valid.
  2502. func (s *GetEventSelectorsInput) Validate() error {
  2503. invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"}
  2504. if s.TrailName == nil {
  2505. invalidParams.Add(request.NewErrParamRequired("TrailName"))
  2506. }
  2507. if invalidParams.Len() > 0 {
  2508. return invalidParams
  2509. }
  2510. return nil
  2511. }
  2512. // SetTrailName sets the TrailName field's value.
  2513. func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput {
  2514. s.TrailName = &v
  2515. return s
  2516. }
  2517. type GetEventSelectorsOutput struct {
  2518. _ struct{} `type:"structure"`
  2519. // The event selectors that are configured for the trail.
  2520. EventSelectors []*EventSelector `type:"list"`
  2521. // The specified trail ARN that has the event selectors.
  2522. TrailARN *string `type:"string"`
  2523. }
  2524. // String returns the string representation
  2525. func (s GetEventSelectorsOutput) String() string {
  2526. return awsutil.Prettify(s)
  2527. }
  2528. // GoString returns the string representation
  2529. func (s GetEventSelectorsOutput) GoString() string {
  2530. return s.String()
  2531. }
  2532. // SetEventSelectors sets the EventSelectors field's value.
  2533. func (s *GetEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *GetEventSelectorsOutput {
  2534. s.EventSelectors = v
  2535. return s
  2536. }
  2537. // SetTrailARN sets the TrailARN field's value.
  2538. func (s *GetEventSelectorsOutput) SetTrailARN(v string) *GetEventSelectorsOutput {
  2539. s.TrailARN = &v
  2540. return s
  2541. }
  2542. // The name of a trail about which you want the current status.
  2543. type GetTrailStatusInput struct {
  2544. _ struct{} `type:"structure"`
  2545. // Specifies the name or the CloudTrail ARN of the trail for which you are requesting
  2546. // status. To get the status of a shadow trail (a replication of the trail in
  2547. // another region), you must specify its ARN. The format of a trail ARN is:
  2548. //
  2549. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2550. //
  2551. // Name is a required field
  2552. Name *string `type:"string" required:"true"`
  2553. }
  2554. // String returns the string representation
  2555. func (s GetTrailStatusInput) String() string {
  2556. return awsutil.Prettify(s)
  2557. }
  2558. // GoString returns the string representation
  2559. func (s GetTrailStatusInput) GoString() string {
  2560. return s.String()
  2561. }
  2562. // Validate inspects the fields of the type to determine if they are valid.
  2563. func (s *GetTrailStatusInput) Validate() error {
  2564. invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"}
  2565. if s.Name == nil {
  2566. invalidParams.Add(request.NewErrParamRequired("Name"))
  2567. }
  2568. if invalidParams.Len() > 0 {
  2569. return invalidParams
  2570. }
  2571. return nil
  2572. }
  2573. // SetName sets the Name field's value.
  2574. func (s *GetTrailStatusInput) SetName(v string) *GetTrailStatusInput {
  2575. s.Name = &v
  2576. return s
  2577. }
  2578. // Returns the objects or data listed below if successful. Otherwise, returns
  2579. // an error.
  2580. type GetTrailStatusOutput struct {
  2581. _ struct{} `type:"structure"`
  2582. // Whether the CloudTrail is currently logging AWS API calls.
  2583. IsLogging *bool `type:"boolean"`
  2584. // Displays any CloudWatch Logs error that CloudTrail encountered when attempting
  2585. // to deliver logs to CloudWatch Logs.
  2586. LatestCloudWatchLogsDeliveryError *string `type:"string"`
  2587. // Displays the most recent date and time when CloudTrail delivered logs to
  2588. // CloudWatch Logs.
  2589. LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp"`
  2590. // This field is deprecated.
  2591. LatestDeliveryAttemptSucceeded *string `type:"string"`
  2592. // This field is deprecated.
  2593. LatestDeliveryAttemptTime *string `type:"string"`
  2594. // Displays any Amazon S3 error that CloudTrail encountered when attempting
  2595. // to deliver log files to the designated bucket. For more information see the
  2596. // topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html)
  2597. // in the Amazon S3 API Reference.
  2598. //
  2599. // This error occurs only when there is a problem with the destination S3 bucket
  2600. // and will not occur for timeouts. To resolve the issue, create a new bucket
  2601. // and call UpdateTrail to specify the new bucket, or fix the existing objects
  2602. // so that CloudTrail can again write to the bucket.
  2603. LatestDeliveryError *string `type:"string"`
  2604. // Specifies the date and time that CloudTrail last delivered log files to an
  2605. // account's Amazon S3 bucket.
  2606. LatestDeliveryTime *time.Time `type:"timestamp"`
  2607. // Displays any Amazon S3 error that CloudTrail encountered when attempting
  2608. // to deliver a digest file to the designated bucket. For more information see
  2609. // the topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html)
  2610. // in the Amazon S3 API Reference.
  2611. //
  2612. // This error occurs only when there is a problem with the destination S3 bucket
  2613. // and will not occur for timeouts. To resolve the issue, create a new bucket
  2614. // and call UpdateTrail to specify the new bucket, or fix the existing objects
  2615. // so that CloudTrail can again write to the bucket.
  2616. LatestDigestDeliveryError *string `type:"string"`
  2617. // Specifies the date and time that CloudTrail last delivered a digest file
  2618. // to an account's Amazon S3 bucket.
  2619. LatestDigestDeliveryTime *time.Time `type:"timestamp"`
  2620. // This field is deprecated.
  2621. LatestNotificationAttemptSucceeded *string `type:"string"`
  2622. // This field is deprecated.
  2623. LatestNotificationAttemptTime *string `type:"string"`
  2624. // Displays any Amazon SNS error that CloudTrail encountered when attempting
  2625. // to send a notification. For more information about Amazon SNS errors, see
  2626. // the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/welcome.html).
  2627. LatestNotificationError *string `type:"string"`
  2628. // Specifies the date and time of the most recent Amazon SNS notification that
  2629. // CloudTrail has written a new log file to an account's Amazon S3 bucket.
  2630. LatestNotificationTime *time.Time `type:"timestamp"`
  2631. // Specifies the most recent date and time when CloudTrail started recording
  2632. // API calls for an AWS account.
  2633. StartLoggingTime *time.Time `type:"timestamp"`
  2634. // Specifies the most recent date and time when CloudTrail stopped recording
  2635. // API calls for an AWS account.
  2636. StopLoggingTime *time.Time `type:"timestamp"`
  2637. // This field is deprecated.
  2638. TimeLoggingStarted *string `type:"string"`
  2639. // This field is deprecated.
  2640. TimeLoggingStopped *string `type:"string"`
  2641. }
  2642. // String returns the string representation
  2643. func (s GetTrailStatusOutput) String() string {
  2644. return awsutil.Prettify(s)
  2645. }
  2646. // GoString returns the string representation
  2647. func (s GetTrailStatusOutput) GoString() string {
  2648. return s.String()
  2649. }
  2650. // SetIsLogging sets the IsLogging field's value.
  2651. func (s *GetTrailStatusOutput) SetIsLogging(v bool) *GetTrailStatusOutput {
  2652. s.IsLogging = &v
  2653. return s
  2654. }
  2655. // SetLatestCloudWatchLogsDeliveryError sets the LatestCloudWatchLogsDeliveryError field's value.
  2656. func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryError(v string) *GetTrailStatusOutput {
  2657. s.LatestCloudWatchLogsDeliveryError = &v
  2658. return s
  2659. }
  2660. // SetLatestCloudWatchLogsDeliveryTime sets the LatestCloudWatchLogsDeliveryTime field's value.
  2661. func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryTime(v time.Time) *GetTrailStatusOutput {
  2662. s.LatestCloudWatchLogsDeliveryTime = &v
  2663. return s
  2664. }
  2665. // SetLatestDeliveryAttemptSucceeded sets the LatestDeliveryAttemptSucceeded field's value.
  2666. func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptSucceeded(v string) *GetTrailStatusOutput {
  2667. s.LatestDeliveryAttemptSucceeded = &v
  2668. return s
  2669. }
  2670. // SetLatestDeliveryAttemptTime sets the LatestDeliveryAttemptTime field's value.
  2671. func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptTime(v string) *GetTrailStatusOutput {
  2672. s.LatestDeliveryAttemptTime = &v
  2673. return s
  2674. }
  2675. // SetLatestDeliveryError sets the LatestDeliveryError field's value.
  2676. func (s *GetTrailStatusOutput) SetLatestDeliveryError(v string) *GetTrailStatusOutput {
  2677. s.LatestDeliveryError = &v
  2678. return s
  2679. }
  2680. // SetLatestDeliveryTime sets the LatestDeliveryTime field's value.
  2681. func (s *GetTrailStatusOutput) SetLatestDeliveryTime(v time.Time) *GetTrailStatusOutput {
  2682. s.LatestDeliveryTime = &v
  2683. return s
  2684. }
  2685. // SetLatestDigestDeliveryError sets the LatestDigestDeliveryError field's value.
  2686. func (s *GetTrailStatusOutput) SetLatestDigestDeliveryError(v string) *GetTrailStatusOutput {
  2687. s.LatestDigestDeliveryError = &v
  2688. return s
  2689. }
  2690. // SetLatestDigestDeliveryTime sets the LatestDigestDeliveryTime field's value.
  2691. func (s *GetTrailStatusOutput) SetLatestDigestDeliveryTime(v time.Time) *GetTrailStatusOutput {
  2692. s.LatestDigestDeliveryTime = &v
  2693. return s
  2694. }
  2695. // SetLatestNotificationAttemptSucceeded sets the LatestNotificationAttemptSucceeded field's value.
  2696. func (s *GetTrailStatusOutput) SetLatestNotificationAttemptSucceeded(v string) *GetTrailStatusOutput {
  2697. s.LatestNotificationAttemptSucceeded = &v
  2698. return s
  2699. }
  2700. // SetLatestNotificationAttemptTime sets the LatestNotificationAttemptTime field's value.
  2701. func (s *GetTrailStatusOutput) SetLatestNotificationAttemptTime(v string) *GetTrailStatusOutput {
  2702. s.LatestNotificationAttemptTime = &v
  2703. return s
  2704. }
  2705. // SetLatestNotificationError sets the LatestNotificationError field's value.
  2706. func (s *GetTrailStatusOutput) SetLatestNotificationError(v string) *GetTrailStatusOutput {
  2707. s.LatestNotificationError = &v
  2708. return s
  2709. }
  2710. // SetLatestNotificationTime sets the LatestNotificationTime field's value.
  2711. func (s *GetTrailStatusOutput) SetLatestNotificationTime(v time.Time) *GetTrailStatusOutput {
  2712. s.LatestNotificationTime = &v
  2713. return s
  2714. }
  2715. // SetStartLoggingTime sets the StartLoggingTime field's value.
  2716. func (s *GetTrailStatusOutput) SetStartLoggingTime(v time.Time) *GetTrailStatusOutput {
  2717. s.StartLoggingTime = &v
  2718. return s
  2719. }
  2720. // SetStopLoggingTime sets the StopLoggingTime field's value.
  2721. func (s *GetTrailStatusOutput) SetStopLoggingTime(v time.Time) *GetTrailStatusOutput {
  2722. s.StopLoggingTime = &v
  2723. return s
  2724. }
  2725. // SetTimeLoggingStarted sets the TimeLoggingStarted field's value.
  2726. func (s *GetTrailStatusOutput) SetTimeLoggingStarted(v string) *GetTrailStatusOutput {
  2727. s.TimeLoggingStarted = &v
  2728. return s
  2729. }
  2730. // SetTimeLoggingStopped sets the TimeLoggingStopped field's value.
  2731. func (s *GetTrailStatusOutput) SetTimeLoggingStopped(v string) *GetTrailStatusOutput {
  2732. s.TimeLoggingStopped = &v
  2733. return s
  2734. }
  2735. // Requests the public keys for a specified time range.
  2736. type ListPublicKeysInput struct {
  2737. _ struct{} `type:"structure"`
  2738. // Optionally specifies, in UTC, the end of the time range to look up public
  2739. // keys for CloudTrail digest files. If not specified, the current time is used.
  2740. EndTime *time.Time `type:"timestamp"`
  2741. // Reserved for future use.
  2742. NextToken *string `type:"string"`
  2743. // Optionally specifies, in UTC, the start of the time range to look up public
  2744. // keys for CloudTrail digest files. If not specified, the current time is used,
  2745. // and the current public key is returned.
  2746. StartTime *time.Time `type:"timestamp"`
  2747. }
  2748. // String returns the string representation
  2749. func (s ListPublicKeysInput) String() string {
  2750. return awsutil.Prettify(s)
  2751. }
  2752. // GoString returns the string representation
  2753. func (s ListPublicKeysInput) GoString() string {
  2754. return s.String()
  2755. }
  2756. // SetEndTime sets the EndTime field's value.
  2757. func (s *ListPublicKeysInput) SetEndTime(v time.Time) *ListPublicKeysInput {
  2758. s.EndTime = &v
  2759. return s
  2760. }
  2761. // SetNextToken sets the NextToken field's value.
  2762. func (s *ListPublicKeysInput) SetNextToken(v string) *ListPublicKeysInput {
  2763. s.NextToken = &v
  2764. return s
  2765. }
  2766. // SetStartTime sets the StartTime field's value.
  2767. func (s *ListPublicKeysInput) SetStartTime(v time.Time) *ListPublicKeysInput {
  2768. s.StartTime = &v
  2769. return s
  2770. }
  2771. // Returns the objects or data listed below if successful. Otherwise, returns
  2772. // an error.
  2773. type ListPublicKeysOutput struct {
  2774. _ struct{} `type:"structure"`
  2775. // Reserved for future use.
  2776. NextToken *string `type:"string"`
  2777. // Contains an array of PublicKey objects.
  2778. //
  2779. // The returned public keys may have validity time ranges that overlap.
  2780. PublicKeyList []*PublicKey `type:"list"`
  2781. }
  2782. // String returns the string representation
  2783. func (s ListPublicKeysOutput) String() string {
  2784. return awsutil.Prettify(s)
  2785. }
  2786. // GoString returns the string representation
  2787. func (s ListPublicKeysOutput) GoString() string {
  2788. return s.String()
  2789. }
  2790. // SetNextToken sets the NextToken field's value.
  2791. func (s *ListPublicKeysOutput) SetNextToken(v string) *ListPublicKeysOutput {
  2792. s.NextToken = &v
  2793. return s
  2794. }
  2795. // SetPublicKeyList sets the PublicKeyList field's value.
  2796. func (s *ListPublicKeysOutput) SetPublicKeyList(v []*PublicKey) *ListPublicKeysOutput {
  2797. s.PublicKeyList = v
  2798. return s
  2799. }
  2800. // Specifies a list of trail tags to return.
  2801. type ListTagsInput struct {
  2802. _ struct{} `type:"structure"`
  2803. // Reserved for future use.
  2804. NextToken *string `type:"string"`
  2805. // Specifies a list of trail ARNs whose tags will be listed. The list has a
  2806. // limit of 20 ARNs. The format of a trail ARN is:
  2807. //
  2808. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  2809. //
  2810. // ResourceIdList is a required field
  2811. ResourceIdList []*string `type:"list" required:"true"`
  2812. }
  2813. // String returns the string representation
  2814. func (s ListTagsInput) String() string {
  2815. return awsutil.Prettify(s)
  2816. }
  2817. // GoString returns the string representation
  2818. func (s ListTagsInput) GoString() string {
  2819. return s.String()
  2820. }
  2821. // Validate inspects the fields of the type to determine if they are valid.
  2822. func (s *ListTagsInput) Validate() error {
  2823. invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"}
  2824. if s.ResourceIdList == nil {
  2825. invalidParams.Add(request.NewErrParamRequired("ResourceIdList"))
  2826. }
  2827. if invalidParams.Len() > 0 {
  2828. return invalidParams
  2829. }
  2830. return nil
  2831. }
  2832. // SetNextToken sets the NextToken field's value.
  2833. func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput {
  2834. s.NextToken = &v
  2835. return s
  2836. }
  2837. // SetResourceIdList sets the ResourceIdList field's value.
  2838. func (s *ListTagsInput) SetResourceIdList(v []*string) *ListTagsInput {
  2839. s.ResourceIdList = v
  2840. return s
  2841. }
  2842. // Returns the objects or data listed below if successful. Otherwise, returns
  2843. // an error.
  2844. type ListTagsOutput struct {
  2845. _ struct{} `type:"structure"`
  2846. // Reserved for future use.
  2847. NextToken *string `type:"string"`
  2848. // A list of resource tags.
  2849. ResourceTagList []*ResourceTag `type:"list"`
  2850. }
  2851. // String returns the string representation
  2852. func (s ListTagsOutput) String() string {
  2853. return awsutil.Prettify(s)
  2854. }
  2855. // GoString returns the string representation
  2856. func (s ListTagsOutput) GoString() string {
  2857. return s.String()
  2858. }
  2859. // SetNextToken sets the NextToken field's value.
  2860. func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput {
  2861. s.NextToken = &v
  2862. return s
  2863. }
  2864. // SetResourceTagList sets the ResourceTagList field's value.
  2865. func (s *ListTagsOutput) SetResourceTagList(v []*ResourceTag) *ListTagsOutput {
  2866. s.ResourceTagList = v
  2867. return s
  2868. }
  2869. // Specifies an attribute and value that filter the events returned.
  2870. type LookupAttribute struct {
  2871. _ struct{} `type:"structure"`
  2872. // Specifies an attribute on which to filter the events returned.
  2873. //
  2874. // AttributeKey is a required field
  2875. AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"`
  2876. // Specifies a value for the specified AttributeKey.
  2877. //
  2878. // AttributeValue is a required field
  2879. AttributeValue *string `type:"string" required:"true"`
  2880. }
  2881. // String returns the string representation
  2882. func (s LookupAttribute) String() string {
  2883. return awsutil.Prettify(s)
  2884. }
  2885. // GoString returns the string representation
  2886. func (s LookupAttribute) GoString() string {
  2887. return s.String()
  2888. }
  2889. // Validate inspects the fields of the type to determine if they are valid.
  2890. func (s *LookupAttribute) Validate() error {
  2891. invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"}
  2892. if s.AttributeKey == nil {
  2893. invalidParams.Add(request.NewErrParamRequired("AttributeKey"))
  2894. }
  2895. if s.AttributeValue == nil {
  2896. invalidParams.Add(request.NewErrParamRequired("AttributeValue"))
  2897. }
  2898. if invalidParams.Len() > 0 {
  2899. return invalidParams
  2900. }
  2901. return nil
  2902. }
  2903. // SetAttributeKey sets the AttributeKey field's value.
  2904. func (s *LookupAttribute) SetAttributeKey(v string) *LookupAttribute {
  2905. s.AttributeKey = &v
  2906. return s
  2907. }
  2908. // SetAttributeValue sets the AttributeValue field's value.
  2909. func (s *LookupAttribute) SetAttributeValue(v string) *LookupAttribute {
  2910. s.AttributeValue = &v
  2911. return s
  2912. }
  2913. // Contains a request for LookupEvents.
  2914. type LookupEventsInput struct {
  2915. _ struct{} `type:"structure"`
  2916. // Specifies that only events that occur before or at the specified time are
  2917. // returned. If the specified end time is before the specified start time, an
  2918. // error is returned.
  2919. EndTime *time.Time `type:"timestamp"`
  2920. // Contains a list of lookup attributes. Currently the list can contain only
  2921. // one item.
  2922. LookupAttributes []*LookupAttribute `type:"list"`
  2923. // The number of events to return. Possible values are 1 through 50. The default
  2924. // is 50.
  2925. MaxResults *int64 `min:"1" type:"integer"`
  2926. // The token to use to get the next page of results after a previous API call.
  2927. // This token must be passed in with the same parameters that were specified
  2928. // in the the original call. For example, if the original call specified an
  2929. // AttributeKey of 'Username' with a value of 'root', the call with NextToken
  2930. // should include those same parameters.
  2931. NextToken *string `type:"string"`
  2932. // Specifies that only events that occur after or at the specified time are
  2933. // returned. If the specified start time is after the specified end time, an
  2934. // error is returned.
  2935. StartTime *time.Time `type:"timestamp"`
  2936. }
  2937. // String returns the string representation
  2938. func (s LookupEventsInput) String() string {
  2939. return awsutil.Prettify(s)
  2940. }
  2941. // GoString returns the string representation
  2942. func (s LookupEventsInput) GoString() string {
  2943. return s.String()
  2944. }
  2945. // Validate inspects the fields of the type to determine if they are valid.
  2946. func (s *LookupEventsInput) Validate() error {
  2947. invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"}
  2948. if s.MaxResults != nil && *s.MaxResults < 1 {
  2949. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2950. }
  2951. if s.LookupAttributes != nil {
  2952. for i, v := range s.LookupAttributes {
  2953. if v == nil {
  2954. continue
  2955. }
  2956. if err := v.Validate(); err != nil {
  2957. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams))
  2958. }
  2959. }
  2960. }
  2961. if invalidParams.Len() > 0 {
  2962. return invalidParams
  2963. }
  2964. return nil
  2965. }
  2966. // SetEndTime sets the EndTime field's value.
  2967. func (s *LookupEventsInput) SetEndTime(v time.Time) *LookupEventsInput {
  2968. s.EndTime = &v
  2969. return s
  2970. }
  2971. // SetLookupAttributes sets the LookupAttributes field's value.
  2972. func (s *LookupEventsInput) SetLookupAttributes(v []*LookupAttribute) *LookupEventsInput {
  2973. s.LookupAttributes = v
  2974. return s
  2975. }
  2976. // SetMaxResults sets the MaxResults field's value.
  2977. func (s *LookupEventsInput) SetMaxResults(v int64) *LookupEventsInput {
  2978. s.MaxResults = &v
  2979. return s
  2980. }
  2981. // SetNextToken sets the NextToken field's value.
  2982. func (s *LookupEventsInput) SetNextToken(v string) *LookupEventsInput {
  2983. s.NextToken = &v
  2984. return s
  2985. }
  2986. // SetStartTime sets the StartTime field's value.
  2987. func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput {
  2988. s.StartTime = &v
  2989. return s
  2990. }
  2991. // Contains a response to a LookupEvents action.
  2992. type LookupEventsOutput struct {
  2993. _ struct{} `type:"structure"`
  2994. // A list of events returned based on the lookup attributes specified and the
  2995. // CloudTrail event. The events list is sorted by time. The most recent event
  2996. // is listed first.
  2997. Events []*Event `type:"list"`
  2998. // The token to use to get the next page of results after a previous API call.
  2999. // If the token does not appear, there are no more results to return. The token
  3000. // must be passed in with the same parameters as the previous call. For example,
  3001. // if the original call specified an AttributeKey of 'Username' with a value
  3002. // of 'root', the call with NextToken should include those same parameters.
  3003. NextToken *string `type:"string"`
  3004. }
  3005. // String returns the string representation
  3006. func (s LookupEventsOutput) String() string {
  3007. return awsutil.Prettify(s)
  3008. }
  3009. // GoString returns the string representation
  3010. func (s LookupEventsOutput) GoString() string {
  3011. return s.String()
  3012. }
  3013. // SetEvents sets the Events field's value.
  3014. func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput {
  3015. s.Events = v
  3016. return s
  3017. }
  3018. // SetNextToken sets the NextToken field's value.
  3019. func (s *LookupEventsOutput) SetNextToken(v string) *LookupEventsOutput {
  3020. s.NextToken = &v
  3021. return s
  3022. }
  3023. // Contains information about a returned public key.
  3024. type PublicKey struct {
  3025. _ struct{} `type:"structure"`
  3026. // The fingerprint of the public key.
  3027. Fingerprint *string `type:"string"`
  3028. // The ending time of validity of the public key.
  3029. ValidityEndTime *time.Time `type:"timestamp"`
  3030. // The starting time of validity of the public key.
  3031. ValidityStartTime *time.Time `type:"timestamp"`
  3032. // The DER encoded public key value in PKCS#1 format.
  3033. //
  3034. // Value is automatically base64 encoded/decoded by the SDK.
  3035. Value []byte `type:"blob"`
  3036. }
  3037. // String returns the string representation
  3038. func (s PublicKey) String() string {
  3039. return awsutil.Prettify(s)
  3040. }
  3041. // GoString returns the string representation
  3042. func (s PublicKey) GoString() string {
  3043. return s.String()
  3044. }
  3045. // SetFingerprint sets the Fingerprint field's value.
  3046. func (s *PublicKey) SetFingerprint(v string) *PublicKey {
  3047. s.Fingerprint = &v
  3048. return s
  3049. }
  3050. // SetValidityEndTime sets the ValidityEndTime field's value.
  3051. func (s *PublicKey) SetValidityEndTime(v time.Time) *PublicKey {
  3052. s.ValidityEndTime = &v
  3053. return s
  3054. }
  3055. // SetValidityStartTime sets the ValidityStartTime field's value.
  3056. func (s *PublicKey) SetValidityStartTime(v time.Time) *PublicKey {
  3057. s.ValidityStartTime = &v
  3058. return s
  3059. }
  3060. // SetValue sets the Value field's value.
  3061. func (s *PublicKey) SetValue(v []byte) *PublicKey {
  3062. s.Value = v
  3063. return s
  3064. }
  3065. type PutEventSelectorsInput struct {
  3066. _ struct{} `type:"structure"`
  3067. // Specifies the settings for your event selectors. You can configure up to
  3068. // five event selectors for a trail.
  3069. //
  3070. // EventSelectors is a required field
  3071. EventSelectors []*EventSelector `type:"list" required:"true"`
  3072. // Specifies the name of the trail or trail ARN. If you specify a trail name,
  3073. // the string must meet the following requirements:
  3074. //
  3075. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  3076. // (_), or dashes (-)
  3077. //
  3078. // * Start with a letter or number, and end with a letter or number
  3079. //
  3080. // * Be between 3 and 128 characters
  3081. //
  3082. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  3083. // and my--namespace are invalid.
  3084. //
  3085. // * Not be in IP address format (for example, 192.168.5.4)
  3086. //
  3087. // If you specify a trail ARN, it must be in the format:
  3088. //
  3089. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3090. //
  3091. // TrailName is a required field
  3092. TrailName *string `type:"string" required:"true"`
  3093. }
  3094. // String returns the string representation
  3095. func (s PutEventSelectorsInput) String() string {
  3096. return awsutil.Prettify(s)
  3097. }
  3098. // GoString returns the string representation
  3099. func (s PutEventSelectorsInput) GoString() string {
  3100. return s.String()
  3101. }
  3102. // Validate inspects the fields of the type to determine if they are valid.
  3103. func (s *PutEventSelectorsInput) Validate() error {
  3104. invalidParams := request.ErrInvalidParams{Context: "PutEventSelectorsInput"}
  3105. if s.EventSelectors == nil {
  3106. invalidParams.Add(request.NewErrParamRequired("EventSelectors"))
  3107. }
  3108. if s.TrailName == nil {
  3109. invalidParams.Add(request.NewErrParamRequired("TrailName"))
  3110. }
  3111. if invalidParams.Len() > 0 {
  3112. return invalidParams
  3113. }
  3114. return nil
  3115. }
  3116. // SetEventSelectors sets the EventSelectors field's value.
  3117. func (s *PutEventSelectorsInput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsInput {
  3118. s.EventSelectors = v
  3119. return s
  3120. }
  3121. // SetTrailName sets the TrailName field's value.
  3122. func (s *PutEventSelectorsInput) SetTrailName(v string) *PutEventSelectorsInput {
  3123. s.TrailName = &v
  3124. return s
  3125. }
  3126. type PutEventSelectorsOutput struct {
  3127. _ struct{} `type:"structure"`
  3128. // Specifies the event selectors configured for your trail.
  3129. EventSelectors []*EventSelector `type:"list"`
  3130. // Specifies the ARN of the trail that was updated with event selectors. The
  3131. // format of a trail ARN is:
  3132. //
  3133. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3134. TrailARN *string `type:"string"`
  3135. }
  3136. // String returns the string representation
  3137. func (s PutEventSelectorsOutput) String() string {
  3138. return awsutil.Prettify(s)
  3139. }
  3140. // GoString returns the string representation
  3141. func (s PutEventSelectorsOutput) GoString() string {
  3142. return s.String()
  3143. }
  3144. // SetEventSelectors sets the EventSelectors field's value.
  3145. func (s *PutEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsOutput {
  3146. s.EventSelectors = v
  3147. return s
  3148. }
  3149. // SetTrailARN sets the TrailARN field's value.
  3150. func (s *PutEventSelectorsOutput) SetTrailARN(v string) *PutEventSelectorsOutput {
  3151. s.TrailARN = &v
  3152. return s
  3153. }
  3154. // Specifies the tags to remove from a trail.
  3155. type RemoveTagsInput struct {
  3156. _ struct{} `type:"structure"`
  3157. // Specifies the ARN of the trail from which tags should be removed. The format
  3158. // of a trail ARN is:
  3159. //
  3160. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3161. //
  3162. // ResourceId is a required field
  3163. ResourceId *string `type:"string" required:"true"`
  3164. // Specifies a list of tags to be removed.
  3165. TagsList []*Tag `type:"list"`
  3166. }
  3167. // String returns the string representation
  3168. func (s RemoveTagsInput) String() string {
  3169. return awsutil.Prettify(s)
  3170. }
  3171. // GoString returns the string representation
  3172. func (s RemoveTagsInput) GoString() string {
  3173. return s.String()
  3174. }
  3175. // Validate inspects the fields of the type to determine if they are valid.
  3176. func (s *RemoveTagsInput) Validate() error {
  3177. invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"}
  3178. if s.ResourceId == nil {
  3179. invalidParams.Add(request.NewErrParamRequired("ResourceId"))
  3180. }
  3181. if s.TagsList != nil {
  3182. for i, v := range s.TagsList {
  3183. if v == nil {
  3184. continue
  3185. }
  3186. if err := v.Validate(); err != nil {
  3187. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
  3188. }
  3189. }
  3190. }
  3191. if invalidParams.Len() > 0 {
  3192. return invalidParams
  3193. }
  3194. return nil
  3195. }
  3196. // SetResourceId sets the ResourceId field's value.
  3197. func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput {
  3198. s.ResourceId = &v
  3199. return s
  3200. }
  3201. // SetTagsList sets the TagsList field's value.
  3202. func (s *RemoveTagsInput) SetTagsList(v []*Tag) *RemoveTagsInput {
  3203. s.TagsList = v
  3204. return s
  3205. }
  3206. // Returns the objects or data listed below if successful. Otherwise, returns
  3207. // an error.
  3208. type RemoveTagsOutput struct {
  3209. _ struct{} `type:"structure"`
  3210. }
  3211. // String returns the string representation
  3212. func (s RemoveTagsOutput) String() string {
  3213. return awsutil.Prettify(s)
  3214. }
  3215. // GoString returns the string representation
  3216. func (s RemoveTagsOutput) GoString() string {
  3217. return s.String()
  3218. }
  3219. // Specifies the type and name of a resource referenced by an event.
  3220. type Resource struct {
  3221. _ struct{} `type:"structure"`
  3222. // The name of the resource referenced by the event returned. These are user-created
  3223. // names whose values will depend on the environment. For example, the resource
  3224. // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567"
  3225. // for an EC2 Instance.
  3226. ResourceName *string `type:"string"`
  3227. // The type of a resource referenced by the event returned. When the resource
  3228. // type cannot be determined, null is returned. Some examples of resource types
  3229. // are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey
  3230. // for IAM. For a list of resource types supported for event lookup, see Resource
  3231. // Types Supported for Event Lookup (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/lookup_supported_resourcetypes.html).
  3232. ResourceType *string `type:"string"`
  3233. }
  3234. // String returns the string representation
  3235. func (s Resource) String() string {
  3236. return awsutil.Prettify(s)
  3237. }
  3238. // GoString returns the string representation
  3239. func (s Resource) GoString() string {
  3240. return s.String()
  3241. }
  3242. // SetResourceName sets the ResourceName field's value.
  3243. func (s *Resource) SetResourceName(v string) *Resource {
  3244. s.ResourceName = &v
  3245. return s
  3246. }
  3247. // SetResourceType sets the ResourceType field's value.
  3248. func (s *Resource) SetResourceType(v string) *Resource {
  3249. s.ResourceType = &v
  3250. return s
  3251. }
  3252. // A resource tag.
  3253. type ResourceTag struct {
  3254. _ struct{} `type:"structure"`
  3255. // Specifies the ARN of the resource.
  3256. ResourceId *string `type:"string"`
  3257. // A list of tags.
  3258. TagsList []*Tag `type:"list"`
  3259. }
  3260. // String returns the string representation
  3261. func (s ResourceTag) String() string {
  3262. return awsutil.Prettify(s)
  3263. }
  3264. // GoString returns the string representation
  3265. func (s ResourceTag) GoString() string {
  3266. return s.String()
  3267. }
  3268. // SetResourceId sets the ResourceId field's value.
  3269. func (s *ResourceTag) SetResourceId(v string) *ResourceTag {
  3270. s.ResourceId = &v
  3271. return s
  3272. }
  3273. // SetTagsList sets the TagsList field's value.
  3274. func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag {
  3275. s.TagsList = v
  3276. return s
  3277. }
  3278. // The request to CloudTrail to start logging AWS API calls for an account.
  3279. type StartLoggingInput struct {
  3280. _ struct{} `type:"structure"`
  3281. // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail
  3282. // logs AWS API calls. The format of a trail ARN is:
  3283. //
  3284. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3285. //
  3286. // Name is a required field
  3287. Name *string `type:"string" required:"true"`
  3288. }
  3289. // String returns the string representation
  3290. func (s StartLoggingInput) String() string {
  3291. return awsutil.Prettify(s)
  3292. }
  3293. // GoString returns the string representation
  3294. func (s StartLoggingInput) GoString() string {
  3295. return s.String()
  3296. }
  3297. // Validate inspects the fields of the type to determine if they are valid.
  3298. func (s *StartLoggingInput) Validate() error {
  3299. invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"}
  3300. if s.Name == nil {
  3301. invalidParams.Add(request.NewErrParamRequired("Name"))
  3302. }
  3303. if invalidParams.Len() > 0 {
  3304. return invalidParams
  3305. }
  3306. return nil
  3307. }
  3308. // SetName sets the Name field's value.
  3309. func (s *StartLoggingInput) SetName(v string) *StartLoggingInput {
  3310. s.Name = &v
  3311. return s
  3312. }
  3313. // Returns the objects or data listed below if successful. Otherwise, returns
  3314. // an error.
  3315. type StartLoggingOutput struct {
  3316. _ struct{} `type:"structure"`
  3317. }
  3318. // String returns the string representation
  3319. func (s StartLoggingOutput) String() string {
  3320. return awsutil.Prettify(s)
  3321. }
  3322. // GoString returns the string representation
  3323. func (s StartLoggingOutput) GoString() string {
  3324. return s.String()
  3325. }
  3326. // Passes the request to CloudTrail to stop logging AWS API calls for the specified
  3327. // account.
  3328. type StopLoggingInput struct {
  3329. _ struct{} `type:"structure"`
  3330. // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail
  3331. // will stop logging AWS API calls. The format of a trail ARN is:
  3332. //
  3333. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3334. //
  3335. // Name is a required field
  3336. Name *string `type:"string" required:"true"`
  3337. }
  3338. // String returns the string representation
  3339. func (s StopLoggingInput) String() string {
  3340. return awsutil.Prettify(s)
  3341. }
  3342. // GoString returns the string representation
  3343. func (s StopLoggingInput) GoString() string {
  3344. return s.String()
  3345. }
  3346. // Validate inspects the fields of the type to determine if they are valid.
  3347. func (s *StopLoggingInput) Validate() error {
  3348. invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"}
  3349. if s.Name == nil {
  3350. invalidParams.Add(request.NewErrParamRequired("Name"))
  3351. }
  3352. if invalidParams.Len() > 0 {
  3353. return invalidParams
  3354. }
  3355. return nil
  3356. }
  3357. // SetName sets the Name field's value.
  3358. func (s *StopLoggingInput) SetName(v string) *StopLoggingInput {
  3359. s.Name = &v
  3360. return s
  3361. }
  3362. // Returns the objects or data listed below if successful. Otherwise, returns
  3363. // an error.
  3364. type StopLoggingOutput struct {
  3365. _ struct{} `type:"structure"`
  3366. }
  3367. // String returns the string representation
  3368. func (s StopLoggingOutput) String() string {
  3369. return awsutil.Prettify(s)
  3370. }
  3371. // GoString returns the string representation
  3372. func (s StopLoggingOutput) GoString() string {
  3373. return s.String()
  3374. }
  3375. // A custom key-value pair associated with a resource such as a CloudTrail trail.
  3376. type Tag struct {
  3377. _ struct{} `type:"structure"`
  3378. // The key in a key-value pair. The key must be must be no longer than 128 Unicode
  3379. // characters. The key must be unique for the resource to which it applies.
  3380. //
  3381. // Key is a required field
  3382. Key *string `type:"string" required:"true"`
  3383. // The value in a key-value pair of a tag. The value must be no longer than
  3384. // 256 Unicode characters.
  3385. Value *string `type:"string"`
  3386. }
  3387. // String returns the string representation
  3388. func (s Tag) String() string {
  3389. return awsutil.Prettify(s)
  3390. }
  3391. // GoString returns the string representation
  3392. func (s Tag) GoString() string {
  3393. return s.String()
  3394. }
  3395. // Validate inspects the fields of the type to determine if they are valid.
  3396. func (s *Tag) Validate() error {
  3397. invalidParams := request.ErrInvalidParams{Context: "Tag"}
  3398. if s.Key == nil {
  3399. invalidParams.Add(request.NewErrParamRequired("Key"))
  3400. }
  3401. if invalidParams.Len() > 0 {
  3402. return invalidParams
  3403. }
  3404. return nil
  3405. }
  3406. // SetKey sets the Key field's value.
  3407. func (s *Tag) SetKey(v string) *Tag {
  3408. s.Key = &v
  3409. return s
  3410. }
  3411. // SetValue sets the Value field's value.
  3412. func (s *Tag) SetValue(v string) *Tag {
  3413. s.Value = &v
  3414. return s
  3415. }
  3416. // The settings for a trail.
  3417. type Trail struct {
  3418. _ struct{} `type:"structure"`
  3419. // Specifies an Amazon Resource Name (ARN), a unique identifier that represents
  3420. // the log group to which CloudTrail logs will be delivered.
  3421. CloudWatchLogsLogGroupArn *string `type:"string"`
  3422. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  3423. // a user's log group.
  3424. CloudWatchLogsRoleArn *string `type:"string"`
  3425. // Specifies if the trail has custom event selectors.
  3426. HasCustomEventSelectors *bool `type:"boolean"`
  3427. // The region in which the trail was created.
  3428. HomeRegion *string `type:"string"`
  3429. // Set to True to include AWS API calls from AWS global services such as IAM.
  3430. // Otherwise, False.
  3431. IncludeGlobalServiceEvents *bool `type:"boolean"`
  3432. // Specifies whether the trail belongs only to one region or exists in all regions.
  3433. IsMultiRegionTrail *bool `type:"boolean"`
  3434. // Specifies whether the trail is an organization trail.
  3435. IsOrganizationTrail *bool `type:"boolean"`
  3436. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
  3437. // The value is a fully specified ARN to a KMS key in the format:
  3438. //
  3439. // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  3440. KmsKeyId *string `type:"string"`
  3441. // Specifies whether log file validation is enabled.
  3442. LogFileValidationEnabled *bool `type:"boolean"`
  3443. // Name of the trail set by calling CreateTrail. The maximum length is 128 characters.
  3444. Name *string `type:"string"`
  3445. // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files.
  3446. // See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
  3447. S3BucketName *string `type:"string"`
  3448. // Specifies the Amazon S3 key prefix that comes after the name of the bucket
  3449. // you have designated for log file delivery. For more information, see Finding
  3450. // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).The
  3451. // maximum length is 200 characters.
  3452. S3KeyPrefix *string `type:"string"`
  3453. // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
  3454. // when log files are delivered. The format of a topic ARN is:
  3455. //
  3456. // arn:aws:sns:us-east-2:123456789012:MyTopic
  3457. SnsTopicARN *string `type:"string"`
  3458. // This field is deprecated. Use SnsTopicARN.
  3459. //
  3460. // Deprecated: SnsTopicName has been deprecated
  3461. SnsTopicName *string `deprecated:"true" type:"string"`
  3462. // Specifies the ARN of the trail. The format of a trail ARN is:
  3463. //
  3464. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3465. TrailARN *string `type:"string"`
  3466. }
  3467. // String returns the string representation
  3468. func (s Trail) String() string {
  3469. return awsutil.Prettify(s)
  3470. }
  3471. // GoString returns the string representation
  3472. func (s Trail) GoString() string {
  3473. return s.String()
  3474. }
  3475. // SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value.
  3476. func (s *Trail) SetCloudWatchLogsLogGroupArn(v string) *Trail {
  3477. s.CloudWatchLogsLogGroupArn = &v
  3478. return s
  3479. }
  3480. // SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
  3481. func (s *Trail) SetCloudWatchLogsRoleArn(v string) *Trail {
  3482. s.CloudWatchLogsRoleArn = &v
  3483. return s
  3484. }
  3485. // SetHasCustomEventSelectors sets the HasCustomEventSelectors field's value.
  3486. func (s *Trail) SetHasCustomEventSelectors(v bool) *Trail {
  3487. s.HasCustomEventSelectors = &v
  3488. return s
  3489. }
  3490. // SetHomeRegion sets the HomeRegion field's value.
  3491. func (s *Trail) SetHomeRegion(v string) *Trail {
  3492. s.HomeRegion = &v
  3493. return s
  3494. }
  3495. // SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value.
  3496. func (s *Trail) SetIncludeGlobalServiceEvents(v bool) *Trail {
  3497. s.IncludeGlobalServiceEvents = &v
  3498. return s
  3499. }
  3500. // SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value.
  3501. func (s *Trail) SetIsMultiRegionTrail(v bool) *Trail {
  3502. s.IsMultiRegionTrail = &v
  3503. return s
  3504. }
  3505. // SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
  3506. func (s *Trail) SetIsOrganizationTrail(v bool) *Trail {
  3507. s.IsOrganizationTrail = &v
  3508. return s
  3509. }
  3510. // SetKmsKeyId sets the KmsKeyId field's value.
  3511. func (s *Trail) SetKmsKeyId(v string) *Trail {
  3512. s.KmsKeyId = &v
  3513. return s
  3514. }
  3515. // SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value.
  3516. func (s *Trail) SetLogFileValidationEnabled(v bool) *Trail {
  3517. s.LogFileValidationEnabled = &v
  3518. return s
  3519. }
  3520. // SetName sets the Name field's value.
  3521. func (s *Trail) SetName(v string) *Trail {
  3522. s.Name = &v
  3523. return s
  3524. }
  3525. // SetS3BucketName sets the S3BucketName field's value.
  3526. func (s *Trail) SetS3BucketName(v string) *Trail {
  3527. s.S3BucketName = &v
  3528. return s
  3529. }
  3530. // SetS3KeyPrefix sets the S3KeyPrefix field's value.
  3531. func (s *Trail) SetS3KeyPrefix(v string) *Trail {
  3532. s.S3KeyPrefix = &v
  3533. return s
  3534. }
  3535. // SetSnsTopicARN sets the SnsTopicARN field's value.
  3536. func (s *Trail) SetSnsTopicARN(v string) *Trail {
  3537. s.SnsTopicARN = &v
  3538. return s
  3539. }
  3540. // SetSnsTopicName sets the SnsTopicName field's value.
  3541. func (s *Trail) SetSnsTopicName(v string) *Trail {
  3542. s.SnsTopicName = &v
  3543. return s
  3544. }
  3545. // SetTrailARN sets the TrailARN field's value.
  3546. func (s *Trail) SetTrailARN(v string) *Trail {
  3547. s.TrailARN = &v
  3548. return s
  3549. }
  3550. // Specifies settings to update for the trail.
  3551. type UpdateTrailInput struct {
  3552. _ struct{} `type:"structure"`
  3553. // Specifies a log group name using an Amazon Resource Name (ARN), a unique
  3554. // identifier that represents the log group to which CloudTrail logs will be
  3555. // delivered. Not required unless you specify CloudWatchLogsRoleArn.
  3556. CloudWatchLogsLogGroupArn *string `type:"string"`
  3557. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  3558. // a user's log group.
  3559. CloudWatchLogsRoleArn *string `type:"string"`
  3560. // Specifies whether log file validation is enabled. The default is false.
  3561. //
  3562. // When you disable log file integrity validation, the chain of digest files
  3563. // is broken after one hour. CloudTrail will not create digest files for log
  3564. // files that were delivered during a period in which log file integrity validation
  3565. // was disabled. For example, if you enable log file integrity validation at
  3566. // noon on January 1, disable it at noon on January 2, and re-enable it at noon
  3567. // on January 10, digest files will not be created for the log files delivered
  3568. // from noon on January 2 to noon on January 10. The same applies whenever you
  3569. // stop CloudTrail logging or delete a trail.
  3570. EnableLogFileValidation *bool `type:"boolean"`
  3571. // Specifies whether the trail is publishing events from global services such
  3572. // as IAM to the log files.
  3573. IncludeGlobalServiceEvents *bool `type:"boolean"`
  3574. // Specifies whether the trail applies only to the current region or to all
  3575. // regions. The default is false. If the trail exists only in the current region
  3576. // and this value is set to true, shadow trails (replications of the trail)
  3577. // will be created in the other regions. If the trail exists in all regions
  3578. // and this value is set to false, the trail will remain in the region where
  3579. // it was created, and its shadow trails in other regions will be deleted.
  3580. IsMultiRegionTrail *bool `type:"boolean"`
  3581. // Specifies whether the trail is applied to all accounts in an organization
  3582. // in AWS Organizations, or only for the current AWS account. The default is
  3583. // false, and cannot be true unless the call is made on behalf of an AWS account
  3584. // that is the master account for an organization in AWS Organizations. If the
  3585. // trail is not an organization trail and this is set to true, the trail will
  3586. // be created in all AWS accounts that belong to the organization. If the trail
  3587. // is an organization trail and this is set to false, the trail will remain
  3588. // in the current AWS account but be deleted from all member accounts in the
  3589. // organization.
  3590. IsOrganizationTrail *bool `type:"boolean"`
  3591. // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
  3592. // The value can be an alias name prefixed by "alias/", a fully specified ARN
  3593. // to an alias, a fully specified ARN to a key, or a globally unique identifier.
  3594. //
  3595. // Examples:
  3596. //
  3597. // * alias/MyAliasName
  3598. //
  3599. // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
  3600. //
  3601. // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  3602. //
  3603. // * 12345678-1234-1234-1234-123456789012
  3604. KmsKeyId *string `type:"string"`
  3605. // Specifies the name of the trail or trail ARN. If Name is a trail name, the
  3606. // string must meet the following requirements:
  3607. //
  3608. // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores
  3609. // (_), or dashes (-)
  3610. //
  3611. // * Start with a letter or number, and end with a letter or number
  3612. //
  3613. // * Be between 3 and 128 characters
  3614. //
  3615. // * Have no adjacent periods, underscores or dashes. Names like my-_namespace
  3616. // and my--namespace are invalid.
  3617. //
  3618. // * Not be in IP address format (for example, 192.168.5.4)
  3619. //
  3620. // If Name is a trail ARN, it must be in the format:
  3621. //
  3622. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3623. //
  3624. // Name is a required field
  3625. Name *string `type:"string" required:"true"`
  3626. // Specifies the name of the Amazon S3 bucket designated for publishing log
  3627. // files. See Amazon S3 Bucket Naming Requirements (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html).
  3628. S3BucketName *string `type:"string"`
  3629. // Specifies the Amazon S3 key prefix that comes after the name of the bucket
  3630. // you have designated for log file delivery. For more information, see Finding
  3631. // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
  3632. // The maximum length is 200 characters.
  3633. S3KeyPrefix *string `type:"string"`
  3634. // Specifies the name of the Amazon SNS topic defined for notification of log
  3635. // file delivery. The maximum length is 256 characters.
  3636. SnsTopicName *string `type:"string"`
  3637. }
  3638. // String returns the string representation
  3639. func (s UpdateTrailInput) String() string {
  3640. return awsutil.Prettify(s)
  3641. }
  3642. // GoString returns the string representation
  3643. func (s UpdateTrailInput) GoString() string {
  3644. return s.String()
  3645. }
  3646. // Validate inspects the fields of the type to determine if they are valid.
  3647. func (s *UpdateTrailInput) Validate() error {
  3648. invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"}
  3649. if s.Name == nil {
  3650. invalidParams.Add(request.NewErrParamRequired("Name"))
  3651. }
  3652. if invalidParams.Len() > 0 {
  3653. return invalidParams
  3654. }
  3655. return nil
  3656. }
  3657. // SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value.
  3658. func (s *UpdateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailInput {
  3659. s.CloudWatchLogsLogGroupArn = &v
  3660. return s
  3661. }
  3662. // SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
  3663. func (s *UpdateTrailInput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailInput {
  3664. s.CloudWatchLogsRoleArn = &v
  3665. return s
  3666. }
  3667. // SetEnableLogFileValidation sets the EnableLogFileValidation field's value.
  3668. func (s *UpdateTrailInput) SetEnableLogFileValidation(v bool) *UpdateTrailInput {
  3669. s.EnableLogFileValidation = &v
  3670. return s
  3671. }
  3672. // SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value.
  3673. func (s *UpdateTrailInput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailInput {
  3674. s.IncludeGlobalServiceEvents = &v
  3675. return s
  3676. }
  3677. // SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value.
  3678. func (s *UpdateTrailInput) SetIsMultiRegionTrail(v bool) *UpdateTrailInput {
  3679. s.IsMultiRegionTrail = &v
  3680. return s
  3681. }
  3682. // SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
  3683. func (s *UpdateTrailInput) SetIsOrganizationTrail(v bool) *UpdateTrailInput {
  3684. s.IsOrganizationTrail = &v
  3685. return s
  3686. }
  3687. // SetKmsKeyId sets the KmsKeyId field's value.
  3688. func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput {
  3689. s.KmsKeyId = &v
  3690. return s
  3691. }
  3692. // SetName sets the Name field's value.
  3693. func (s *UpdateTrailInput) SetName(v string) *UpdateTrailInput {
  3694. s.Name = &v
  3695. return s
  3696. }
  3697. // SetS3BucketName sets the S3BucketName field's value.
  3698. func (s *UpdateTrailInput) SetS3BucketName(v string) *UpdateTrailInput {
  3699. s.S3BucketName = &v
  3700. return s
  3701. }
  3702. // SetS3KeyPrefix sets the S3KeyPrefix field's value.
  3703. func (s *UpdateTrailInput) SetS3KeyPrefix(v string) *UpdateTrailInput {
  3704. s.S3KeyPrefix = &v
  3705. return s
  3706. }
  3707. // SetSnsTopicName sets the SnsTopicName field's value.
  3708. func (s *UpdateTrailInput) SetSnsTopicName(v string) *UpdateTrailInput {
  3709. s.SnsTopicName = &v
  3710. return s
  3711. }
  3712. // Returns the objects or data listed below if successful. Otherwise, returns
  3713. // an error.
  3714. type UpdateTrailOutput struct {
  3715. _ struct{} `type:"structure"`
  3716. // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
  3717. // logs will be delivered.
  3718. CloudWatchLogsLogGroupArn *string `type:"string"`
  3719. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  3720. // a user's log group.
  3721. CloudWatchLogsRoleArn *string `type:"string"`
  3722. // Specifies whether the trail is publishing events from global services such
  3723. // as IAM to the log files.
  3724. IncludeGlobalServiceEvents *bool `type:"boolean"`
  3725. // Specifies whether the trail exists in one region or in all regions.
  3726. IsMultiRegionTrail *bool `type:"boolean"`
  3727. // Specifies whether the trail is an organization trail.
  3728. IsOrganizationTrail *bool `type:"boolean"`
  3729. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
  3730. // The value is a fully specified ARN to a KMS key in the format:
  3731. //
  3732. // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
  3733. KmsKeyId *string `type:"string"`
  3734. // Specifies whether log file integrity validation is enabled.
  3735. LogFileValidationEnabled *bool `type:"boolean"`
  3736. // Specifies the name of the trail.
  3737. Name *string `type:"string"`
  3738. // Specifies the name of the Amazon S3 bucket designated for publishing log
  3739. // files.
  3740. S3BucketName *string `type:"string"`
  3741. // Specifies the Amazon S3 key prefix that comes after the name of the bucket
  3742. // you have designated for log file delivery. For more information, see Finding
  3743. // Your CloudTrail Log Files (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).
  3744. S3KeyPrefix *string `type:"string"`
  3745. // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications
  3746. // when log files are delivered. The format of a topic ARN is:
  3747. //
  3748. // arn:aws:sns:us-east-2:123456789012:MyTopic
  3749. SnsTopicARN *string `type:"string"`
  3750. // This field is deprecated. Use SnsTopicARN.
  3751. //
  3752. // Deprecated: SnsTopicName has been deprecated
  3753. SnsTopicName *string `deprecated:"true" type:"string"`
  3754. // Specifies the ARN of the trail that was updated. The format of a trail ARN
  3755. // is:
  3756. //
  3757. // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
  3758. TrailARN *string `type:"string"`
  3759. }
  3760. // String returns the string representation
  3761. func (s UpdateTrailOutput) String() string {
  3762. return awsutil.Prettify(s)
  3763. }
  3764. // GoString returns the string representation
  3765. func (s UpdateTrailOutput) GoString() string {
  3766. return s.String()
  3767. }
  3768. // SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value.
  3769. func (s *UpdateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailOutput {
  3770. s.CloudWatchLogsLogGroupArn = &v
  3771. return s
  3772. }
  3773. // SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value.
  3774. func (s *UpdateTrailOutput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailOutput {
  3775. s.CloudWatchLogsRoleArn = &v
  3776. return s
  3777. }
  3778. // SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value.
  3779. func (s *UpdateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailOutput {
  3780. s.IncludeGlobalServiceEvents = &v
  3781. return s
  3782. }
  3783. // SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value.
  3784. func (s *UpdateTrailOutput) SetIsMultiRegionTrail(v bool) *UpdateTrailOutput {
  3785. s.IsMultiRegionTrail = &v
  3786. return s
  3787. }
  3788. // SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
  3789. func (s *UpdateTrailOutput) SetIsOrganizationTrail(v bool) *UpdateTrailOutput {
  3790. s.IsOrganizationTrail = &v
  3791. return s
  3792. }
  3793. // SetKmsKeyId sets the KmsKeyId field's value.
  3794. func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput {
  3795. s.KmsKeyId = &v
  3796. return s
  3797. }
  3798. // SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value.
  3799. func (s *UpdateTrailOutput) SetLogFileValidationEnabled(v bool) *UpdateTrailOutput {
  3800. s.LogFileValidationEnabled = &v
  3801. return s
  3802. }
  3803. // SetName sets the Name field's value.
  3804. func (s *UpdateTrailOutput) SetName(v string) *UpdateTrailOutput {
  3805. s.Name = &v
  3806. return s
  3807. }
  3808. // SetS3BucketName sets the S3BucketName field's value.
  3809. func (s *UpdateTrailOutput) SetS3BucketName(v string) *UpdateTrailOutput {
  3810. s.S3BucketName = &v
  3811. return s
  3812. }
  3813. // SetS3KeyPrefix sets the S3KeyPrefix field's value.
  3814. func (s *UpdateTrailOutput) SetS3KeyPrefix(v string) *UpdateTrailOutput {
  3815. s.S3KeyPrefix = &v
  3816. return s
  3817. }
  3818. // SetSnsTopicARN sets the SnsTopicARN field's value.
  3819. func (s *UpdateTrailOutput) SetSnsTopicARN(v string) *UpdateTrailOutput {
  3820. s.SnsTopicARN = &v
  3821. return s
  3822. }
  3823. // SetSnsTopicName sets the SnsTopicName field's value.
  3824. func (s *UpdateTrailOutput) SetSnsTopicName(v string) *UpdateTrailOutput {
  3825. s.SnsTopicName = &v
  3826. return s
  3827. }
  3828. // SetTrailARN sets the TrailARN field's value.
  3829. func (s *UpdateTrailOutput) SetTrailARN(v string) *UpdateTrailOutput {
  3830. s.TrailARN = &v
  3831. return s
  3832. }
  3833. const (
  3834. // LookupAttributeKeyEventId is a LookupAttributeKey enum value
  3835. LookupAttributeKeyEventId = "EventId"
  3836. // LookupAttributeKeyEventName is a LookupAttributeKey enum value
  3837. LookupAttributeKeyEventName = "EventName"
  3838. // LookupAttributeKeyReadOnly is a LookupAttributeKey enum value
  3839. LookupAttributeKeyReadOnly = "ReadOnly"
  3840. // LookupAttributeKeyUsername is a LookupAttributeKey enum value
  3841. LookupAttributeKeyUsername = "Username"
  3842. // LookupAttributeKeyResourceType is a LookupAttributeKey enum value
  3843. LookupAttributeKeyResourceType = "ResourceType"
  3844. // LookupAttributeKeyResourceName is a LookupAttributeKey enum value
  3845. LookupAttributeKeyResourceName = "ResourceName"
  3846. // LookupAttributeKeyEventSource is a LookupAttributeKey enum value
  3847. LookupAttributeKeyEventSource = "EventSource"
  3848. // LookupAttributeKeyAccessKeyId is a LookupAttributeKey enum value
  3849. LookupAttributeKeyAccessKeyId = "AccessKeyId"
  3850. )
  3851. const (
  3852. // ReadWriteTypeReadOnly is a ReadWriteType enum value
  3853. ReadWriteTypeReadOnly = "ReadOnly"
  3854. // ReadWriteTypeWriteOnly is a ReadWriteType enum value
  3855. ReadWriteTypeWriteOnly = "WriteOnly"
  3856. // ReadWriteTypeAll is a ReadWriteType enum value
  3857. ReadWriteTypeAll = "All"
  3858. )