api.go 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package macie
  3. import (
  4. "fmt"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  10. )
  11. const opAssociateMemberAccount = "AssociateMemberAccount"
  12. // AssociateMemberAccountRequest generates a "aws/request.Request" representing the
  13. // client's request for the AssociateMemberAccount operation. The "output" return
  14. // value will be populated with the request's response once the request completes
  15. // successfully.
  16. //
  17. // Use "Send" method on the returned Request to send the API call to the service.
  18. // the "output" return value is not valid until after Send returns without error.
  19. //
  20. // See AssociateMemberAccount for more information on using the AssociateMemberAccount
  21. // API call, and error handling.
  22. //
  23. // This method is useful when you want to inject custom logic or configuration
  24. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  25. //
  26. //
  27. // // Example sending a request using the AssociateMemberAccountRequest method.
  28. // req, resp := client.AssociateMemberAccountRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateMemberAccount
  36. func (c *Macie) AssociateMemberAccountRequest(input *AssociateMemberAccountInput) (req *request.Request, output *AssociateMemberAccountOutput) {
  37. op := &request.Operation{
  38. Name: opAssociateMemberAccount,
  39. HTTPMethod: "POST",
  40. HTTPPath: "/",
  41. }
  42. if input == nil {
  43. input = &AssociateMemberAccountInput{}
  44. }
  45. output = &AssociateMemberAccountOutput{}
  46. req = c.newRequest(op, input, output)
  47. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  48. return
  49. }
  50. // AssociateMemberAccount API operation for Amazon Macie.
  51. //
  52. // Associates a specified AWS account with Amazon Macie as a member account.
  53. //
  54. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  55. // with awserr.Error's Code and Message methods to get detailed information about
  56. // the error.
  57. //
  58. // See the AWS API reference guide for Amazon Macie's
  59. // API operation AssociateMemberAccount for usage and error information.
  60. //
  61. // Returned Error Codes:
  62. // * ErrCodeInvalidInputException "InvalidInputException"
  63. // The request was rejected because an invalid or out-of-range value was supplied
  64. // for an input parameter.
  65. //
  66. // * ErrCodeLimitExceededException "LimitExceededException"
  67. // The request was rejected because it attempted to create resources beyond
  68. // the current AWS account limits. The error code describes the limit exceeded.
  69. //
  70. // * ErrCodeInternalException "InternalException"
  71. // Internal server error.
  72. //
  73. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateMemberAccount
  74. func (c *Macie) AssociateMemberAccount(input *AssociateMemberAccountInput) (*AssociateMemberAccountOutput, error) {
  75. req, out := c.AssociateMemberAccountRequest(input)
  76. return out, req.Send()
  77. }
  78. // AssociateMemberAccountWithContext is the same as AssociateMemberAccount with the addition of
  79. // the ability to pass a context and additional request options.
  80. //
  81. // See AssociateMemberAccount for details on how to use this API operation.
  82. //
  83. // The context must be non-nil and will be used for request cancellation. If
  84. // the context is nil a panic will occur. In the future the SDK may create
  85. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  86. // for more information on using Contexts.
  87. func (c *Macie) AssociateMemberAccountWithContext(ctx aws.Context, input *AssociateMemberAccountInput, opts ...request.Option) (*AssociateMemberAccountOutput, error) {
  88. req, out := c.AssociateMemberAccountRequest(input)
  89. req.SetContext(ctx)
  90. req.ApplyOptions(opts...)
  91. return out, req.Send()
  92. }
  93. const opAssociateS3Resources = "AssociateS3Resources"
  94. // AssociateS3ResourcesRequest generates a "aws/request.Request" representing the
  95. // client's request for the AssociateS3Resources operation. The "output" return
  96. // value will be populated with the request's response once the request completes
  97. // successfully.
  98. //
  99. // Use "Send" method on the returned Request to send the API call to the service.
  100. // the "output" return value is not valid until after Send returns without error.
  101. //
  102. // See AssociateS3Resources for more information on using the AssociateS3Resources
  103. // API call, and error handling.
  104. //
  105. // This method is useful when you want to inject custom logic or configuration
  106. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  107. //
  108. //
  109. // // Example sending a request using the AssociateS3ResourcesRequest method.
  110. // req, resp := client.AssociateS3ResourcesRequest(params)
  111. //
  112. // err := req.Send()
  113. // if err == nil { // resp is now filled
  114. // fmt.Println(resp)
  115. // }
  116. //
  117. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateS3Resources
  118. func (c *Macie) AssociateS3ResourcesRequest(input *AssociateS3ResourcesInput) (req *request.Request, output *AssociateS3ResourcesOutput) {
  119. op := &request.Operation{
  120. Name: opAssociateS3Resources,
  121. HTTPMethod: "POST",
  122. HTTPPath: "/",
  123. }
  124. if input == nil {
  125. input = &AssociateS3ResourcesInput{}
  126. }
  127. output = &AssociateS3ResourcesOutput{}
  128. req = c.newRequest(op, input, output)
  129. return
  130. }
  131. // AssociateS3Resources API operation for Amazon Macie.
  132. //
  133. // Associates specified S3 resources with Amazon Macie for monitoring and data
  134. // classification. If memberAccountId isn't specified, the action associates
  135. // specified S3 resources with Macie for the current master account. If memberAccountId
  136. // is specified, the action associates specified S3 resources with Macie for
  137. // the specified member account.
  138. //
  139. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  140. // with awserr.Error's Code and Message methods to get detailed information about
  141. // the error.
  142. //
  143. // See the AWS API reference guide for Amazon Macie's
  144. // API operation AssociateS3Resources for usage and error information.
  145. //
  146. // Returned Error Codes:
  147. // * ErrCodeInvalidInputException "InvalidInputException"
  148. // The request was rejected because an invalid or out-of-range value was supplied
  149. // for an input parameter.
  150. //
  151. // * ErrCodeAccessDeniedException "AccessDeniedException"
  152. // You do not have required permissions to access the requested resource.
  153. //
  154. // * ErrCodeLimitExceededException "LimitExceededException"
  155. // The request was rejected because it attempted to create resources beyond
  156. // the current AWS account limits. The error code describes the limit exceeded.
  157. //
  158. // * ErrCodeInternalException "InternalException"
  159. // Internal server error.
  160. //
  161. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateS3Resources
  162. func (c *Macie) AssociateS3Resources(input *AssociateS3ResourcesInput) (*AssociateS3ResourcesOutput, error) {
  163. req, out := c.AssociateS3ResourcesRequest(input)
  164. return out, req.Send()
  165. }
  166. // AssociateS3ResourcesWithContext is the same as AssociateS3Resources with the addition of
  167. // the ability to pass a context and additional request options.
  168. //
  169. // See AssociateS3Resources for details on how to use this API operation.
  170. //
  171. // The context must be non-nil and will be used for request cancellation. If
  172. // the context is nil a panic will occur. In the future the SDK may create
  173. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  174. // for more information on using Contexts.
  175. func (c *Macie) AssociateS3ResourcesWithContext(ctx aws.Context, input *AssociateS3ResourcesInput, opts ...request.Option) (*AssociateS3ResourcesOutput, error) {
  176. req, out := c.AssociateS3ResourcesRequest(input)
  177. req.SetContext(ctx)
  178. req.ApplyOptions(opts...)
  179. return out, req.Send()
  180. }
  181. const opDisassociateMemberAccount = "DisassociateMemberAccount"
  182. // DisassociateMemberAccountRequest generates a "aws/request.Request" representing the
  183. // client's request for the DisassociateMemberAccount operation. The "output" return
  184. // value will be populated with the request's response once the request completes
  185. // successfully.
  186. //
  187. // Use "Send" method on the returned Request to send the API call to the service.
  188. // the "output" return value is not valid until after Send returns without error.
  189. //
  190. // See DisassociateMemberAccount for more information on using the DisassociateMemberAccount
  191. // API call, and error handling.
  192. //
  193. // This method is useful when you want to inject custom logic or configuration
  194. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  195. //
  196. //
  197. // // Example sending a request using the DisassociateMemberAccountRequest method.
  198. // req, resp := client.DisassociateMemberAccountRequest(params)
  199. //
  200. // err := req.Send()
  201. // if err == nil { // resp is now filled
  202. // fmt.Println(resp)
  203. // }
  204. //
  205. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateMemberAccount
  206. func (c *Macie) DisassociateMemberAccountRequest(input *DisassociateMemberAccountInput) (req *request.Request, output *DisassociateMemberAccountOutput) {
  207. op := &request.Operation{
  208. Name: opDisassociateMemberAccount,
  209. HTTPMethod: "POST",
  210. HTTPPath: "/",
  211. }
  212. if input == nil {
  213. input = &DisassociateMemberAccountInput{}
  214. }
  215. output = &DisassociateMemberAccountOutput{}
  216. req = c.newRequest(op, input, output)
  217. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  218. return
  219. }
  220. // DisassociateMemberAccount API operation for Amazon Macie.
  221. //
  222. // Removes the specified member account from Amazon Macie.
  223. //
  224. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  225. // with awserr.Error's Code and Message methods to get detailed information about
  226. // the error.
  227. //
  228. // See the AWS API reference guide for Amazon Macie's
  229. // API operation DisassociateMemberAccount for usage and error information.
  230. //
  231. // Returned Error Codes:
  232. // * ErrCodeInvalidInputException "InvalidInputException"
  233. // The request was rejected because an invalid or out-of-range value was supplied
  234. // for an input parameter.
  235. //
  236. // * ErrCodeInternalException "InternalException"
  237. // Internal server error.
  238. //
  239. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateMemberAccount
  240. func (c *Macie) DisassociateMemberAccount(input *DisassociateMemberAccountInput) (*DisassociateMemberAccountOutput, error) {
  241. req, out := c.DisassociateMemberAccountRequest(input)
  242. return out, req.Send()
  243. }
  244. // DisassociateMemberAccountWithContext is the same as DisassociateMemberAccount with the addition of
  245. // the ability to pass a context and additional request options.
  246. //
  247. // See DisassociateMemberAccount for details on how to use this API operation.
  248. //
  249. // The context must be non-nil and will be used for request cancellation. If
  250. // the context is nil a panic will occur. In the future the SDK may create
  251. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  252. // for more information on using Contexts.
  253. func (c *Macie) DisassociateMemberAccountWithContext(ctx aws.Context, input *DisassociateMemberAccountInput, opts ...request.Option) (*DisassociateMemberAccountOutput, error) {
  254. req, out := c.DisassociateMemberAccountRequest(input)
  255. req.SetContext(ctx)
  256. req.ApplyOptions(opts...)
  257. return out, req.Send()
  258. }
  259. const opDisassociateS3Resources = "DisassociateS3Resources"
  260. // DisassociateS3ResourcesRequest generates a "aws/request.Request" representing the
  261. // client's request for the DisassociateS3Resources operation. The "output" return
  262. // value will be populated with the request's response once the request completes
  263. // successfully.
  264. //
  265. // Use "Send" method on the returned Request to send the API call to the service.
  266. // the "output" return value is not valid until after Send returns without error.
  267. //
  268. // See DisassociateS3Resources for more information on using the DisassociateS3Resources
  269. // API call, and error handling.
  270. //
  271. // This method is useful when you want to inject custom logic or configuration
  272. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  273. //
  274. //
  275. // // Example sending a request using the DisassociateS3ResourcesRequest method.
  276. // req, resp := client.DisassociateS3ResourcesRequest(params)
  277. //
  278. // err := req.Send()
  279. // if err == nil { // resp is now filled
  280. // fmt.Println(resp)
  281. // }
  282. //
  283. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateS3Resources
  284. func (c *Macie) DisassociateS3ResourcesRequest(input *DisassociateS3ResourcesInput) (req *request.Request, output *DisassociateS3ResourcesOutput) {
  285. op := &request.Operation{
  286. Name: opDisassociateS3Resources,
  287. HTTPMethod: "POST",
  288. HTTPPath: "/",
  289. }
  290. if input == nil {
  291. input = &DisassociateS3ResourcesInput{}
  292. }
  293. output = &DisassociateS3ResourcesOutput{}
  294. req = c.newRequest(op, input, output)
  295. return
  296. }
  297. // DisassociateS3Resources API operation for Amazon Macie.
  298. //
  299. // Removes specified S3 resources from being monitored by Amazon Macie. If memberAccountId
  300. // isn't specified, the action removes specified S3 resources from Macie for
  301. // the current master account. If memberAccountId is specified, the action removes
  302. // specified S3 resources from Macie for the specified member account.
  303. //
  304. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  305. // with awserr.Error's Code and Message methods to get detailed information about
  306. // the error.
  307. //
  308. // See the AWS API reference guide for Amazon Macie's
  309. // API operation DisassociateS3Resources for usage and error information.
  310. //
  311. // Returned Error Codes:
  312. // * ErrCodeInvalidInputException "InvalidInputException"
  313. // The request was rejected because an invalid or out-of-range value was supplied
  314. // for an input parameter.
  315. //
  316. // * ErrCodeAccessDeniedException "AccessDeniedException"
  317. // You do not have required permissions to access the requested resource.
  318. //
  319. // * ErrCodeInternalException "InternalException"
  320. // Internal server error.
  321. //
  322. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateS3Resources
  323. func (c *Macie) DisassociateS3Resources(input *DisassociateS3ResourcesInput) (*DisassociateS3ResourcesOutput, error) {
  324. req, out := c.DisassociateS3ResourcesRequest(input)
  325. return out, req.Send()
  326. }
  327. // DisassociateS3ResourcesWithContext is the same as DisassociateS3Resources with the addition of
  328. // the ability to pass a context and additional request options.
  329. //
  330. // See DisassociateS3Resources for details on how to use this API operation.
  331. //
  332. // The context must be non-nil and will be used for request cancellation. If
  333. // the context is nil a panic will occur. In the future the SDK may create
  334. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  335. // for more information on using Contexts.
  336. func (c *Macie) DisassociateS3ResourcesWithContext(ctx aws.Context, input *DisassociateS3ResourcesInput, opts ...request.Option) (*DisassociateS3ResourcesOutput, error) {
  337. req, out := c.DisassociateS3ResourcesRequest(input)
  338. req.SetContext(ctx)
  339. req.ApplyOptions(opts...)
  340. return out, req.Send()
  341. }
  342. const opListMemberAccounts = "ListMemberAccounts"
  343. // ListMemberAccountsRequest generates a "aws/request.Request" representing the
  344. // client's request for the ListMemberAccounts operation. The "output" return
  345. // value will be populated with the request's response once the request completes
  346. // successfully.
  347. //
  348. // Use "Send" method on the returned Request to send the API call to the service.
  349. // the "output" return value is not valid until after Send returns without error.
  350. //
  351. // See ListMemberAccounts for more information on using the ListMemberAccounts
  352. // API call, and error handling.
  353. //
  354. // This method is useful when you want to inject custom logic or configuration
  355. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  356. //
  357. //
  358. // // Example sending a request using the ListMemberAccountsRequest method.
  359. // req, resp := client.ListMemberAccountsRequest(params)
  360. //
  361. // err := req.Send()
  362. // if err == nil { // resp is now filled
  363. // fmt.Println(resp)
  364. // }
  365. //
  366. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/ListMemberAccounts
  367. func (c *Macie) ListMemberAccountsRequest(input *ListMemberAccountsInput) (req *request.Request, output *ListMemberAccountsOutput) {
  368. op := &request.Operation{
  369. Name: opListMemberAccounts,
  370. HTTPMethod: "POST",
  371. HTTPPath: "/",
  372. Paginator: &request.Paginator{
  373. InputTokens: []string{"nextToken"},
  374. OutputTokens: []string{"nextToken"},
  375. LimitToken: "maxResults",
  376. TruncationToken: "",
  377. },
  378. }
  379. if input == nil {
  380. input = &ListMemberAccountsInput{}
  381. }
  382. output = &ListMemberAccountsOutput{}
  383. req = c.newRequest(op, input, output)
  384. return
  385. }
  386. // ListMemberAccounts API operation for Amazon Macie.
  387. //
  388. // Lists all Amazon Macie member accounts for the current Amazon Macie master
  389. // account.
  390. //
  391. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  392. // with awserr.Error's Code and Message methods to get detailed information about
  393. // the error.
  394. //
  395. // See the AWS API reference guide for Amazon Macie's
  396. // API operation ListMemberAccounts for usage and error information.
  397. //
  398. // Returned Error Codes:
  399. // * ErrCodeInternalException "InternalException"
  400. // Internal server error.
  401. //
  402. // * ErrCodeInvalidInputException "InvalidInputException"
  403. // The request was rejected because an invalid or out-of-range value was supplied
  404. // for an input parameter.
  405. //
  406. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/ListMemberAccounts
  407. func (c *Macie) ListMemberAccounts(input *ListMemberAccountsInput) (*ListMemberAccountsOutput, error) {
  408. req, out := c.ListMemberAccountsRequest(input)
  409. return out, req.Send()
  410. }
  411. // ListMemberAccountsWithContext is the same as ListMemberAccounts with the addition of
  412. // the ability to pass a context and additional request options.
  413. //
  414. // See ListMemberAccounts for details on how to use this API operation.
  415. //
  416. // The context must be non-nil and will be used for request cancellation. If
  417. // the context is nil a panic will occur. In the future the SDK may create
  418. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  419. // for more information on using Contexts.
  420. func (c *Macie) ListMemberAccountsWithContext(ctx aws.Context, input *ListMemberAccountsInput, opts ...request.Option) (*ListMemberAccountsOutput, error) {
  421. req, out := c.ListMemberAccountsRequest(input)
  422. req.SetContext(ctx)
  423. req.ApplyOptions(opts...)
  424. return out, req.Send()
  425. }
  426. // ListMemberAccountsPages iterates over the pages of a ListMemberAccounts operation,
  427. // calling the "fn" function with the response data for each page. To stop
  428. // iterating, return false from the fn function.
  429. //
  430. // See ListMemberAccounts method for more information on how to use this operation.
  431. //
  432. // Note: This operation can generate multiple requests to a service.
  433. //
  434. // // Example iterating over at most 3 pages of a ListMemberAccounts operation.
  435. // pageNum := 0
  436. // err := client.ListMemberAccountsPages(params,
  437. // func(page *ListMemberAccountsOutput, lastPage bool) bool {
  438. // pageNum++
  439. // fmt.Println(page)
  440. // return pageNum <= 3
  441. // })
  442. //
  443. func (c *Macie) ListMemberAccountsPages(input *ListMemberAccountsInput, fn func(*ListMemberAccountsOutput, bool) bool) error {
  444. return c.ListMemberAccountsPagesWithContext(aws.BackgroundContext(), input, fn)
  445. }
  446. // ListMemberAccountsPagesWithContext same as ListMemberAccountsPages except
  447. // it takes a Context and allows setting request options on the pages.
  448. //
  449. // The context must be non-nil and will be used for request cancellation. If
  450. // the context is nil a panic will occur. In the future the SDK may create
  451. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  452. // for more information on using Contexts.
  453. func (c *Macie) ListMemberAccountsPagesWithContext(ctx aws.Context, input *ListMemberAccountsInput, fn func(*ListMemberAccountsOutput, bool) bool, opts ...request.Option) error {
  454. p := request.Pagination{
  455. NewRequest: func() (*request.Request, error) {
  456. var inCpy *ListMemberAccountsInput
  457. if input != nil {
  458. tmp := *input
  459. inCpy = &tmp
  460. }
  461. req, _ := c.ListMemberAccountsRequest(inCpy)
  462. req.SetContext(ctx)
  463. req.ApplyOptions(opts...)
  464. return req, nil
  465. },
  466. }
  467. cont := true
  468. for p.Next() && cont {
  469. cont = fn(p.Page().(*ListMemberAccountsOutput), !p.HasNextPage())
  470. }
  471. return p.Err()
  472. }
  473. const opListS3Resources = "ListS3Resources"
  474. // ListS3ResourcesRequest generates a "aws/request.Request" representing the
  475. // client's request for the ListS3Resources operation. The "output" return
  476. // value will be populated with the request's response once the request completes
  477. // successfully.
  478. //
  479. // Use "Send" method on the returned Request to send the API call to the service.
  480. // the "output" return value is not valid until after Send returns without error.
  481. //
  482. // See ListS3Resources for more information on using the ListS3Resources
  483. // API call, and error handling.
  484. //
  485. // This method is useful when you want to inject custom logic or configuration
  486. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  487. //
  488. //
  489. // // Example sending a request using the ListS3ResourcesRequest method.
  490. // req, resp := client.ListS3ResourcesRequest(params)
  491. //
  492. // err := req.Send()
  493. // if err == nil { // resp is now filled
  494. // fmt.Println(resp)
  495. // }
  496. //
  497. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/ListS3Resources
  498. func (c *Macie) ListS3ResourcesRequest(input *ListS3ResourcesInput) (req *request.Request, output *ListS3ResourcesOutput) {
  499. op := &request.Operation{
  500. Name: opListS3Resources,
  501. HTTPMethod: "POST",
  502. HTTPPath: "/",
  503. Paginator: &request.Paginator{
  504. InputTokens: []string{"nextToken"},
  505. OutputTokens: []string{"nextToken"},
  506. LimitToken: "maxResults",
  507. TruncationToken: "",
  508. },
  509. }
  510. if input == nil {
  511. input = &ListS3ResourcesInput{}
  512. }
  513. output = &ListS3ResourcesOutput{}
  514. req = c.newRequest(op, input, output)
  515. return
  516. }
  517. // ListS3Resources API operation for Amazon Macie.
  518. //
  519. // Lists all the S3 resources associated with Amazon Macie. If memberAccountId
  520. // isn't specified, the action lists the S3 resources associated with Amazon
  521. // Macie for the current master account. If memberAccountId is specified, the
  522. // action lists the S3 resources associated with Amazon Macie for the specified
  523. // member account.
  524. //
  525. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  526. // with awserr.Error's Code and Message methods to get detailed information about
  527. // the error.
  528. //
  529. // See the AWS API reference guide for Amazon Macie's
  530. // API operation ListS3Resources for usage and error information.
  531. //
  532. // Returned Error Codes:
  533. // * ErrCodeInvalidInputException "InvalidInputException"
  534. // The request was rejected because an invalid or out-of-range value was supplied
  535. // for an input parameter.
  536. //
  537. // * ErrCodeAccessDeniedException "AccessDeniedException"
  538. // You do not have required permissions to access the requested resource.
  539. //
  540. // * ErrCodeInternalException "InternalException"
  541. // Internal server error.
  542. //
  543. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/ListS3Resources
  544. func (c *Macie) ListS3Resources(input *ListS3ResourcesInput) (*ListS3ResourcesOutput, error) {
  545. req, out := c.ListS3ResourcesRequest(input)
  546. return out, req.Send()
  547. }
  548. // ListS3ResourcesWithContext is the same as ListS3Resources with the addition of
  549. // the ability to pass a context and additional request options.
  550. //
  551. // See ListS3Resources for details on how to use this API operation.
  552. //
  553. // The context must be non-nil and will be used for request cancellation. If
  554. // the context is nil a panic will occur. In the future the SDK may create
  555. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  556. // for more information on using Contexts.
  557. func (c *Macie) ListS3ResourcesWithContext(ctx aws.Context, input *ListS3ResourcesInput, opts ...request.Option) (*ListS3ResourcesOutput, error) {
  558. req, out := c.ListS3ResourcesRequest(input)
  559. req.SetContext(ctx)
  560. req.ApplyOptions(opts...)
  561. return out, req.Send()
  562. }
  563. // ListS3ResourcesPages iterates over the pages of a ListS3Resources operation,
  564. // calling the "fn" function with the response data for each page. To stop
  565. // iterating, return false from the fn function.
  566. //
  567. // See ListS3Resources method for more information on how to use this operation.
  568. //
  569. // Note: This operation can generate multiple requests to a service.
  570. //
  571. // // Example iterating over at most 3 pages of a ListS3Resources operation.
  572. // pageNum := 0
  573. // err := client.ListS3ResourcesPages(params,
  574. // func(page *ListS3ResourcesOutput, lastPage bool) bool {
  575. // pageNum++
  576. // fmt.Println(page)
  577. // return pageNum <= 3
  578. // })
  579. //
  580. func (c *Macie) ListS3ResourcesPages(input *ListS3ResourcesInput, fn func(*ListS3ResourcesOutput, bool) bool) error {
  581. return c.ListS3ResourcesPagesWithContext(aws.BackgroundContext(), input, fn)
  582. }
  583. // ListS3ResourcesPagesWithContext same as ListS3ResourcesPages except
  584. // it takes a Context and allows setting request options on the pages.
  585. //
  586. // The context must be non-nil and will be used for request cancellation. If
  587. // the context is nil a panic will occur. In the future the SDK may create
  588. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  589. // for more information on using Contexts.
  590. func (c *Macie) ListS3ResourcesPagesWithContext(ctx aws.Context, input *ListS3ResourcesInput, fn func(*ListS3ResourcesOutput, bool) bool, opts ...request.Option) error {
  591. p := request.Pagination{
  592. NewRequest: func() (*request.Request, error) {
  593. var inCpy *ListS3ResourcesInput
  594. if input != nil {
  595. tmp := *input
  596. inCpy = &tmp
  597. }
  598. req, _ := c.ListS3ResourcesRequest(inCpy)
  599. req.SetContext(ctx)
  600. req.ApplyOptions(opts...)
  601. return req, nil
  602. },
  603. }
  604. cont := true
  605. for p.Next() && cont {
  606. cont = fn(p.Page().(*ListS3ResourcesOutput), !p.HasNextPage())
  607. }
  608. return p.Err()
  609. }
  610. const opUpdateS3Resources = "UpdateS3Resources"
  611. // UpdateS3ResourcesRequest generates a "aws/request.Request" representing the
  612. // client's request for the UpdateS3Resources operation. The "output" return
  613. // value will be populated with the request's response once the request completes
  614. // successfully.
  615. //
  616. // Use "Send" method on the returned Request to send the API call to the service.
  617. // the "output" return value is not valid until after Send returns without error.
  618. //
  619. // See UpdateS3Resources for more information on using the UpdateS3Resources
  620. // API call, and error handling.
  621. //
  622. // This method is useful when you want to inject custom logic or configuration
  623. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  624. //
  625. //
  626. // // Example sending a request using the UpdateS3ResourcesRequest method.
  627. // req, resp := client.UpdateS3ResourcesRequest(params)
  628. //
  629. // err := req.Send()
  630. // if err == nil { // resp is now filled
  631. // fmt.Println(resp)
  632. // }
  633. //
  634. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/UpdateS3Resources
  635. func (c *Macie) UpdateS3ResourcesRequest(input *UpdateS3ResourcesInput) (req *request.Request, output *UpdateS3ResourcesOutput) {
  636. op := &request.Operation{
  637. Name: opUpdateS3Resources,
  638. HTTPMethod: "POST",
  639. HTTPPath: "/",
  640. }
  641. if input == nil {
  642. input = &UpdateS3ResourcesInput{}
  643. }
  644. output = &UpdateS3ResourcesOutput{}
  645. req = c.newRequest(op, input, output)
  646. return
  647. }
  648. // UpdateS3Resources API operation for Amazon Macie.
  649. //
  650. // Updates the classification types for the specified S3 resources. If memberAccountId
  651. // isn't specified, the action updates the classification types of the S3 resources
  652. // associated with Amazon Macie for the current master account. If memberAccountId
  653. // is specified, the action updates the classification types of the S3 resources
  654. // associated with Amazon Macie for the specified member account.
  655. //
  656. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  657. // with awserr.Error's Code and Message methods to get detailed information about
  658. // the error.
  659. //
  660. // See the AWS API reference guide for Amazon Macie's
  661. // API operation UpdateS3Resources for usage and error information.
  662. //
  663. // Returned Error Codes:
  664. // * ErrCodeInvalidInputException "InvalidInputException"
  665. // The request was rejected because an invalid or out-of-range value was supplied
  666. // for an input parameter.
  667. //
  668. // * ErrCodeAccessDeniedException "AccessDeniedException"
  669. // You do not have required permissions to access the requested resource.
  670. //
  671. // * ErrCodeInternalException "InternalException"
  672. // Internal server error.
  673. //
  674. // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/UpdateS3Resources
  675. func (c *Macie) UpdateS3Resources(input *UpdateS3ResourcesInput) (*UpdateS3ResourcesOutput, error) {
  676. req, out := c.UpdateS3ResourcesRequest(input)
  677. return out, req.Send()
  678. }
  679. // UpdateS3ResourcesWithContext is the same as UpdateS3Resources with the addition of
  680. // the ability to pass a context and additional request options.
  681. //
  682. // See UpdateS3Resources for details on how to use this API operation.
  683. //
  684. // The context must be non-nil and will be used for request cancellation. If
  685. // the context is nil a panic will occur. In the future the SDK may create
  686. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  687. // for more information on using Contexts.
  688. func (c *Macie) UpdateS3ResourcesWithContext(ctx aws.Context, input *UpdateS3ResourcesInput, opts ...request.Option) (*UpdateS3ResourcesOutput, error) {
  689. req, out := c.UpdateS3ResourcesRequest(input)
  690. req.SetContext(ctx)
  691. req.ApplyOptions(opts...)
  692. return out, req.Send()
  693. }
  694. type AssociateMemberAccountInput struct {
  695. _ struct{} `type:"structure"`
  696. // The ID of the AWS account that you want to associate with Amazon Macie as
  697. // a member account.
  698. //
  699. // MemberAccountId is a required field
  700. MemberAccountId *string `locationName:"memberAccountId" type:"string" required:"true"`
  701. }
  702. // String returns the string representation
  703. func (s AssociateMemberAccountInput) String() string {
  704. return awsutil.Prettify(s)
  705. }
  706. // GoString returns the string representation
  707. func (s AssociateMemberAccountInput) GoString() string {
  708. return s.String()
  709. }
  710. // Validate inspects the fields of the type to determine if they are valid.
  711. func (s *AssociateMemberAccountInput) Validate() error {
  712. invalidParams := request.ErrInvalidParams{Context: "AssociateMemberAccountInput"}
  713. if s.MemberAccountId == nil {
  714. invalidParams.Add(request.NewErrParamRequired("MemberAccountId"))
  715. }
  716. if invalidParams.Len() > 0 {
  717. return invalidParams
  718. }
  719. return nil
  720. }
  721. // SetMemberAccountId sets the MemberAccountId field's value.
  722. func (s *AssociateMemberAccountInput) SetMemberAccountId(v string) *AssociateMemberAccountInput {
  723. s.MemberAccountId = &v
  724. return s
  725. }
  726. type AssociateMemberAccountOutput struct {
  727. _ struct{} `type:"structure"`
  728. }
  729. // String returns the string representation
  730. func (s AssociateMemberAccountOutput) String() string {
  731. return awsutil.Prettify(s)
  732. }
  733. // GoString returns the string representation
  734. func (s AssociateMemberAccountOutput) GoString() string {
  735. return s.String()
  736. }
  737. type AssociateS3ResourcesInput struct {
  738. _ struct{} `type:"structure"`
  739. // The ID of the Amazon Macie member account whose resources you want to associate
  740. // with Macie.
  741. MemberAccountId *string `locationName:"memberAccountId" type:"string"`
  742. // The S3 resources that you want to associate with Amazon Macie for monitoring
  743. // and data classification.
  744. //
  745. // S3Resources is a required field
  746. S3Resources []*S3ResourceClassification `locationName:"s3Resources" type:"list" required:"true"`
  747. }
  748. // String returns the string representation
  749. func (s AssociateS3ResourcesInput) String() string {
  750. return awsutil.Prettify(s)
  751. }
  752. // GoString returns the string representation
  753. func (s AssociateS3ResourcesInput) GoString() string {
  754. return s.String()
  755. }
  756. // Validate inspects the fields of the type to determine if they are valid.
  757. func (s *AssociateS3ResourcesInput) Validate() error {
  758. invalidParams := request.ErrInvalidParams{Context: "AssociateS3ResourcesInput"}
  759. if s.S3Resources == nil {
  760. invalidParams.Add(request.NewErrParamRequired("S3Resources"))
  761. }
  762. if s.S3Resources != nil {
  763. for i, v := range s.S3Resources {
  764. if v == nil {
  765. continue
  766. }
  767. if err := v.Validate(); err != nil {
  768. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "S3Resources", i), err.(request.ErrInvalidParams))
  769. }
  770. }
  771. }
  772. if invalidParams.Len() > 0 {
  773. return invalidParams
  774. }
  775. return nil
  776. }
  777. // SetMemberAccountId sets the MemberAccountId field's value.
  778. func (s *AssociateS3ResourcesInput) SetMemberAccountId(v string) *AssociateS3ResourcesInput {
  779. s.MemberAccountId = &v
  780. return s
  781. }
  782. // SetS3Resources sets the S3Resources field's value.
  783. func (s *AssociateS3ResourcesInput) SetS3Resources(v []*S3ResourceClassification) *AssociateS3ResourcesInput {
  784. s.S3Resources = v
  785. return s
  786. }
  787. type AssociateS3ResourcesOutput struct {
  788. _ struct{} `type:"structure"`
  789. // S3 resources that couldn't be associated with Amazon Macie. An error code
  790. // and an error message are provided for each failed item.
  791. FailedS3Resources []*FailedS3Resource `locationName:"failedS3Resources" type:"list"`
  792. }
  793. // String returns the string representation
  794. func (s AssociateS3ResourcesOutput) String() string {
  795. return awsutil.Prettify(s)
  796. }
  797. // GoString returns the string representation
  798. func (s AssociateS3ResourcesOutput) GoString() string {
  799. return s.String()
  800. }
  801. // SetFailedS3Resources sets the FailedS3Resources field's value.
  802. func (s *AssociateS3ResourcesOutput) SetFailedS3Resources(v []*FailedS3Resource) *AssociateS3ResourcesOutput {
  803. s.FailedS3Resources = v
  804. return s
  805. }
  806. // The classification type that Amazon Macie applies to the associated S3 resources.
  807. type ClassificationType struct {
  808. _ struct{} `type:"structure"`
  809. // A continuous classification of the objects that are added to a specified
  810. // S3 bucket. Amazon Macie begins performing continuous classification after
  811. // a bucket is successfully associated with Amazon Macie.
  812. //
  813. // Continuous is a required field
  814. Continuous *string `locationName:"continuous" type:"string" required:"true" enum:"S3ContinuousClassificationType"`
  815. // A one-time classification of all of the existing objects in a specified S3
  816. // bucket.
  817. //
  818. // OneTime is a required field
  819. OneTime *string `locationName:"oneTime" type:"string" required:"true" enum:"S3OneTimeClassificationType"`
  820. }
  821. // String returns the string representation
  822. func (s ClassificationType) String() string {
  823. return awsutil.Prettify(s)
  824. }
  825. // GoString returns the string representation
  826. func (s ClassificationType) GoString() string {
  827. return s.String()
  828. }
  829. // Validate inspects the fields of the type to determine if they are valid.
  830. func (s *ClassificationType) Validate() error {
  831. invalidParams := request.ErrInvalidParams{Context: "ClassificationType"}
  832. if s.Continuous == nil {
  833. invalidParams.Add(request.NewErrParamRequired("Continuous"))
  834. }
  835. if s.OneTime == nil {
  836. invalidParams.Add(request.NewErrParamRequired("OneTime"))
  837. }
  838. if invalidParams.Len() > 0 {
  839. return invalidParams
  840. }
  841. return nil
  842. }
  843. // SetContinuous sets the Continuous field's value.
  844. func (s *ClassificationType) SetContinuous(v string) *ClassificationType {
  845. s.Continuous = &v
  846. return s
  847. }
  848. // SetOneTime sets the OneTime field's value.
  849. func (s *ClassificationType) SetOneTime(v string) *ClassificationType {
  850. s.OneTime = &v
  851. return s
  852. }
  853. // The classification type that Amazon Macie applies to the associated S3 resources.
  854. // At least one of the classification types (oneTime or continuous) must be
  855. // specified.
  856. type ClassificationTypeUpdate struct {
  857. _ struct{} `type:"structure"`
  858. // A continuous classification of the objects that are added to a specified
  859. // S3 bucket. Amazon Macie begins performing continuous classification after
  860. // a bucket is successfully associated with Amazon Macie.
  861. Continuous *string `locationName:"continuous" type:"string" enum:"S3ContinuousClassificationType"`
  862. // A one-time classification of all of the existing objects in a specified S3
  863. // bucket.
  864. OneTime *string `locationName:"oneTime" type:"string" enum:"S3OneTimeClassificationType"`
  865. }
  866. // String returns the string representation
  867. func (s ClassificationTypeUpdate) String() string {
  868. return awsutil.Prettify(s)
  869. }
  870. // GoString returns the string representation
  871. func (s ClassificationTypeUpdate) GoString() string {
  872. return s.String()
  873. }
  874. // SetContinuous sets the Continuous field's value.
  875. func (s *ClassificationTypeUpdate) SetContinuous(v string) *ClassificationTypeUpdate {
  876. s.Continuous = &v
  877. return s
  878. }
  879. // SetOneTime sets the OneTime field's value.
  880. func (s *ClassificationTypeUpdate) SetOneTime(v string) *ClassificationTypeUpdate {
  881. s.OneTime = &v
  882. return s
  883. }
  884. type DisassociateMemberAccountInput struct {
  885. _ struct{} `type:"structure"`
  886. // The ID of the member account that you want to remove from Amazon Macie.
  887. //
  888. // MemberAccountId is a required field
  889. MemberAccountId *string `locationName:"memberAccountId" type:"string" required:"true"`
  890. }
  891. // String returns the string representation
  892. func (s DisassociateMemberAccountInput) String() string {
  893. return awsutil.Prettify(s)
  894. }
  895. // GoString returns the string representation
  896. func (s DisassociateMemberAccountInput) GoString() string {
  897. return s.String()
  898. }
  899. // Validate inspects the fields of the type to determine if they are valid.
  900. func (s *DisassociateMemberAccountInput) Validate() error {
  901. invalidParams := request.ErrInvalidParams{Context: "DisassociateMemberAccountInput"}
  902. if s.MemberAccountId == nil {
  903. invalidParams.Add(request.NewErrParamRequired("MemberAccountId"))
  904. }
  905. if invalidParams.Len() > 0 {
  906. return invalidParams
  907. }
  908. return nil
  909. }
  910. // SetMemberAccountId sets the MemberAccountId field's value.
  911. func (s *DisassociateMemberAccountInput) SetMemberAccountId(v string) *DisassociateMemberAccountInput {
  912. s.MemberAccountId = &v
  913. return s
  914. }
  915. type DisassociateMemberAccountOutput struct {
  916. _ struct{} `type:"structure"`
  917. }
  918. // String returns the string representation
  919. func (s DisassociateMemberAccountOutput) String() string {
  920. return awsutil.Prettify(s)
  921. }
  922. // GoString returns the string representation
  923. func (s DisassociateMemberAccountOutput) GoString() string {
  924. return s.String()
  925. }
  926. type DisassociateS3ResourcesInput struct {
  927. _ struct{} `type:"structure"`
  928. // The S3 resources (buckets or prefixes) that you want to remove from being
  929. // monitored and classified by Amazon Macie.
  930. //
  931. // AssociatedS3Resources is a required field
  932. AssociatedS3Resources []*S3Resource `locationName:"associatedS3Resources" type:"list" required:"true"`
  933. // The ID of the Amazon Macie member account whose resources you want to remove
  934. // from being monitored by Amazon Macie.
  935. MemberAccountId *string `locationName:"memberAccountId" type:"string"`
  936. }
  937. // String returns the string representation
  938. func (s DisassociateS3ResourcesInput) String() string {
  939. return awsutil.Prettify(s)
  940. }
  941. // GoString returns the string representation
  942. func (s DisassociateS3ResourcesInput) GoString() string {
  943. return s.String()
  944. }
  945. // Validate inspects the fields of the type to determine if they are valid.
  946. func (s *DisassociateS3ResourcesInput) Validate() error {
  947. invalidParams := request.ErrInvalidParams{Context: "DisassociateS3ResourcesInput"}
  948. if s.AssociatedS3Resources == nil {
  949. invalidParams.Add(request.NewErrParamRequired("AssociatedS3Resources"))
  950. }
  951. if s.AssociatedS3Resources != nil {
  952. for i, v := range s.AssociatedS3Resources {
  953. if v == nil {
  954. continue
  955. }
  956. if err := v.Validate(); err != nil {
  957. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssociatedS3Resources", i), err.(request.ErrInvalidParams))
  958. }
  959. }
  960. }
  961. if invalidParams.Len() > 0 {
  962. return invalidParams
  963. }
  964. return nil
  965. }
  966. // SetAssociatedS3Resources sets the AssociatedS3Resources field's value.
  967. func (s *DisassociateS3ResourcesInput) SetAssociatedS3Resources(v []*S3Resource) *DisassociateS3ResourcesInput {
  968. s.AssociatedS3Resources = v
  969. return s
  970. }
  971. // SetMemberAccountId sets the MemberAccountId field's value.
  972. func (s *DisassociateS3ResourcesInput) SetMemberAccountId(v string) *DisassociateS3ResourcesInput {
  973. s.MemberAccountId = &v
  974. return s
  975. }
  976. type DisassociateS3ResourcesOutput struct {
  977. _ struct{} `type:"structure"`
  978. // S3 resources that couldn't be removed from being monitored and classified
  979. // by Amazon Macie. An error code and an error message are provided for each
  980. // failed item.
  981. FailedS3Resources []*FailedS3Resource `locationName:"failedS3Resources" type:"list"`
  982. }
  983. // String returns the string representation
  984. func (s DisassociateS3ResourcesOutput) String() string {
  985. return awsutil.Prettify(s)
  986. }
  987. // GoString returns the string representation
  988. func (s DisassociateS3ResourcesOutput) GoString() string {
  989. return s.String()
  990. }
  991. // SetFailedS3Resources sets the FailedS3Resources field's value.
  992. func (s *DisassociateS3ResourcesOutput) SetFailedS3Resources(v []*FailedS3Resource) *DisassociateS3ResourcesOutput {
  993. s.FailedS3Resources = v
  994. return s
  995. }
  996. // Includes details about the failed S3 resources.
  997. type FailedS3Resource struct {
  998. _ struct{} `type:"structure"`
  999. // The status code of a failed item.
  1000. ErrorCode *string `locationName:"errorCode" type:"string"`
  1001. // The error message of a failed item.
  1002. ErrorMessage *string `locationName:"errorMessage" type:"string"`
  1003. // The failed S3 resources.
  1004. FailedItem *S3Resource `locationName:"failedItem" type:"structure"`
  1005. }
  1006. // String returns the string representation
  1007. func (s FailedS3Resource) String() string {
  1008. return awsutil.Prettify(s)
  1009. }
  1010. // GoString returns the string representation
  1011. func (s FailedS3Resource) GoString() string {
  1012. return s.String()
  1013. }
  1014. // SetErrorCode sets the ErrorCode field's value.
  1015. func (s *FailedS3Resource) SetErrorCode(v string) *FailedS3Resource {
  1016. s.ErrorCode = &v
  1017. return s
  1018. }
  1019. // SetErrorMessage sets the ErrorMessage field's value.
  1020. func (s *FailedS3Resource) SetErrorMessage(v string) *FailedS3Resource {
  1021. s.ErrorMessage = &v
  1022. return s
  1023. }
  1024. // SetFailedItem sets the FailedItem field's value.
  1025. func (s *FailedS3Resource) SetFailedItem(v *S3Resource) *FailedS3Resource {
  1026. s.FailedItem = v
  1027. return s
  1028. }
  1029. type ListMemberAccountsInput struct {
  1030. _ struct{} `type:"structure"`
  1031. // Use this parameter to indicate the maximum number of items that you want
  1032. // in the response. The default value is 250.
  1033. MaxResults *int64 `locationName:"maxResults" type:"integer"`
  1034. // Use this parameter when paginating results. Set the value of this parameter
  1035. // to null on your first call to the ListMemberAccounts action. Subsequent calls
  1036. // to the action fill nextToken in the request with the value of nextToken from
  1037. // the previous response to continue listing data.
  1038. NextToken *string `locationName:"nextToken" type:"string"`
  1039. }
  1040. // String returns the string representation
  1041. func (s ListMemberAccountsInput) String() string {
  1042. return awsutil.Prettify(s)
  1043. }
  1044. // GoString returns the string representation
  1045. func (s ListMemberAccountsInput) GoString() string {
  1046. return s.String()
  1047. }
  1048. // SetMaxResults sets the MaxResults field's value.
  1049. func (s *ListMemberAccountsInput) SetMaxResults(v int64) *ListMemberAccountsInput {
  1050. s.MaxResults = &v
  1051. return s
  1052. }
  1053. // SetNextToken sets the NextToken field's value.
  1054. func (s *ListMemberAccountsInput) SetNextToken(v string) *ListMemberAccountsInput {
  1055. s.NextToken = &v
  1056. return s
  1057. }
  1058. type ListMemberAccountsOutput struct {
  1059. _ struct{} `type:"structure"`
  1060. // A list of the Amazon Macie member accounts returned by the action. The current
  1061. // master account is also included in this list.
  1062. MemberAccounts []*MemberAccount `locationName:"memberAccounts" type:"list"`
  1063. // When a response is generated, if there is more data to be listed, this parameter
  1064. // is present in the response and contains the value to use for the nextToken
  1065. // parameter in a subsequent pagination request. If there is no more data to
  1066. // be listed, this parameter is set to null.
  1067. NextToken *string `locationName:"nextToken" type:"string"`
  1068. }
  1069. // String returns the string representation
  1070. func (s ListMemberAccountsOutput) String() string {
  1071. return awsutil.Prettify(s)
  1072. }
  1073. // GoString returns the string representation
  1074. func (s ListMemberAccountsOutput) GoString() string {
  1075. return s.String()
  1076. }
  1077. // SetMemberAccounts sets the MemberAccounts field's value.
  1078. func (s *ListMemberAccountsOutput) SetMemberAccounts(v []*MemberAccount) *ListMemberAccountsOutput {
  1079. s.MemberAccounts = v
  1080. return s
  1081. }
  1082. // SetNextToken sets the NextToken field's value.
  1083. func (s *ListMemberAccountsOutput) SetNextToken(v string) *ListMemberAccountsOutput {
  1084. s.NextToken = &v
  1085. return s
  1086. }
  1087. type ListS3ResourcesInput struct {
  1088. _ struct{} `type:"structure"`
  1089. // Use this parameter to indicate the maximum number of items that you want
  1090. // in the response. The default value is 250.
  1091. MaxResults *int64 `locationName:"maxResults" type:"integer"`
  1092. // The Amazon Macie member account ID whose associated S3 resources you want
  1093. // to list.
  1094. MemberAccountId *string `locationName:"memberAccountId" type:"string"`
  1095. // Use this parameter when paginating results. Set its value to null on your
  1096. // first call to the ListS3Resources action. Subsequent calls to the action
  1097. // fill nextToken in the request with the value of nextToken from the previous
  1098. // response to continue listing data.
  1099. NextToken *string `locationName:"nextToken" type:"string"`
  1100. }
  1101. // String returns the string representation
  1102. func (s ListS3ResourcesInput) String() string {
  1103. return awsutil.Prettify(s)
  1104. }
  1105. // GoString returns the string representation
  1106. func (s ListS3ResourcesInput) GoString() string {
  1107. return s.String()
  1108. }
  1109. // SetMaxResults sets the MaxResults field's value.
  1110. func (s *ListS3ResourcesInput) SetMaxResults(v int64) *ListS3ResourcesInput {
  1111. s.MaxResults = &v
  1112. return s
  1113. }
  1114. // SetMemberAccountId sets the MemberAccountId field's value.
  1115. func (s *ListS3ResourcesInput) SetMemberAccountId(v string) *ListS3ResourcesInput {
  1116. s.MemberAccountId = &v
  1117. return s
  1118. }
  1119. // SetNextToken sets the NextToken field's value.
  1120. func (s *ListS3ResourcesInput) SetNextToken(v string) *ListS3ResourcesInput {
  1121. s.NextToken = &v
  1122. return s
  1123. }
  1124. type ListS3ResourcesOutput struct {
  1125. _ struct{} `type:"structure"`
  1126. // When a response is generated, if there is more data to be listed, this parameter
  1127. // is present in the response and contains the value to use for the nextToken
  1128. // parameter in a subsequent pagination request. If there is no more data to
  1129. // be listed, this parameter is set to null.
  1130. NextToken *string `locationName:"nextToken" type:"string"`
  1131. // A list of the associated S3 resources returned by the action.
  1132. S3Resources []*S3ResourceClassification `locationName:"s3Resources" type:"list"`
  1133. }
  1134. // String returns the string representation
  1135. func (s ListS3ResourcesOutput) String() string {
  1136. return awsutil.Prettify(s)
  1137. }
  1138. // GoString returns the string representation
  1139. func (s ListS3ResourcesOutput) GoString() string {
  1140. return s.String()
  1141. }
  1142. // SetNextToken sets the NextToken field's value.
  1143. func (s *ListS3ResourcesOutput) SetNextToken(v string) *ListS3ResourcesOutput {
  1144. s.NextToken = &v
  1145. return s
  1146. }
  1147. // SetS3Resources sets the S3Resources field's value.
  1148. func (s *ListS3ResourcesOutput) SetS3Resources(v []*S3ResourceClassification) *ListS3ResourcesOutput {
  1149. s.S3Resources = v
  1150. return s
  1151. }
  1152. // Contains information about the Amazon Macie member account.
  1153. type MemberAccount struct {
  1154. _ struct{} `type:"structure"`
  1155. // The AWS account ID of the Amazon Macie member account.
  1156. AccountId *string `locationName:"accountId" type:"string"`
  1157. }
  1158. // String returns the string representation
  1159. func (s MemberAccount) String() string {
  1160. return awsutil.Prettify(s)
  1161. }
  1162. // GoString returns the string representation
  1163. func (s MemberAccount) GoString() string {
  1164. return s.String()
  1165. }
  1166. // SetAccountId sets the AccountId field's value.
  1167. func (s *MemberAccount) SetAccountId(v string) *MemberAccount {
  1168. s.AccountId = &v
  1169. return s
  1170. }
  1171. // Contains information about the S3 resource. This data type is used as a request
  1172. // parameter in the DisassociateS3Resources action and can be used as a response
  1173. // parameter in the AssociateS3Resources and UpdateS3Resources actions.
  1174. type S3Resource struct {
  1175. _ struct{} `type:"structure"`
  1176. // The name of the S3 bucket.
  1177. //
  1178. // BucketName is a required field
  1179. BucketName *string `locationName:"bucketName" type:"string" required:"true"`
  1180. // The prefix of the S3 bucket.
  1181. Prefix *string `locationName:"prefix" type:"string"`
  1182. }
  1183. // String returns the string representation
  1184. func (s S3Resource) String() string {
  1185. return awsutil.Prettify(s)
  1186. }
  1187. // GoString returns the string representation
  1188. func (s S3Resource) GoString() string {
  1189. return s.String()
  1190. }
  1191. // Validate inspects the fields of the type to determine if they are valid.
  1192. func (s *S3Resource) Validate() error {
  1193. invalidParams := request.ErrInvalidParams{Context: "S3Resource"}
  1194. if s.BucketName == nil {
  1195. invalidParams.Add(request.NewErrParamRequired("BucketName"))
  1196. }
  1197. if invalidParams.Len() > 0 {
  1198. return invalidParams
  1199. }
  1200. return nil
  1201. }
  1202. // SetBucketName sets the BucketName field's value.
  1203. func (s *S3Resource) SetBucketName(v string) *S3Resource {
  1204. s.BucketName = &v
  1205. return s
  1206. }
  1207. // SetPrefix sets the Prefix field's value.
  1208. func (s *S3Resource) SetPrefix(v string) *S3Resource {
  1209. s.Prefix = &v
  1210. return s
  1211. }
  1212. // The S3 resources that you want to associate with Amazon Macie for monitoring
  1213. // and data classification. This data type is used as a request parameter in
  1214. // the AssociateS3Resources action and a response parameter in the ListS3Resources
  1215. // action.
  1216. type S3ResourceClassification struct {
  1217. _ struct{} `type:"structure"`
  1218. // The name of the S3 bucket that you want to associate with Amazon Macie.
  1219. //
  1220. // BucketName is a required field
  1221. BucketName *string `locationName:"bucketName" type:"string" required:"true"`
  1222. // The classification type that you want to specify for the resource associated
  1223. // with Amazon Macie.
  1224. //
  1225. // ClassificationType is a required field
  1226. ClassificationType *ClassificationType `locationName:"classificationType" type:"structure" required:"true"`
  1227. // The prefix of the S3 bucket that you want to associate with Amazon Macie.
  1228. Prefix *string `locationName:"prefix" type:"string"`
  1229. }
  1230. // String returns the string representation
  1231. func (s S3ResourceClassification) String() string {
  1232. return awsutil.Prettify(s)
  1233. }
  1234. // GoString returns the string representation
  1235. func (s S3ResourceClassification) GoString() string {
  1236. return s.String()
  1237. }
  1238. // Validate inspects the fields of the type to determine if they are valid.
  1239. func (s *S3ResourceClassification) Validate() error {
  1240. invalidParams := request.ErrInvalidParams{Context: "S3ResourceClassification"}
  1241. if s.BucketName == nil {
  1242. invalidParams.Add(request.NewErrParamRequired("BucketName"))
  1243. }
  1244. if s.ClassificationType == nil {
  1245. invalidParams.Add(request.NewErrParamRequired("ClassificationType"))
  1246. }
  1247. if s.ClassificationType != nil {
  1248. if err := s.ClassificationType.Validate(); err != nil {
  1249. invalidParams.AddNested("ClassificationType", err.(request.ErrInvalidParams))
  1250. }
  1251. }
  1252. if invalidParams.Len() > 0 {
  1253. return invalidParams
  1254. }
  1255. return nil
  1256. }
  1257. // SetBucketName sets the BucketName field's value.
  1258. func (s *S3ResourceClassification) SetBucketName(v string) *S3ResourceClassification {
  1259. s.BucketName = &v
  1260. return s
  1261. }
  1262. // SetClassificationType sets the ClassificationType field's value.
  1263. func (s *S3ResourceClassification) SetClassificationType(v *ClassificationType) *S3ResourceClassification {
  1264. s.ClassificationType = v
  1265. return s
  1266. }
  1267. // SetPrefix sets the Prefix field's value.
  1268. func (s *S3ResourceClassification) SetPrefix(v string) *S3ResourceClassification {
  1269. s.Prefix = &v
  1270. return s
  1271. }
  1272. // The S3 resources whose classification types you want to update. This data
  1273. // type is used as a request parameter in the UpdateS3Resources action.
  1274. type S3ResourceClassificationUpdate struct {
  1275. _ struct{} `type:"structure"`
  1276. // The name of the S3 bucket whose classification types you want to update.
  1277. //
  1278. // BucketName is a required field
  1279. BucketName *string `locationName:"bucketName" type:"string" required:"true"`
  1280. // The classification type that you want to update for the resource associated
  1281. // with Amazon Macie.
  1282. //
  1283. // ClassificationTypeUpdate is a required field
  1284. ClassificationTypeUpdate *ClassificationTypeUpdate `locationName:"classificationTypeUpdate" type:"structure" required:"true"`
  1285. // The prefix of the S3 bucket whose classification types you want to update.
  1286. Prefix *string `locationName:"prefix" type:"string"`
  1287. }
  1288. // String returns the string representation
  1289. func (s S3ResourceClassificationUpdate) String() string {
  1290. return awsutil.Prettify(s)
  1291. }
  1292. // GoString returns the string representation
  1293. func (s S3ResourceClassificationUpdate) GoString() string {
  1294. return s.String()
  1295. }
  1296. // Validate inspects the fields of the type to determine if they are valid.
  1297. func (s *S3ResourceClassificationUpdate) Validate() error {
  1298. invalidParams := request.ErrInvalidParams{Context: "S3ResourceClassificationUpdate"}
  1299. if s.BucketName == nil {
  1300. invalidParams.Add(request.NewErrParamRequired("BucketName"))
  1301. }
  1302. if s.ClassificationTypeUpdate == nil {
  1303. invalidParams.Add(request.NewErrParamRequired("ClassificationTypeUpdate"))
  1304. }
  1305. if invalidParams.Len() > 0 {
  1306. return invalidParams
  1307. }
  1308. return nil
  1309. }
  1310. // SetBucketName sets the BucketName field's value.
  1311. func (s *S3ResourceClassificationUpdate) SetBucketName(v string) *S3ResourceClassificationUpdate {
  1312. s.BucketName = &v
  1313. return s
  1314. }
  1315. // SetClassificationTypeUpdate sets the ClassificationTypeUpdate field's value.
  1316. func (s *S3ResourceClassificationUpdate) SetClassificationTypeUpdate(v *ClassificationTypeUpdate) *S3ResourceClassificationUpdate {
  1317. s.ClassificationTypeUpdate = v
  1318. return s
  1319. }
  1320. // SetPrefix sets the Prefix field's value.
  1321. func (s *S3ResourceClassificationUpdate) SetPrefix(v string) *S3ResourceClassificationUpdate {
  1322. s.Prefix = &v
  1323. return s
  1324. }
  1325. type UpdateS3ResourcesInput struct {
  1326. _ struct{} `type:"structure"`
  1327. // The AWS ID of the Amazon Macie member account whose S3 resources' classification
  1328. // types you want to update.
  1329. MemberAccountId *string `locationName:"memberAccountId" type:"string"`
  1330. // The S3 resources whose classification types you want to update.
  1331. //
  1332. // S3ResourcesUpdate is a required field
  1333. S3ResourcesUpdate []*S3ResourceClassificationUpdate `locationName:"s3ResourcesUpdate" type:"list" required:"true"`
  1334. }
  1335. // String returns the string representation
  1336. func (s UpdateS3ResourcesInput) String() string {
  1337. return awsutil.Prettify(s)
  1338. }
  1339. // GoString returns the string representation
  1340. func (s UpdateS3ResourcesInput) GoString() string {
  1341. return s.String()
  1342. }
  1343. // Validate inspects the fields of the type to determine if they are valid.
  1344. func (s *UpdateS3ResourcesInput) Validate() error {
  1345. invalidParams := request.ErrInvalidParams{Context: "UpdateS3ResourcesInput"}
  1346. if s.S3ResourcesUpdate == nil {
  1347. invalidParams.Add(request.NewErrParamRequired("S3ResourcesUpdate"))
  1348. }
  1349. if s.S3ResourcesUpdate != nil {
  1350. for i, v := range s.S3ResourcesUpdate {
  1351. if v == nil {
  1352. continue
  1353. }
  1354. if err := v.Validate(); err != nil {
  1355. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "S3ResourcesUpdate", i), err.(request.ErrInvalidParams))
  1356. }
  1357. }
  1358. }
  1359. if invalidParams.Len() > 0 {
  1360. return invalidParams
  1361. }
  1362. return nil
  1363. }
  1364. // SetMemberAccountId sets the MemberAccountId field's value.
  1365. func (s *UpdateS3ResourcesInput) SetMemberAccountId(v string) *UpdateS3ResourcesInput {
  1366. s.MemberAccountId = &v
  1367. return s
  1368. }
  1369. // SetS3ResourcesUpdate sets the S3ResourcesUpdate field's value.
  1370. func (s *UpdateS3ResourcesInput) SetS3ResourcesUpdate(v []*S3ResourceClassificationUpdate) *UpdateS3ResourcesInput {
  1371. s.S3ResourcesUpdate = v
  1372. return s
  1373. }
  1374. type UpdateS3ResourcesOutput struct {
  1375. _ struct{} `type:"structure"`
  1376. // The S3 resources whose classification types can't be updated. An error code
  1377. // and an error message are provided for each failed item.
  1378. FailedS3Resources []*FailedS3Resource `locationName:"failedS3Resources" type:"list"`
  1379. }
  1380. // String returns the string representation
  1381. func (s UpdateS3ResourcesOutput) String() string {
  1382. return awsutil.Prettify(s)
  1383. }
  1384. // GoString returns the string representation
  1385. func (s UpdateS3ResourcesOutput) GoString() string {
  1386. return s.String()
  1387. }
  1388. // SetFailedS3Resources sets the FailedS3Resources field's value.
  1389. func (s *UpdateS3ResourcesOutput) SetFailedS3Resources(v []*FailedS3Resource) *UpdateS3ResourcesOutput {
  1390. s.FailedS3Resources = v
  1391. return s
  1392. }
  1393. const (
  1394. // S3ContinuousClassificationTypeFull is a S3ContinuousClassificationType enum value
  1395. S3ContinuousClassificationTypeFull = "FULL"
  1396. )
  1397. const (
  1398. // S3OneTimeClassificationTypeFull is a S3OneTimeClassificationType enum value
  1399. S3OneTimeClassificationTypeFull = "FULL"
  1400. // S3OneTimeClassificationTypeNone is a S3OneTimeClassificationType enum value
  1401. S3OneTimeClassificationTypeNone = "NONE"
  1402. )