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