api.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package s3control
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/awsutil"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/private/protocol"
  8. "github.com/aws/aws-sdk-go/private/protocol/restxml"
  9. )
  10. const opDeletePublicAccessBlock = "DeletePublicAccessBlock"
  11. // DeletePublicAccessBlockRequest generates a "aws/request.Request" representing the
  12. // client's request for the DeletePublicAccessBlock operation. The "output" return
  13. // value will be populated with the request's response once the request completes
  14. // successfully.
  15. //
  16. // Use "Send" method on the returned Request to send the API call to the service.
  17. // the "output" return value is not valid until after Send returns without error.
  18. //
  19. // See DeletePublicAccessBlock for more information on using the DeletePublicAccessBlock
  20. // API call, and error handling.
  21. //
  22. // This method is useful when you want to inject custom logic or configuration
  23. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  24. //
  25. //
  26. // // Example sending a request using the DeletePublicAccessBlockRequest method.
  27. // req, resp := client.DeletePublicAccessBlockRequest(params)
  28. //
  29. // err := req.Send()
  30. // if err == nil { // resp is now filled
  31. // fmt.Println(resp)
  32. // }
  33. //
  34. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock
  35. func (c *S3Control) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) (req *request.Request, output *DeletePublicAccessBlockOutput) {
  36. op := &request.Operation{
  37. Name: opDeletePublicAccessBlock,
  38. HTTPMethod: "DELETE",
  39. HTTPPath: "/v20180820/configuration/publicAccessBlock",
  40. }
  41. if input == nil {
  42. input = &DeletePublicAccessBlockInput{}
  43. }
  44. output = &DeletePublicAccessBlockOutput{}
  45. req = c.newRequest(op, input, output)
  46. req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  47. req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels))
  48. req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler)
  49. return
  50. }
  51. // DeletePublicAccessBlock API operation for AWS S3 Control.
  52. //
  53. // Removes the Public Access Block configuration for an Amazon Web Services
  54. // account.
  55. //
  56. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  57. // with awserr.Error's Code and Message methods to get detailed information about
  58. // the error.
  59. //
  60. // See the AWS API reference guide for AWS S3 Control's
  61. // API operation DeletePublicAccessBlock for usage and error information.
  62. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock
  63. func (c *S3Control) DeletePublicAccessBlock(input *DeletePublicAccessBlockInput) (*DeletePublicAccessBlockOutput, error) {
  64. req, out := c.DeletePublicAccessBlockRequest(input)
  65. return out, req.Send()
  66. }
  67. // DeletePublicAccessBlockWithContext is the same as DeletePublicAccessBlock with the addition of
  68. // the ability to pass a context and additional request options.
  69. //
  70. // See DeletePublicAccessBlock for details on how to use this API operation.
  71. //
  72. // The context must be non-nil and will be used for request cancellation. If
  73. // the context is nil a panic will occur. In the future the SDK may create
  74. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  75. // for more information on using Contexts.
  76. func (c *S3Control) DeletePublicAccessBlockWithContext(ctx aws.Context, input *DeletePublicAccessBlockInput, opts ...request.Option) (*DeletePublicAccessBlockOutput, error) {
  77. req, out := c.DeletePublicAccessBlockRequest(input)
  78. req.SetContext(ctx)
  79. req.ApplyOptions(opts...)
  80. return out, req.Send()
  81. }
  82. const opGetPublicAccessBlock = "GetPublicAccessBlock"
  83. // GetPublicAccessBlockRequest generates a "aws/request.Request" representing the
  84. // client's request for the GetPublicAccessBlock operation. The "output" return
  85. // value will be populated with the request's response once the request completes
  86. // successfully.
  87. //
  88. // Use "Send" method on the returned Request to send the API call to the service.
  89. // the "output" return value is not valid until after Send returns without error.
  90. //
  91. // See GetPublicAccessBlock for more information on using the GetPublicAccessBlock
  92. // API call, and error handling.
  93. //
  94. // This method is useful when you want to inject custom logic or configuration
  95. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  96. //
  97. //
  98. // // Example sending a request using the GetPublicAccessBlockRequest method.
  99. // req, resp := client.GetPublicAccessBlockRequest(params)
  100. //
  101. // err := req.Send()
  102. // if err == nil { // resp is now filled
  103. // fmt.Println(resp)
  104. // }
  105. //
  106. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock
  107. func (c *S3Control) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req *request.Request, output *GetPublicAccessBlockOutput) {
  108. op := &request.Operation{
  109. Name: opGetPublicAccessBlock,
  110. HTTPMethod: "GET",
  111. HTTPPath: "/v20180820/configuration/publicAccessBlock",
  112. }
  113. if input == nil {
  114. input = &GetPublicAccessBlockInput{}
  115. }
  116. output = &GetPublicAccessBlockOutput{}
  117. req = c.newRequest(op, input, output)
  118. req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels))
  119. req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler)
  120. return
  121. }
  122. // GetPublicAccessBlock API operation for AWS S3 Control.
  123. //
  124. // Retrieves the Public Access Block configuration for an Amazon Web Services
  125. // account.
  126. //
  127. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  128. // with awserr.Error's Code and Message methods to get detailed information about
  129. // the error.
  130. //
  131. // See the AWS API reference guide for AWS S3 Control's
  132. // API operation GetPublicAccessBlock for usage and error information.
  133. //
  134. // Returned Error Codes:
  135. // * ErrCodeNoSuchPublicAccessBlockConfiguration "NoSuchPublicAccessBlockConfiguration"
  136. // This exception is thrown if a GetPublicAccessBlock request is made against
  137. // an account that does not have a PublicAccessBlockConfiguration set.
  138. //
  139. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock
  140. func (c *S3Control) GetPublicAccessBlock(input *GetPublicAccessBlockInput) (*GetPublicAccessBlockOutput, error) {
  141. req, out := c.GetPublicAccessBlockRequest(input)
  142. return out, req.Send()
  143. }
  144. // GetPublicAccessBlockWithContext is the same as GetPublicAccessBlock with the addition of
  145. // the ability to pass a context and additional request options.
  146. //
  147. // See GetPublicAccessBlock for details on how to use this API operation.
  148. //
  149. // The context must be non-nil and will be used for request cancellation. If
  150. // the context is nil a panic will occur. In the future the SDK may create
  151. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  152. // for more information on using Contexts.
  153. func (c *S3Control) GetPublicAccessBlockWithContext(ctx aws.Context, input *GetPublicAccessBlockInput, opts ...request.Option) (*GetPublicAccessBlockOutput, error) {
  154. req, out := c.GetPublicAccessBlockRequest(input)
  155. req.SetContext(ctx)
  156. req.ApplyOptions(opts...)
  157. return out, req.Send()
  158. }
  159. const opPutPublicAccessBlock = "PutPublicAccessBlock"
  160. // PutPublicAccessBlockRequest generates a "aws/request.Request" representing the
  161. // client's request for the PutPublicAccessBlock operation. The "output" return
  162. // value will be populated with the request's response once the request completes
  163. // successfully.
  164. //
  165. // Use "Send" method on the returned Request to send the API call to the service.
  166. // the "output" return value is not valid until after Send returns without error.
  167. //
  168. // See PutPublicAccessBlock for more information on using the PutPublicAccessBlock
  169. // API call, and error handling.
  170. //
  171. // This method is useful when you want to inject custom logic or configuration
  172. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  173. //
  174. //
  175. // // Example sending a request using the PutPublicAccessBlockRequest method.
  176. // req, resp := client.PutPublicAccessBlockRequest(params)
  177. //
  178. // err := req.Send()
  179. // if err == nil { // resp is now filled
  180. // fmt.Println(resp)
  181. // }
  182. //
  183. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock
  184. func (c *S3Control) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req *request.Request, output *PutPublicAccessBlockOutput) {
  185. op := &request.Operation{
  186. Name: opPutPublicAccessBlock,
  187. HTTPMethod: "PUT",
  188. HTTPPath: "/v20180820/configuration/publicAccessBlock",
  189. }
  190. if input == nil {
  191. input = &PutPublicAccessBlockInput{}
  192. }
  193. output = &PutPublicAccessBlockOutput{}
  194. req = c.newRequest(op, input, output)
  195. req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  196. req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels))
  197. req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler)
  198. return
  199. }
  200. // PutPublicAccessBlock API operation for AWS S3 Control.
  201. //
  202. // Creates or modifies the Public Access Block configuration for an Amazon Web
  203. // Services account.
  204. //
  205. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  206. // with awserr.Error's Code and Message methods to get detailed information about
  207. // the error.
  208. //
  209. // See the AWS API reference guide for AWS S3 Control's
  210. // API operation PutPublicAccessBlock for usage and error information.
  211. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock
  212. func (c *S3Control) PutPublicAccessBlock(input *PutPublicAccessBlockInput) (*PutPublicAccessBlockOutput, error) {
  213. req, out := c.PutPublicAccessBlockRequest(input)
  214. return out, req.Send()
  215. }
  216. // PutPublicAccessBlockWithContext is the same as PutPublicAccessBlock with the addition of
  217. // the ability to pass a context and additional request options.
  218. //
  219. // See PutPublicAccessBlock for details on how to use this API operation.
  220. //
  221. // The context must be non-nil and will be used for request cancellation. If
  222. // the context is nil a panic will occur. In the future the SDK may create
  223. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  224. // for more information on using Contexts.
  225. func (c *S3Control) PutPublicAccessBlockWithContext(ctx aws.Context, input *PutPublicAccessBlockInput, opts ...request.Option) (*PutPublicAccessBlockOutput, error) {
  226. req, out := c.PutPublicAccessBlockRequest(input)
  227. req.SetContext(ctx)
  228. req.ApplyOptions(opts...)
  229. return out, req.Send()
  230. }
  231. type DeletePublicAccessBlockInput struct {
  232. _ struct{} `type:"structure"`
  233. // The Account ID for the Amazon Web Services account whose Public Access Block
  234. // configuration you want to remove.
  235. //
  236. // AccountId is a required field
  237. AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`
  238. }
  239. // String returns the string representation
  240. func (s DeletePublicAccessBlockInput) String() string {
  241. return awsutil.Prettify(s)
  242. }
  243. // GoString returns the string representation
  244. func (s DeletePublicAccessBlockInput) GoString() string {
  245. return s.String()
  246. }
  247. // Validate inspects the fields of the type to determine if they are valid.
  248. func (s *DeletePublicAccessBlockInput) Validate() error {
  249. invalidParams := request.ErrInvalidParams{Context: "DeletePublicAccessBlockInput"}
  250. if s.AccountId == nil {
  251. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  252. }
  253. if s.AccountId != nil && len(*s.AccountId) < 1 {
  254. invalidParams.Add(request.NewErrParamMinLen("AccountId", 1))
  255. }
  256. if invalidParams.Len() > 0 {
  257. return invalidParams
  258. }
  259. return nil
  260. }
  261. // SetAccountId sets the AccountId field's value.
  262. func (s *DeletePublicAccessBlockInput) SetAccountId(v string) *DeletePublicAccessBlockInput {
  263. s.AccountId = &v
  264. return s
  265. }
  266. func (s *DeletePublicAccessBlockInput) hostLabels() map[string]string {
  267. return map[string]string{
  268. "AccountId": aws.StringValue(s.AccountId),
  269. }
  270. }
  271. type DeletePublicAccessBlockOutput struct {
  272. _ struct{} `type:"structure"`
  273. }
  274. // String returns the string representation
  275. func (s DeletePublicAccessBlockOutput) String() string {
  276. return awsutil.Prettify(s)
  277. }
  278. // GoString returns the string representation
  279. func (s DeletePublicAccessBlockOutput) GoString() string {
  280. return s.String()
  281. }
  282. type GetPublicAccessBlockInput struct {
  283. _ struct{} `type:"structure"`
  284. // The Account ID for the Amazon Web Services account whose Public Access Block
  285. // configuration you want to retrieve.
  286. //
  287. // AccountId is a required field
  288. AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`
  289. }
  290. // String returns the string representation
  291. func (s GetPublicAccessBlockInput) String() string {
  292. return awsutil.Prettify(s)
  293. }
  294. // GoString returns the string representation
  295. func (s GetPublicAccessBlockInput) GoString() string {
  296. return s.String()
  297. }
  298. // Validate inspects the fields of the type to determine if they are valid.
  299. func (s *GetPublicAccessBlockInput) Validate() error {
  300. invalidParams := request.ErrInvalidParams{Context: "GetPublicAccessBlockInput"}
  301. if s.AccountId == nil {
  302. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  303. }
  304. if s.AccountId != nil && len(*s.AccountId) < 1 {
  305. invalidParams.Add(request.NewErrParamMinLen("AccountId", 1))
  306. }
  307. if invalidParams.Len() > 0 {
  308. return invalidParams
  309. }
  310. return nil
  311. }
  312. // SetAccountId sets the AccountId field's value.
  313. func (s *GetPublicAccessBlockInput) SetAccountId(v string) *GetPublicAccessBlockInput {
  314. s.AccountId = &v
  315. return s
  316. }
  317. func (s *GetPublicAccessBlockInput) hostLabels() map[string]string {
  318. return map[string]string{
  319. "AccountId": aws.StringValue(s.AccountId),
  320. }
  321. }
  322. type GetPublicAccessBlockOutput struct {
  323. _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"`
  324. // The Public Access Block configuration currently in effect for this Amazon
  325. // Web Services account.
  326. PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"`
  327. }
  328. // String returns the string representation
  329. func (s GetPublicAccessBlockOutput) String() string {
  330. return awsutil.Prettify(s)
  331. }
  332. // GoString returns the string representation
  333. func (s GetPublicAccessBlockOutput) GoString() string {
  334. return s.String()
  335. }
  336. // SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value.
  337. func (s *GetPublicAccessBlockOutput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *GetPublicAccessBlockOutput {
  338. s.PublicAccessBlockConfiguration = v
  339. return s
  340. }
  341. // The container element for all Public Access Block configuration options.
  342. // You can enable the configuration options in any combination.
  343. //
  344. // Amazon S3 considers a bucket policy public unless at least one of the following
  345. // conditions is true:
  346. //
  347. // The policy limits access to a set of CIDRs using aws:SourceIp. For more information
  348. // on CIDR, see http://www.rfc-editor.org/rfc/rfc4632.txt (http://www.rfc-editor.org/rfc/rfc4632.txt)
  349. //
  350. // The policy grants permissions, not including any "bad actions," to one of
  351. // the following:
  352. //
  353. // A fixed AWS principal, user, role, or service principal
  354. //
  355. // A fixed aws:SourceArn
  356. //
  357. // A fixed aws:SourceVpc
  358. //
  359. // A fixed aws:SourceVpce
  360. //
  361. // A fixed aws:SourceOwner
  362. //
  363. // A fixed aws:SourceAccount
  364. //
  365. // A fixed value of s3:x-amz-server-side-encryption-aws-kms-key-id
  366. //
  367. // A fixed value of aws:userid outside the pattern "AROLEID:*"
  368. //
  369. // "Bad actions" are those that could expose the data inside a bucket to reads
  370. // or writes by the public. These actions are s3:Get*, s3:List*, s3:AbortMultipartUpload,
  371. // s3:Delete*, s3:Put*, and s3:RestoreObject.
  372. //
  373. // The star notation for bad actions indicates that all matching operations
  374. // are considered bad actions. For example, because s3:Get* is a bad action,
  375. // s3:GetObject, s3:GetObjectVersion, and s3:GetObjectAcl are all bad actions.
  376. type PublicAccessBlockConfiguration struct {
  377. _ struct{} `type:"structure"`
  378. // Specifies whether Amazon S3 should block public ACLs for buckets in this
  379. // account. Setting this element to TRUE causes the following behavior:
  380. //
  381. // * PUT Bucket acl and PUT Object acl calls will fail if the specified ACL
  382. // allows public access.
  383. //
  384. // * PUT Object calls will fail if the request includes an object ACL.
  385. //
  386. // Note that enabling this setting doesn't affect existing policies or ACLs.
  387. BlockPublicAcls *bool `locationName:"BlockPublicAcls" type:"boolean"`
  388. // Specifies whether Amazon S3 should block public bucket policies for buckets
  389. // in this account. Setting this element to TRUE causes Amazon S3 to reject
  390. // calls to PUT Bucket policy if the specified bucket policy allows public access.
  391. //
  392. // Note that enabling this setting doesn't affect existing bucket policies.
  393. BlockPublicPolicy *bool `locationName:"BlockPublicPolicy" type:"boolean"`
  394. // Specifies whether Amazon S3 should ignore public ACLs for buckets in this
  395. // account. Setting this element to TRUE causes Amazon S3 to ignore all public
  396. // ACLs on buckets in this account and any objects that they contain.
  397. //
  398. // Note that enabling this setting doesn't affect the persistence of any existing
  399. // ACLs and doesn't prevent new public ACLs from being set.
  400. IgnorePublicAcls *bool `locationName:"IgnorePublicAcls" type:"boolean"`
  401. // Specifies whether Amazon S3 should restrict public bucket policies for buckets
  402. // in this account. If this element is set to TRUE, then only the bucket owner
  403. // and AWS Services can access buckets with public policies.
  404. //
  405. // Note that enabling this setting doesn't affect previously stored bucket policies,
  406. // except that public and cross-account access within any public bucket policy,
  407. // including non-public delegation to specific accounts, is blocked.
  408. RestrictPublicBuckets *bool `locationName:"RestrictPublicBuckets" type:"boolean"`
  409. }
  410. // String returns the string representation
  411. func (s PublicAccessBlockConfiguration) String() string {
  412. return awsutil.Prettify(s)
  413. }
  414. // GoString returns the string representation
  415. func (s PublicAccessBlockConfiguration) GoString() string {
  416. return s.String()
  417. }
  418. // SetBlockPublicAcls sets the BlockPublicAcls field's value.
  419. func (s *PublicAccessBlockConfiguration) SetBlockPublicAcls(v bool) *PublicAccessBlockConfiguration {
  420. s.BlockPublicAcls = &v
  421. return s
  422. }
  423. // SetBlockPublicPolicy sets the BlockPublicPolicy field's value.
  424. func (s *PublicAccessBlockConfiguration) SetBlockPublicPolicy(v bool) *PublicAccessBlockConfiguration {
  425. s.BlockPublicPolicy = &v
  426. return s
  427. }
  428. // SetIgnorePublicAcls sets the IgnorePublicAcls field's value.
  429. func (s *PublicAccessBlockConfiguration) SetIgnorePublicAcls(v bool) *PublicAccessBlockConfiguration {
  430. s.IgnorePublicAcls = &v
  431. return s
  432. }
  433. // SetRestrictPublicBuckets sets the RestrictPublicBuckets field's value.
  434. func (s *PublicAccessBlockConfiguration) SetRestrictPublicBuckets(v bool) *PublicAccessBlockConfiguration {
  435. s.RestrictPublicBuckets = &v
  436. return s
  437. }
  438. type PutPublicAccessBlockInput struct {
  439. _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"`
  440. // The Account ID for the Amazon Web Services account whose Public Access Block
  441. // configuration you want to set.
  442. //
  443. // AccountId is a required field
  444. AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`
  445. // The Public Access Block configuration that you want to apply to this Amazon
  446. // Web Services account.
  447. //
  448. // PublicAccessBlockConfiguration is a required field
  449. PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `locationName:"PublicAccessBlockConfiguration" type:"structure" required:"true" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"`
  450. }
  451. // String returns the string representation
  452. func (s PutPublicAccessBlockInput) String() string {
  453. return awsutil.Prettify(s)
  454. }
  455. // GoString returns the string representation
  456. func (s PutPublicAccessBlockInput) GoString() string {
  457. return s.String()
  458. }
  459. // Validate inspects the fields of the type to determine if they are valid.
  460. func (s *PutPublicAccessBlockInput) Validate() error {
  461. invalidParams := request.ErrInvalidParams{Context: "PutPublicAccessBlockInput"}
  462. if s.AccountId == nil {
  463. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  464. }
  465. if s.AccountId != nil && len(*s.AccountId) < 1 {
  466. invalidParams.Add(request.NewErrParamMinLen("AccountId", 1))
  467. }
  468. if s.PublicAccessBlockConfiguration == nil {
  469. invalidParams.Add(request.NewErrParamRequired("PublicAccessBlockConfiguration"))
  470. }
  471. if invalidParams.Len() > 0 {
  472. return invalidParams
  473. }
  474. return nil
  475. }
  476. // SetAccountId sets the AccountId field's value.
  477. func (s *PutPublicAccessBlockInput) SetAccountId(v string) *PutPublicAccessBlockInput {
  478. s.AccountId = &v
  479. return s
  480. }
  481. // SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value.
  482. func (s *PutPublicAccessBlockInput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *PutPublicAccessBlockInput {
  483. s.PublicAccessBlockConfiguration = v
  484. return s
  485. }
  486. func (s *PutPublicAccessBlockInput) hostLabels() map[string]string {
  487. return map[string]string{
  488. "AccountId": aws.StringValue(s.AccountId),
  489. }
  490. }
  491. type PutPublicAccessBlockOutput struct {
  492. _ struct{} `type:"structure"`
  493. }
  494. // String returns the string representation
  495. func (s PutPublicAccessBlockOutput) String() string {
  496. return awsutil.Prettify(s)
  497. }
  498. // GoString returns the string representation
  499. func (s PutPublicAccessBlockOutput) GoString() string {
  500. return s.String()
  501. }