api.go 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package cloudtrail provides a client for AWS CloudTrail.
  3. package cloudtrail
  4. import (
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. )
  9. const opCreateTrail = "CreateTrail"
  10. // CreateTrailRequest generates a request for the CreateTrail operation.
  11. func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) {
  12. op := &request.Operation{
  13. Name: opCreateTrail,
  14. HTTPMethod: "POST",
  15. HTTPPath: "/",
  16. }
  17. if input == nil {
  18. input = &CreateTrailInput{}
  19. }
  20. req = c.newRequest(op, input, output)
  21. output = &CreateTrailOutput{}
  22. req.Data = output
  23. return
  24. }
  25. // From the command line, use create-subscription.
  26. //
  27. // Creates a trail that specifies the settings for delivery of log data to
  28. // an Amazon S3 bucket.
  29. func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) {
  30. req, out := c.CreateTrailRequest(input)
  31. err := req.Send()
  32. return out, err
  33. }
  34. const opDeleteTrail = "DeleteTrail"
  35. // DeleteTrailRequest generates a request for the DeleteTrail operation.
  36. func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) {
  37. op := &request.Operation{
  38. Name: opDeleteTrail,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &DeleteTrailInput{}
  44. }
  45. req = c.newRequest(op, input, output)
  46. output = &DeleteTrailOutput{}
  47. req.Data = output
  48. return
  49. }
  50. // Deletes a trail.
  51. func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) {
  52. req, out := c.DeleteTrailRequest(input)
  53. err := req.Send()
  54. return out, err
  55. }
  56. const opDescribeTrails = "DescribeTrails"
  57. // DescribeTrailsRequest generates a request for the DescribeTrails operation.
  58. func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) {
  59. op := &request.Operation{
  60. Name: opDescribeTrails,
  61. HTTPMethod: "POST",
  62. HTTPPath: "/",
  63. }
  64. if input == nil {
  65. input = &DescribeTrailsInput{}
  66. }
  67. req = c.newRequest(op, input, output)
  68. output = &DescribeTrailsOutput{}
  69. req.Data = output
  70. return
  71. }
  72. // Retrieves settings for the trail associated with the current region for your
  73. // account.
  74. func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) {
  75. req, out := c.DescribeTrailsRequest(input)
  76. err := req.Send()
  77. return out, err
  78. }
  79. const opGetTrailStatus = "GetTrailStatus"
  80. // GetTrailStatusRequest generates a request for the GetTrailStatus operation.
  81. func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) {
  82. op := &request.Operation{
  83. Name: opGetTrailStatus,
  84. HTTPMethod: "POST",
  85. HTTPPath: "/",
  86. }
  87. if input == nil {
  88. input = &GetTrailStatusInput{}
  89. }
  90. req = c.newRequest(op, input, output)
  91. output = &GetTrailStatusOutput{}
  92. req.Data = output
  93. return
  94. }
  95. // Returns a JSON-formatted list of information about the specified trail. Fields
  96. // include information on delivery errors, Amazon SNS and Amazon S3 errors,
  97. // and start and stop logging times for each trail.
  98. func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) {
  99. req, out := c.GetTrailStatusRequest(input)
  100. err := req.Send()
  101. return out, err
  102. }
  103. const opLookupEvents = "LookupEvents"
  104. // LookupEventsRequest generates a request for the LookupEvents operation.
  105. func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) {
  106. op := &request.Operation{
  107. Name: opLookupEvents,
  108. HTTPMethod: "POST",
  109. HTTPPath: "/",
  110. }
  111. if input == nil {
  112. input = &LookupEventsInput{}
  113. }
  114. req = c.newRequest(op, input, output)
  115. output = &LookupEventsOutput{}
  116. req.Data = output
  117. return
  118. }
  119. // Looks up API activity events captured by CloudTrail that create, update,
  120. // or delete resources in your account. Events for a region can be looked up
  121. // for the times in which you had CloudTrail turned on in that region during
  122. // the last seven days. Lookup supports five different attributes: time range
  123. // (defined by a start time and end time), user name, event name, resource type,
  124. // and resource name. All attributes are optional. The maximum number of attributes
  125. // that can be specified in any one lookup request are time range and one other
  126. // attribute. The default number of results returned is 10, with a maximum of
  127. // 50 possible. The response includes a token that you can use to get the next
  128. // page of results. The rate of lookup requests is limited to one per second
  129. // per account.
  130. //
  131. // Events that occurred during the selected time range will not be available
  132. // for lookup if CloudTrail logging was not enabled when the events occurred.
  133. func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) {
  134. req, out := c.LookupEventsRequest(input)
  135. err := req.Send()
  136. return out, err
  137. }
  138. const opStartLogging = "StartLogging"
  139. // StartLoggingRequest generates a request for the StartLogging operation.
  140. func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) {
  141. op := &request.Operation{
  142. Name: opStartLogging,
  143. HTTPMethod: "POST",
  144. HTTPPath: "/",
  145. }
  146. if input == nil {
  147. input = &StartLoggingInput{}
  148. }
  149. req = c.newRequest(op, input, output)
  150. output = &StartLoggingOutput{}
  151. req.Data = output
  152. return
  153. }
  154. // Starts the recording of AWS API calls and log file delivery for a trail.
  155. func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) {
  156. req, out := c.StartLoggingRequest(input)
  157. err := req.Send()
  158. return out, err
  159. }
  160. const opStopLogging = "StopLogging"
  161. // StopLoggingRequest generates a request for the StopLogging operation.
  162. func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) {
  163. op := &request.Operation{
  164. Name: opStopLogging,
  165. HTTPMethod: "POST",
  166. HTTPPath: "/",
  167. }
  168. if input == nil {
  169. input = &StopLoggingInput{}
  170. }
  171. req = c.newRequest(op, input, output)
  172. output = &StopLoggingOutput{}
  173. req.Data = output
  174. return
  175. }
  176. // Suspends the recording of AWS API calls and log file delivery for the specified
  177. // trail. Under most circumstances, there is no need to use this action. You
  178. // can update a trail without stopping it first. This action is the only way
  179. // to stop recording.
  180. func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) {
  181. req, out := c.StopLoggingRequest(input)
  182. err := req.Send()
  183. return out, err
  184. }
  185. const opUpdateTrail = "UpdateTrail"
  186. // UpdateTrailRequest generates a request for the UpdateTrail operation.
  187. func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) {
  188. op := &request.Operation{
  189. Name: opUpdateTrail,
  190. HTTPMethod: "POST",
  191. HTTPPath: "/",
  192. }
  193. if input == nil {
  194. input = &UpdateTrailInput{}
  195. }
  196. req = c.newRequest(op, input, output)
  197. output = &UpdateTrailOutput{}
  198. req.Data = output
  199. return
  200. }
  201. // From the command line, use update-subscription.
  202. //
  203. // Updates the settings that specify delivery of log files. Changes to a trail
  204. // do not require stopping the CloudTrail service. Use this action to designate
  205. // an existing bucket for log delivery. If the existing bucket has previously
  206. // been a target for CloudTrail log files, an IAM policy exists for the bucket.
  207. func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) {
  208. req, out := c.UpdateTrailRequest(input)
  209. err := req.Send()
  210. return out, err
  211. }
  212. // Specifies the settings for each trail.
  213. type CreateTrailInput struct {
  214. // Specifies a log group name using an Amazon Resource Name (ARN), a unique
  215. // identifier that represents the log group to which CloudTrail logs will be
  216. // delivered. Not required unless you specify CloudWatchLogsRoleArn.
  217. CloudWatchLogsLogGroupArn *string `type:"string"`
  218. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  219. // a user’s log group.
  220. CloudWatchLogsRoleArn *string `type:"string"`
  221. // Specifies whether the trail is publishing events from global services such
  222. // as IAM to the log files.
  223. IncludeGlobalServiceEvents *bool `type:"boolean"`
  224. // Specifies the name of the trail.
  225. Name *string `type:"string" required:"true"`
  226. // Specifies the name of the Amazon S3 bucket designated for publishing log
  227. // files.
  228. S3BucketName *string `type:"string" required:"true"`
  229. // Specifies the Amazon S3 key prefix that precedes the name of the bucket you
  230. // have designated for log file delivery.
  231. S3KeyPrefix *string `type:"string"`
  232. // Specifies the name of the Amazon SNS topic defined for notification of log
  233. // file delivery.
  234. SnsTopicName *string `type:"string"`
  235. metadataCreateTrailInput `json:"-" xml:"-"`
  236. }
  237. type metadataCreateTrailInput struct {
  238. SDKShapeTraits bool `type:"structure"`
  239. }
  240. // String returns the string representation
  241. func (s CreateTrailInput) String() string {
  242. return awsutil.Prettify(s)
  243. }
  244. // GoString returns the string representation
  245. func (s CreateTrailInput) GoString() string {
  246. return s.String()
  247. }
  248. // Returns the objects or data listed below if successful. Otherwise, returns
  249. // an error.
  250. type CreateTrailOutput struct {
  251. // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
  252. // logs will be delivered.
  253. CloudWatchLogsLogGroupArn *string `type:"string"`
  254. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  255. // a user’s log group.
  256. CloudWatchLogsRoleArn *string `type:"string"`
  257. // Specifies whether the trail is publishing events from global services such
  258. // as IAM to the log files.
  259. IncludeGlobalServiceEvents *bool `type:"boolean"`
  260. // Specifies the name of the trail.
  261. Name *string `type:"string"`
  262. // Specifies the name of the Amazon S3 bucket designated for publishing log
  263. // files.
  264. S3BucketName *string `type:"string"`
  265. // Specifies the Amazon S3 key prefix that precedes the name of the bucket you
  266. // have designated for log file delivery.
  267. S3KeyPrefix *string `type:"string"`
  268. // Specifies the name of the Amazon SNS topic defined for notification of log
  269. // file delivery.
  270. SnsTopicName *string `type:"string"`
  271. metadataCreateTrailOutput `json:"-" xml:"-"`
  272. }
  273. type metadataCreateTrailOutput struct {
  274. SDKShapeTraits bool `type:"structure"`
  275. }
  276. // String returns the string representation
  277. func (s CreateTrailOutput) String() string {
  278. return awsutil.Prettify(s)
  279. }
  280. // GoString returns the string representation
  281. func (s CreateTrailOutput) GoString() string {
  282. return s.String()
  283. }
  284. // The request that specifies the name of a trail to delete.
  285. type DeleteTrailInput struct {
  286. // The name of a trail to be deleted.
  287. Name *string `type:"string" required:"true"`
  288. metadataDeleteTrailInput `json:"-" xml:"-"`
  289. }
  290. type metadataDeleteTrailInput struct {
  291. SDKShapeTraits bool `type:"structure"`
  292. }
  293. // String returns the string representation
  294. func (s DeleteTrailInput) String() string {
  295. return awsutil.Prettify(s)
  296. }
  297. // GoString returns the string representation
  298. func (s DeleteTrailInput) GoString() string {
  299. return s.String()
  300. }
  301. // Returns the objects or data listed below if successful. Otherwise, returns
  302. // an error.
  303. type DeleteTrailOutput struct {
  304. metadataDeleteTrailOutput `json:"-" xml:"-"`
  305. }
  306. type metadataDeleteTrailOutput struct {
  307. SDKShapeTraits bool `type:"structure"`
  308. }
  309. // String returns the string representation
  310. func (s DeleteTrailOutput) String() string {
  311. return awsutil.Prettify(s)
  312. }
  313. // GoString returns the string representation
  314. func (s DeleteTrailOutput) GoString() string {
  315. return s.String()
  316. }
  317. // Returns information about the trail.
  318. type DescribeTrailsInput struct {
  319. // The trail returned.
  320. TrailNameList []*string `locationName:"trailNameList" type:"list"`
  321. metadataDescribeTrailsInput `json:"-" xml:"-"`
  322. }
  323. type metadataDescribeTrailsInput struct {
  324. SDKShapeTraits bool `type:"structure"`
  325. }
  326. // String returns the string representation
  327. func (s DescribeTrailsInput) String() string {
  328. return awsutil.Prettify(s)
  329. }
  330. // GoString returns the string representation
  331. func (s DescribeTrailsInput) GoString() string {
  332. return s.String()
  333. }
  334. // Returns the objects or data listed below if successful. Otherwise, returns
  335. // an error.
  336. type DescribeTrailsOutput struct {
  337. // The list of trails.
  338. TrailList []*Trail `locationName:"trailList" type:"list"`
  339. metadataDescribeTrailsOutput `json:"-" xml:"-"`
  340. }
  341. type metadataDescribeTrailsOutput struct {
  342. SDKShapeTraits bool `type:"structure"`
  343. }
  344. // String returns the string representation
  345. func (s DescribeTrailsOutput) String() string {
  346. return awsutil.Prettify(s)
  347. }
  348. // GoString returns the string representation
  349. func (s DescribeTrailsOutput) GoString() string {
  350. return s.String()
  351. }
  352. // Contains information about an event that was returned by a lookup request.
  353. // The result includes a representation of a CloudTrail event.
  354. type Event struct {
  355. // A JSON string that contains a representation of the event returned.
  356. CloudTrailEvent *string `type:"string"`
  357. // The CloudTrail ID of the event returned.
  358. EventId *string `type:"string"`
  359. // The name of the event returned.
  360. EventName *string `type:"string"`
  361. // The date and time of the event returned.
  362. EventTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  363. // A list of resources referenced by the event returned.
  364. Resources []*Resource `type:"list"`
  365. // A user name or role name of the requester that called the API in the event
  366. // returned.
  367. Username *string `type:"string"`
  368. metadataEvent `json:"-" xml:"-"`
  369. }
  370. type metadataEvent struct {
  371. SDKShapeTraits bool `type:"structure"`
  372. }
  373. // String returns the string representation
  374. func (s Event) String() string {
  375. return awsutil.Prettify(s)
  376. }
  377. // GoString returns the string representation
  378. func (s Event) GoString() string {
  379. return s.String()
  380. }
  381. // The name of a trail about which you want the current status.
  382. type GetTrailStatusInput struct {
  383. // The name of the trail for which you are requesting the current status.
  384. Name *string `type:"string" required:"true"`
  385. metadataGetTrailStatusInput `json:"-" xml:"-"`
  386. }
  387. type metadataGetTrailStatusInput struct {
  388. SDKShapeTraits bool `type:"structure"`
  389. }
  390. // String returns the string representation
  391. func (s GetTrailStatusInput) String() string {
  392. return awsutil.Prettify(s)
  393. }
  394. // GoString returns the string representation
  395. func (s GetTrailStatusInput) GoString() string {
  396. return s.String()
  397. }
  398. // Returns the objects or data listed below if successful. Otherwise, returns
  399. // an error.
  400. type GetTrailStatusOutput struct {
  401. // Whether the CloudTrail is currently logging AWS API calls.
  402. IsLogging *bool `type:"boolean"`
  403. // Displays any CloudWatch Logs error that CloudTrail encountered when attempting
  404. // to deliver logs to CloudWatch Logs.
  405. LatestCloudWatchLogsDeliveryError *string `type:"string"`
  406. // Displays the most recent date and time when CloudTrail delivered logs to
  407. // CloudWatch Logs.
  408. LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  409. // Displays any Amazon S3 error that CloudTrail encountered when attempting
  410. // to deliver log files to the designated bucket. For more information see the
  411. // topic Error Responses (http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html)
  412. // in the Amazon S3 API Reference.
  413. LatestDeliveryError *string `type:"string"`
  414. // Specifies the date and time that CloudTrail last delivered log files to an
  415. // account's Amazon S3 bucket.
  416. LatestDeliveryTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  417. // Displays any Amazon SNS error that CloudTrail encountered when attempting
  418. // to send a notification. For more information about Amazon SNS errors, see
  419. // the Amazon SNS Developer Guide (http://docs.aws.amazon.com/sns/latest/dg/welcome.html).
  420. LatestNotificationError *string `type:"string"`
  421. // Specifies the date and time of the most recent Amazon SNS notification that
  422. // CloudTrail has written a new log file to an account's Amazon S3 bucket.
  423. LatestNotificationTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  424. // Specifies the most recent date and time when CloudTrail started recording
  425. // API calls for an AWS account.
  426. StartLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  427. // Specifies the most recent date and time when CloudTrail stopped recording
  428. // API calls for an AWS account.
  429. StopLoggingTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  430. metadataGetTrailStatusOutput `json:"-" xml:"-"`
  431. }
  432. type metadataGetTrailStatusOutput struct {
  433. SDKShapeTraits bool `type:"structure"`
  434. }
  435. // String returns the string representation
  436. func (s GetTrailStatusOutput) String() string {
  437. return awsutil.Prettify(s)
  438. }
  439. // GoString returns the string representation
  440. func (s GetTrailStatusOutput) GoString() string {
  441. return s.String()
  442. }
  443. // Specifies an attribute and value that filter the events returned.
  444. type LookupAttribute struct {
  445. // Specifies an attribute on which to filter the events returned.
  446. AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"`
  447. // Specifies a value for the specified AttributeKey.
  448. AttributeValue *string `type:"string" required:"true"`
  449. metadataLookupAttribute `json:"-" xml:"-"`
  450. }
  451. type metadataLookupAttribute struct {
  452. SDKShapeTraits bool `type:"structure"`
  453. }
  454. // String returns the string representation
  455. func (s LookupAttribute) String() string {
  456. return awsutil.Prettify(s)
  457. }
  458. // GoString returns the string representation
  459. func (s LookupAttribute) GoString() string {
  460. return s.String()
  461. }
  462. // Contains a request for LookupEvents.
  463. type LookupEventsInput struct {
  464. // Specifies that only events that occur before or at the specified time are
  465. // returned. If the specified end time is before the specified start time, an
  466. // error is returned.
  467. EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  468. // Contains a list of lookup attributes. Currently the list can contain only
  469. // one item.
  470. LookupAttributes []*LookupAttribute `type:"list"`
  471. // The number of events to return. Possible values are 1 through 50. The default
  472. // is 10.
  473. MaxResults *int64 `type:"integer"`
  474. // The token to use to get the next page of results after a previous API call.
  475. // This token must be passed in with the same parameters that were specified
  476. // in the the original call. For example, if the original call specified an
  477. // AttributeKey of 'Username' with a value of 'root', the call with NextToken
  478. // should include those same parameters.
  479. NextToken *string `type:"string"`
  480. // Specifies that only events that occur after or at the specified time are
  481. // returned. If the specified start time is after the specified end time, an
  482. // error is returned.
  483. StartTime *time.Time `type:"timestamp" timestampFormat:"unix"`
  484. metadataLookupEventsInput `json:"-" xml:"-"`
  485. }
  486. type metadataLookupEventsInput struct {
  487. SDKShapeTraits bool `type:"structure"`
  488. }
  489. // String returns the string representation
  490. func (s LookupEventsInput) String() string {
  491. return awsutil.Prettify(s)
  492. }
  493. // GoString returns the string representation
  494. func (s LookupEventsInput) GoString() string {
  495. return s.String()
  496. }
  497. // Contains a response to a LookupEvents action.
  498. type LookupEventsOutput struct {
  499. // A list of events returned based on the lookup attributes specified and the
  500. // CloudTrail event. The events list is sorted by time. The most recent event
  501. // is listed first.
  502. Events []*Event `type:"list"`
  503. // The token to use to get the next page of results after a previous API call.
  504. // If the token does not appear, there are no more results to return. The token
  505. // must be passed in with the same parameters as the previous call. For example,
  506. // if the original call specified an AttributeKey of 'Username' with a value
  507. // of 'root', the call with NextToken should include those same parameters.
  508. NextToken *string `type:"string"`
  509. metadataLookupEventsOutput `json:"-" xml:"-"`
  510. }
  511. type metadataLookupEventsOutput struct {
  512. SDKShapeTraits bool `type:"structure"`
  513. }
  514. // String returns the string representation
  515. func (s LookupEventsOutput) String() string {
  516. return awsutil.Prettify(s)
  517. }
  518. // GoString returns the string representation
  519. func (s LookupEventsOutput) GoString() string {
  520. return s.String()
  521. }
  522. // Specifies the type and name of a resource referenced by an event.
  523. type Resource struct {
  524. // The name of the resource referenced by the event returned. These are user-created
  525. // names whose values will depend on the environment. For example, the resource
  526. // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567"
  527. // for an EC2 Instance.
  528. ResourceName *string `type:"string"`
  529. // The type of a resource referenced by the event returned. When the resource
  530. // type cannot be determined, null is returned. Some examples of resource types
  531. // are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey
  532. // for IAM. For a list of resource types supported for event lookup, see Resource
  533. // Types Supported for Event Lookup (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/lookup_supported_resourcetypes.html).
  534. ResourceType *string `type:"string"`
  535. metadataResource `json:"-" xml:"-"`
  536. }
  537. type metadataResource struct {
  538. SDKShapeTraits bool `type:"structure"`
  539. }
  540. // String returns the string representation
  541. func (s Resource) String() string {
  542. return awsutil.Prettify(s)
  543. }
  544. // GoString returns the string representation
  545. func (s Resource) GoString() string {
  546. return s.String()
  547. }
  548. // The request to CloudTrail to start logging AWS API calls for an account.
  549. type StartLoggingInput struct {
  550. // The name of the trail for which CloudTrail logs AWS API calls.
  551. Name *string `type:"string" required:"true"`
  552. metadataStartLoggingInput `json:"-" xml:"-"`
  553. }
  554. type metadataStartLoggingInput struct {
  555. SDKShapeTraits bool `type:"structure"`
  556. }
  557. // String returns the string representation
  558. func (s StartLoggingInput) String() string {
  559. return awsutil.Prettify(s)
  560. }
  561. // GoString returns the string representation
  562. func (s StartLoggingInput) GoString() string {
  563. return s.String()
  564. }
  565. // Returns the objects or data listed below if successful. Otherwise, returns
  566. // an error.
  567. type StartLoggingOutput struct {
  568. metadataStartLoggingOutput `json:"-" xml:"-"`
  569. }
  570. type metadataStartLoggingOutput struct {
  571. SDKShapeTraits bool `type:"structure"`
  572. }
  573. // String returns the string representation
  574. func (s StartLoggingOutput) String() string {
  575. return awsutil.Prettify(s)
  576. }
  577. // GoString returns the string representation
  578. func (s StartLoggingOutput) GoString() string {
  579. return s.String()
  580. }
  581. // Passes the request to CloudTrail to stop logging AWS API calls for the specified
  582. // account.
  583. type StopLoggingInput struct {
  584. // Communicates to CloudTrail the name of the trail for which to stop logging
  585. // AWS API calls.
  586. Name *string `type:"string" required:"true"`
  587. metadataStopLoggingInput `json:"-" xml:"-"`
  588. }
  589. type metadataStopLoggingInput struct {
  590. SDKShapeTraits bool `type:"structure"`
  591. }
  592. // String returns the string representation
  593. func (s StopLoggingInput) String() string {
  594. return awsutil.Prettify(s)
  595. }
  596. // GoString returns the string representation
  597. func (s StopLoggingInput) GoString() string {
  598. return s.String()
  599. }
  600. // Returns the objects or data listed below if successful. Otherwise, returns
  601. // an error.
  602. type StopLoggingOutput struct {
  603. metadataStopLoggingOutput `json:"-" xml:"-"`
  604. }
  605. type metadataStopLoggingOutput struct {
  606. SDKShapeTraits bool `type:"structure"`
  607. }
  608. // String returns the string representation
  609. func (s StopLoggingOutput) String() string {
  610. return awsutil.Prettify(s)
  611. }
  612. // GoString returns the string representation
  613. func (s StopLoggingOutput) GoString() string {
  614. return s.String()
  615. }
  616. // The settings for a trail.
  617. type Trail struct {
  618. // Specifies an Amazon Resource Name (ARN), a unique identifier that represents
  619. // the log group to which CloudTrail logs will be delivered.
  620. CloudWatchLogsLogGroupArn *string `type:"string"`
  621. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  622. // a user’s log group.
  623. CloudWatchLogsRoleArn *string `type:"string"`
  624. // Set to True to include AWS API calls from AWS global services such as IAM.
  625. // Otherwise, False.
  626. IncludeGlobalServiceEvents *bool `type:"boolean"`
  627. // Name of the trail set by calling CreateTrail.
  628. Name *string `type:"string"`
  629. // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files.
  630. S3BucketName *string `type:"string"`
  631. // Value of the Amazon S3 prefix.
  632. S3KeyPrefix *string `type:"string"`
  633. // Name of the existing Amazon SNS topic that CloudTrail uses to notify the
  634. // account owner when new CloudTrail log files have been delivered.
  635. SnsTopicName *string `type:"string"`
  636. metadataTrail `json:"-" xml:"-"`
  637. }
  638. type metadataTrail struct {
  639. SDKShapeTraits bool `type:"structure"`
  640. }
  641. // String returns the string representation
  642. func (s Trail) String() string {
  643. return awsutil.Prettify(s)
  644. }
  645. // GoString returns the string representation
  646. func (s Trail) GoString() string {
  647. return s.String()
  648. }
  649. // Specifies settings to update for the trail.
  650. type UpdateTrailInput struct {
  651. // Specifies a log group name using an Amazon Resource Name (ARN), a unique
  652. // identifier that represents the log group to which CloudTrail logs will be
  653. // delivered. Not required unless you specify CloudWatchLogsRoleArn.
  654. CloudWatchLogsLogGroupArn *string `type:"string"`
  655. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  656. // a user’s log group.
  657. CloudWatchLogsRoleArn *string `type:"string"`
  658. // Specifies whether the trail is publishing events from global services such
  659. // as IAM to the log files.
  660. IncludeGlobalServiceEvents *bool `type:"boolean"`
  661. // Specifies the name of the trail.
  662. Name *string `type:"string" required:"true"`
  663. // Specifies the name of the Amazon S3 bucket designated for publishing log
  664. // files.
  665. S3BucketName *string `type:"string"`
  666. // Specifies the Amazon S3 key prefix that precedes the name of the bucket you
  667. // have designated for log file delivery.
  668. S3KeyPrefix *string `type:"string"`
  669. // Specifies the name of the Amazon SNS topic defined for notification of log
  670. // file delivery.
  671. SnsTopicName *string `type:"string"`
  672. metadataUpdateTrailInput `json:"-" xml:"-"`
  673. }
  674. type metadataUpdateTrailInput struct {
  675. SDKShapeTraits bool `type:"structure"`
  676. }
  677. // String returns the string representation
  678. func (s UpdateTrailInput) String() string {
  679. return awsutil.Prettify(s)
  680. }
  681. // GoString returns the string representation
  682. func (s UpdateTrailInput) GoString() string {
  683. return s.String()
  684. }
  685. // Returns the objects or data listed below if successful. Otherwise, returns
  686. // an error.
  687. type UpdateTrailOutput struct {
  688. // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail
  689. // logs will be delivered.
  690. CloudWatchLogsLogGroupArn *string `type:"string"`
  691. // Specifies the role for the CloudWatch Logs endpoint to assume to write to
  692. // a user’s log group.
  693. CloudWatchLogsRoleArn *string `type:"string"`
  694. // Specifies whether the trail is publishing events from global services such
  695. // as IAM to the log files.
  696. IncludeGlobalServiceEvents *bool `type:"boolean"`
  697. // Specifies the name of the trail.
  698. Name *string `type:"string"`
  699. // Specifies the name of the Amazon S3 bucket designated for publishing log
  700. // files.
  701. S3BucketName *string `type:"string"`
  702. // Specifies the Amazon S3 key prefix that precedes the name of the bucket you
  703. // have designated for log file delivery.
  704. S3KeyPrefix *string `type:"string"`
  705. // Specifies the name of the Amazon SNS topic defined for notification of log
  706. // file delivery.
  707. SnsTopicName *string `type:"string"`
  708. metadataUpdateTrailOutput `json:"-" xml:"-"`
  709. }
  710. type metadataUpdateTrailOutput struct {
  711. SDKShapeTraits bool `type:"structure"`
  712. }
  713. // String returns the string representation
  714. func (s UpdateTrailOutput) String() string {
  715. return awsutil.Prettify(s)
  716. }
  717. // GoString returns the string representation
  718. func (s UpdateTrailOutput) GoString() string {
  719. return s.String()
  720. }
  721. const (
  722. // @enum LookupAttributeKey
  723. LookupAttributeKeyEventId = "EventId"
  724. // @enum LookupAttributeKey
  725. LookupAttributeKeyEventName = "EventName"
  726. // @enum LookupAttributeKey
  727. LookupAttributeKeyUsername = "Username"
  728. // @enum LookupAttributeKey
  729. LookupAttributeKeyResourceType = "ResourceType"
  730. // @enum LookupAttributeKey
  731. LookupAttributeKeyResourceName = "ResourceName"
  732. )